How do you mean see if the value "Hypo-Leasing Kärnten GmbH & Co KG"
exists in it?
This entry exists in dropdown list of values for rendered ComboBox in
browser (in source code I can't see if this is the one, because
itemIndex is not an ID of the Vinkulant object. In database also
everything is allright.
I've do some more tests, and now I see that this is an general issue for
this attribute (it means that doesn't work for any value, but I can't
see whats wrong in compare of ie. NavigationArea selectOneChoice - there
are the same except class type). I'm using trinidad last 8 month (before
I've used ADF Faces) so I'm not newbie in this field, but this last
project I'm working with trinidad and facelets is killing me.
So far I've discovered following wired issues:
- XMLMenuModel -> has issue with locale, and doAction problem
- Dialog framework -> if an action is called as an method returning
string "dialog:something" then nothing is happening (no dialog is
displayed), but if action is 'hardcoded' "dialog:something" then
everything works as expected
- bellow mentioned issues with facelets (ok duplicate id is a know bug)
- now this wired selectOneChoice issue.
I don't know what to think about this. I can't imagine that no one else
is using trinidad as much as I'm and didn't encounter the same problems
(issues), so the only reasonable explanation is that something is wrong
with my "constelaton" of application server (glassfish v2 b50), trinidad
(1.0.3 trunk) and facelets (1.1.12) but what?
Tnx
Luka
Simon Lessard wrote:
Odd... I'll think a bit about it, but I don't see what could cause the
problem then. Can you add a log in your getListOfValues method and see
if the value "Hypo-Leasing Kärnten GmbH & Co KG" exists in it?
As a side note comment though, you could cache the list of values for
the length of the request (or clear it at some point if you know it
changed) to improve performance a bit, as the method might be called
more than once, but that shouldn't fix your issue though.
Regards,
~ Simon
On 9/5/07, *Luka Surija* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
isInserting is stable. It is used in another part of application, and
has nothing to do with this part (it is always false). No luck with
valuePassThru. It is really funny because 3 lines before in the same
xhtml I have this code snippet and it's working correctly as
expected:
<tr:selectOneChoice readOnly="#{sessionBean.readOnly}" label="Podrucje
plovidbe:" value="#{objectBean.navigationArea}" >
<f:selectItems
value="#{ AdminMB.navigationArea.navigationAreasSelectItem}" />
</tr:selectOneChoice>
AdminMB.navigationArea.navigationAreasSelectItem:
public SelectItem[] getNavigationAreasSelectItem(){
List<NavigationArea> lc=getNavigationAreas();
SelectItem si[]=new SelectItem[lc.size()];
int i=0;
for(NavigationArea c:lc){
si[i++]=new SelectItem(c,c.getNameHR());
}
return si;
}
public List<NavigationArea> getNavigationAreas() {
List<NavigationArea> nal=em.createQuery("select c from
NavigationArea c order by c.nameHR").getResultList();
if(isInserting())
nal.add(0,getNavigationArea());
return nal;
}
-----------------------------------------------------------------
AbstractPolicy - class where value is holded (objectBean in xhtml):
public NavigationArea getNavigationArea() {
return navigationArea
}
public void setNavigationArea(NavigationArea navigationArea {
this.navigationArea = navigationArea;
}
---------------------------------------------------------
Is there any possibility that there are some issues with facelets and
what is recommended version (I'm working with 1.1.12). I've also
noticed
following issues with facelets:
- duplicate id in tr:showDetail after expanding
- from time to time (unreproducible for me) ui:param inside
ui:include
is not assigned. Example:
<ui:include src="my.xhtml">
<ui:param name="objectBean" value="#{ManagedBean.myObject}" />
</ui:include>
Sometime objectBean is null inside my.xhtml, but
ManagedBean.myObject is
not ?!
So is there any other know issue between facelets and trinidad?
Some small ones, but none that hindering to my knowledge.
Regards,
Luka
Simon Lessard wrote:
> Hello Luka,
>
> Is the method isInserting() stable? Is it possible that it returns
> false on postback? Also, you cna try setting the valuePassThru
> attribute of the selectOneMenu to true to see if it helps.
>
>
> Regards,
>
> ~ Simon
>
> On 9/5/07, *Luka Surija* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
> <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
>
> 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 <http://c.name>
<http://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]>
> <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
> > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
<mailto:[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.
> >
> >
>
>