This seems to help, but partially - the form indeed has now the value set to
1, but it is no longer a combobox, but rather an outputText. I think that
this is caused by the fact that when you set the value this way
(value="#{1}") then it is read-only.
Stephen Friedrich-4 wrote:
>
> Just a guess: Try value="#{1}"
>
> tkazmierczak wrote:
>> Hello,
>> I've searched half of the Internet, but haven't found an answer to my
>> question.
>>
>> I create a tr:selectOneChoice this way:
>>
>> <tr:selectOneChoice label="Start year" value="1" required="true"
>> valuePassThru="true">
>> <tr:forEach var="year" begin="0" end="10">
>> <tr:selectItem label="#{year}" value="#{year}" />
>> </tr:forEach>
>> </tr:selectOneChoice>
>>
>> and want the resulting HTML combobox to have the value with label "1" set
>> by
>> default, but what I get is that the combobox is set to an "empty" value
>> and
>> I get this error message in the server's output:
>>
>> 2008-09-09 15:54:23
>> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer
>> _getSelectedIndex
>> WARNING: Could not find selected item matching value "1" in
>> CoreSelectOneChoice[UIXEditableFacesBeanImpl, id=_idJsp9]
>>
>> What is wrong/missing in the code?
>> I'm using Trinidad 1.0.7.
>
>
>
--
View this message in context:
http://www.nabble.com/default-value-in-tr%3AselectOneChoice-tp19393693p19527792.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.