I'm not so sure about this. Here is my code:
--- xhtml code snippet:
<tr:selectOneChoice readOnly="#{sessionBean.readOnly}"
label="Vinkulacija:" value="#{objectBean.vinkulant}"
unselectedLabel="--- Bez vinkulacije ---" >
<f:selectItems
value="#{AdminMB.vinkulant.vinkulantsSelectItem}" />
</tr:selectOneChoice>
AdminMB.vinkulant.vinkulantsSelectItem (managed bean for selectItems):
public SelectItem[] getVinkulantsSelectItem(){
List<Vinkulant> lc=getVinkulants();
SelectItem si[]=new SelectItem[lc.size()];
int i=0;
for(Vinkulant c:lc){
si[i++]=new SelectItem(c,c.getName());
}
return si;
}
public List<Vinkulant> getVinkulants() {
List<Vinkulant> cl=em.createQuery("select c from Vinkulant c
order by c.name").getResultList();
if(isInserting())
cl.add(0,getVinkulant());
return cl;
}
-----------------------------------------------------------------
AbstractPolicy - class where value is holded (objectBean in xhtml):
public Vinkulant getVinkulant() {
return vinkulant;
}
public void setVinkulant(Vinkulant vinkulant) {
this.vinkulant = vinkulant;
}
---------------------------------------------------------
I'm sure that the value is properly stored (visible on other places).
The problem is that only this tr:selectOneChoice for this data isn't
showing correctly (if value is null then nothing is displayed as value
in this component and if is there any value then the warning message
logged on server and unselectedLabel is displayed), all other
selectOneChoice (more then 20) in this form are working properly.
Simon Lessard wrote:
Hello Luka,
This is not a component bug, most likely an application one (true
component bugs rarely log a warning, they more often throw an
exception or, at worst, don't print anything at all).
The error you have occurs when the list of value either cannot be
restored or changed during the postback, thus preventing the component
to identify what value was selected by the user. If you could provide
the code snippet from your page that uses the selectOneMenu as well as
the managed bean code that provide the list of values (and its scope),
I would probably be able to suggest you a solution.
Regards,
~ Simon
On 9/5/07, *Luka Surija* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
I've found out that tr:selectOneChoice isn't working properly in some
cases (probably German characters):
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer
Hypo-Leasing Kärnten GmbH & Co
KG;CoreSelectOneChoice[UIXEditableFacesBeanImpl,
id=j_id156];_RequestID=552df7f7-a8b8-4887-a77b-8b3f864c0b01;|Could not
find selected item matching value "Hypo-Leasing Kärnten GmbH & Co
KG" in
CoreSelectOneChoice[UIXEditableFacesBeanImpl, id=j_id156]|#]
This is very serious bug because every time someone edit some data
where
is this selectOneChoice, after saving, data is lost.