Update selected value of Backoffice dropdownlist from contentservice
Hello!
How do I update the selected value of a dropdownlist page property using ContentService (or other)?
I have a property on a page called "state". This is of type Dropdown list. I've added a few prevalues in Backoffice. Now I'm trying to set the selected option of the dropdown list to one of the prevalues using ContentService.
The problem is, I don't know what it expects as a value. I tried with a string and an int and it does save the value (I can see it in the umbraco.config) as
<state><![CDATA[myValue]]></state>
. But it never updates the backoffice property selected value.
Here's my code (here I'm setting the value from an Enum):
var service = new ContentService(); var content = service.GetById(myContentId);
So you're trying to link a dropdown to an enum? In that case it might be easier to have a look at nuPickers. I've also got an example on how to use an enum with a dropdown in the Hybrid Framework.
Update selected value of Backoffice dropdownlist from contentservice
Hello!
How do I update the selected value of a dropdownlist page property using ContentService (or other)?
I have a property on a page called "state". This is of type Dropdown list. I've added a few prevalues in Backoffice. Now I'm trying to set the selected option of the dropdown list to one of the prevalues using ContentService.
The problem is, I don't know what it expects as a value. I tried with a string and an int and it does save the value (I can see it in the umbraco.config) as
. But it never updates the backoffice property selected value.
Here's my code (here I'm setting the value from an Enum):
Any ideas on this would be very much appreciated :)
Hello,
So you're trying to link a dropdown to an enum? In that case it might be easier to have a look at nuPickers. I've also got an example on how to use an enum with a dropdown in the Hybrid Framework.
Jeroen
Hello, and thanks for your answer!
Anything is fine really. I just need to know how to set the selected value of a Backoffice dropdown list property from code. :)
Btw, the link http://projects/developer-tools/hybrid-framework-for-umbraco-v7 is not working..
Best,
Jesper
Sorry here is the correct link: http://our.umbraco.org//projects/developer-tools/hybrid-framework-for-umbraco-v7
is working on a reply...