Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    Jul 09, 2010 @ 14:55
    Ali Sheikh Taheri
    1

    doesnt set checkbox for True/False umbracoDataType

    First Thanks for your wicked and great package.

    I've got a bit of problem with True/False umbraco data type and I believe that you could help me.

    I have a bit datatype in my table and with the values of either True or False. but when it's True the True/False datatype (or checkbox ) in edit mode is not checked any idea is much appreciated 

    Cheers

    Ali

  • Sune Bøegh 64 posts 374 karma points
    Jul 13, 2010 @ 16:10
    Sune Bøegh
    0

    Hi Ali,

    Sorry about the late reply, apparently I'm not notified when someone posts to this forum (better get that fixed).

    Thanks, glad you're using it! I'll look into the problem with the true/false data type you're having as soon as possible. 

    I'm sorry to say that I can't really think of a workaround right now other than having a text field. Or perhaps implementing a custom field type for true/false as a workaround.

    I'll get back to you :)

    - Sune

  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    Jul 13, 2010 @ 16:16
    Ali Sheikh Taheri
    0

    Hi Sune, 

    Thanks for your reply and one the best package ever built for Umbraco.

    The only problem is that it doesn't select the checkbox in editing mode, so every time users have to reselect it when they want to make a change or edit a record.

    I think for now I will just deal with it but for future I really need to change it.

    Just came to my mind could it be because of having true/false in database and checkbox is dealing with one and zero?

    Kind Regards,

    Ali 

  • Sune Bøegh 64 posts 374 karma points
    Jul 13, 2010 @ 16:35
    Sune Bøegh
    1

    Hi Ali,

    That's very kind, thanks! It's exactly right what you're thinking about the one/zero vs. true/false stuff.

    I've come up with a workaround, if you wan't to use the True/false control. You implement a new IField like this:
    --- snippet: BitField.cs (put it in App_Code for example) ---
    using System.Xml.Linq;
    using Eksponent.Dewd.Editors;

    public class BitField : Eksponent.Dewd.Fields.Field
    {
     public BitField(XElement element, IEditor editor) : base(element, editor) { }

        public override void ProcessValueBeforeEdit(ref object value)
        {
            // if value is boolean convert it to 1/0 string, because umbraco-yesno-control expect this
            if (value is bool)
                value = ((bool)value) ? "1" : "0";
            base.ProcessValueBeforeEdit(ref value);
        }

    --- snippet ends ---
    And add the new type to the affected fields, like this:
    <field type="BitField,App_Code" title="Bit" sourceField="testBit" umbracoDataType="True/false" />

    I've tested it with SQL Server, where it seems to work.

     

     

     

    - Sune

  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    Jul 13, 2010 @ 17:06
    Ali Sheikh Taheri
    0

    Hi Sune,

    Thanks a lot with your wonderful solution it worked. You are Star mate.

    Many Thanks.

    Kind Regards,

    Ali

  • Sune Bøegh 64 posts 374 karma points
    Jul 13, 2010 @ 17:25
    Sune Bøegh
    0

    No problem, glad it worked! :)

    I'll make a permanent fix for this bug in the next release. If you discover anything else or have feature proposals, please don't hestitate to get in touch.

    - Sune

  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    Jul 13, 2010 @ 17:40
    Ali Sheikh Taheri
    0

    What I would think of is to have checkbox for deleting mutliple items.

    Another one which I believe would be a great feature is to have instant editing. for example: by clicking on a field it changes from label to textbox or checkbox.

    Best Regards,

    Ali

  • Sune Bøegh 64 posts 374 karma points
    Jul 13, 2010 @ 18:21
    Sune Bøegh
    0

    Yup, I very much agree with both suggestions and they are on the roadmap for future development. I'm not sure if it would be too hard to use umbraco data types for instant editing (it gets tricky for example with the wyiwyg-editor), but that would definitely be the most optimal solution.

    Another thing I'm looking into is some sort of simple security system for controlling access to the repositories, if a lot of different people are using the extension for different purposes.

    - Sune

  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    Jul 21, 2010 @ 11:17
    Ali Sheikh Taheri
    0

    Hi Sune,

    I was just playing with your package again, and came up with some new ideas.

    • Export to Excel/CSV
    • Sort function for columns
    Good Luck mate
    Cheers
    Ali

  • Sune Bøegh 64 posts 374 karma points
    Jul 21, 2010 @ 13:04
    Sune Bøegh
    0

    Hi Ali,

    Good ideas :)

    I've been thinking about doing a really simple extension framework for adding features such as Export to Excel/CSV. You can actually do it already by implementing your own View, but it would be nicer to be able to reuse such functionality for different view types. So I was leaning towards some sort of IExtension interface, that would hook into central functionality in both Views and Editors and allow developer to add buttons and so on, which would make setting up a Export-button a piece of cake. It's still on the drawing board though :)

    Sort function is a bit tricky, because the underlying data source is totally unknown to the grid that renders the columns and rows. But it could be done and I'll look some more into it, if its something the users think is missing.

    Be the way you're always welcome to create feature proposals on codeplex where it's possible to vote and comment on ideas: http://dewd.codeplex.com/workitem/list/basic.

    Thanks for the feedback!

  • eshan 12 posts 42 karma points
    Feb 05, 2013 @ 06:25
    eshan
    0

    Hi Sune,

    Is this issue fixed on v1.2? If so what should be the umbracoDataType? I have tried the "True/False" but the same issues it's not checked for true values when it's on edit mode.

  • Sune Bøegh 64 posts 374 karma points
    Feb 05, 2013 @ 21:01
    Sune Bøegh
    0

    Hi Eshan,

    You should set the type to "YesNo", like this:
    <fieldtitle="Bit"sourceField="TestBit"umbracoDataType="True/false"type="YesNo" />

    Should work, but please let me know, if it causes any problems.

  • Matt Barlow | jacker.io 164 posts 739 karma points c-trib
    Apr 05, 2013 @ 17:53
    Matt Barlow | jacker.io
    0

    That works, maybe need to put some info about it in the Package example config.

    ps. Brillant umbraco package!

  • Sune Bøegh 64 posts 374 karma points
    Apr 09, 2013 @ 10:53
    Sune Bøegh
    0

    Hi Matt,

    Good point. Will be doing new documentation/examples for v2.0 and will include it in that.

    Thanks :)

    - Sune  

  • Peter Karas 9 posts 30 karma points
    Mar 05, 2014 @ 13:22
    Peter Karas
    0

    Hi,

    I'm using version 1.2 now and the issue is still there. However the workaround (using BitField code) works really well.

     

     

Please Sign in or register to post replies

Write your reply to:

Draft