November Happy Hour will be moved to Thursday December 5th.

selected/not selected in Dynamic Property - value always inherited but should not be

Vote:
 

I am having difficulty with a Dynamic Property using the selected / not selected control. It is used to hide a property if ticked.

If the property is ticked in one node, when I refer to a child of that not (in which it is not ticked) the value always comes back as true.

I have tried setting the root node to unticked and ticking the box to the left to force the value in all children as a kind of default value, but to no avail.

 

Any ideas?

#48942
Feb 23, 2011 17:24
Vote:
 

that is actully by design....

Make yourself a property that is PropertyString, and use 1 for true, 0 for false

#48943
Feb 23, 2011 18:39
Vote:
 

Exactly, it's by design. To elaborate, in case you wonder why it works this way: The checked/unchecked represents true/false and false is treated as null. A page inherits a dynamic property unless it is set to something not null on the page.

By using a string (which is stored as null if it is empty) with values "1" and "0" as Anders suggests you can have "0" override "1". Preferably you build a dropdown or radiobutton control to display the values "selected" "not selected" and "not set" instead of just a textbox. You can use the PropertySelectControlBase for that, or just go with the Dynamic list: http://antecknat.se/blog/2008/04/18/new-appsettings-and-appsettingsmultiple-in-episerver-cms-5/

#48945
Feb 24, 2011 7:54
Vote:
 

This makes sense, thank you.

It does show that the model does not really work for selected/not selected so really it should not be there?

I have used if (dp.InheritedPageLink.ID == 0) to get around it, as I had to implement something before I had read your replies. 

 

 

#48960
Feb 24, 2011 14:17
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.