Jean-Vincent Drean wrote:
> You can use the following notation in the static list values
> definition: "1=Value 1|2=Value 2|3=Value 3"
> The generated HTML will look like:
> <option value="1" label="Value 1">Value 1</option>
> <option value="2" label="Value 2">Value 2</option>
> <option value="3" label="Value 3">Value 3</option>
> 
> JV.
> 
> On Wed, Mar 10, 2010 at 6:24 PM, Abel Solórzano Astorga
> <[email protected]> wrote:
>> Hi,
>>
>>
>>
>> Is there a way to modify the values of the options in the select element
>> (html) associated with a Static List?
>>
>> I noticed that the values are the same as the text that is shown on the
>> list.
>>
>> I have:
>>
>> *<select id="SSI-Internal.CreateIssue_0_priority"
>> name="SSI-Internal.CreateIssue_0_priority" size="1">*
>>
>> *  <option label="Show Stopper" value="Show Stopper">Show Stopper</option>*
>>
>> *  <option label="Must Have" value="Must Have">Must Have</option>*
>>
>> *  <option label="Should Have" value="Should Have">Should Have</option>*
>>
>> *  <option label="Could Have" value="Could Have">Could Have</option>*
>>
>> *  <option label="Not In Roadmap" value="Not In Roadmap">Not In
>> Roadmap</option>*
>>
>> *</select>*
>>
>> I want something like:
>>
>> *<select id="SSI-Internal.CreateIssue_0_priority"
>> name="SSI-Internal.CreateIssue_0_priority" size="1">*
>>
>> *  <option value="1">Show Stopper</option>*
>>
>> *  <option value="2">Must Have</option>*
>>
>> *  <option value="3">Should Have</option>*
>>
>> *  <option value="4">Could Have</option>*
>>
>> *  <option value="5">Not In Roadmap</option>*
>>
>> *</select>*
>>
>>
>>
>> I am using the following code to modify the values:
>>
>>
>>
>> *valdoc = xwiki.getDocument("SSI-Internal.CreateIssue")*
>>
>> *ok = valdoc.updateObjectFromRequest("SSI-Internal.CreateIssue")*
>>
>> *
>> valdoc.getxWikiClass().get("priority").getPropertyClass().setValues(“a|b|c”)

It looks like you are writing a bug tracker which I think is very cool!

I think you will need to use valdoc.getDocument().getxWikiClass() again
get("priority") will return a PropertyInterface which has no setValues function 
so you will
have to cast it to StaticListClass like so.

((StaticListClass) 
valdoc.getDocument().getxWikiClass().get("priority")).setValues("a|b|c");

It appears that this will work although I haven't tested it.

Caleb

>> *
>>
>>
>>
>> Thanks,
>>
>>
>>
>> Abel
>> _______________________________________________
>> users mailing list
>> [email protected]
>> http://lists.xwiki.org/mailman/listinfo/users
>>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/users
> 

_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to