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
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.
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?
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: <fieldtype="BitField,App_Code"title="Bit"sourceField="testBit"umbracoDataType="True/false" />
I've tested it with SQL Server, where it seems to work.
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.
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.
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.
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.
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.
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
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
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
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
Hi Sune,
Thanks a lot with your wonderful solution it worked. You are Star mate.
Many Thanks.
Kind Regards,
Ali
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
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
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
Hi Sune,
I was just playing with your package again, and came up with some new ideas.
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!
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.
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.
That works, maybe need to put some info about it in the Package example config.
ps. Brillant umbraco package!
Hi Matt,
Good point. Will be doing new documentation/examples for v2.0 and will include it in that.
Thanks :)
- Sune
Hi,
I'm using version 1.2 now and the issue is still there. However the workaround (using BitField code) works really well.
is working on a reply...