-
-
-
3. Re: Entity Convert
nusseis Sep 3, 2007 7:34 AM (in response to nusseis)@pete: thanks buddy, you're making my day, that works!
@amitev: no, I don't...at least I think I don't :) -
4. Re: Entity Convert
nusseis Sep 25, 2007 3:33 AM (in response to nusseis)Well, I'm back...
Ain't got problems with the selectOneMenu, but with the selectManyMenu and I don't know why. Hoping for help, so here's what I've got:
I've implemented the equals and hashCode Method in all of my entity beans@Override public boolean equals(Object obj) { if (!(obj instanceof Platform)) { return false; } Platform o = (Platform) obj; return this.platform_id == o.getPlatform_id(); } @Override public int hashCode() { int result = 17; result = 37 * result + this.platform_id; return result; }
And that works fine with the selectOneMenu, no errors or warnings. Now I've got a selectManyMenu, that looks like this:<h:selectManyMenu value="#{release.platform_id}" id="selectPlatformList" size="10"> <s:selectItems value="#{admin_release.ra_platformList}" var="p" label="#{p.platform_descr}" /> <s:convertEntity /> </h:selectManyMenu>
Now the question: Why do I get the "Value is not a valid option" message? -
5. Re: Entity Convert
fhh Sep 25, 2007 9:24 AM (in response to nusseis)You have to specify the entity class on the convertentity tag. It can not automatically detect the entity class of a collection.
Regards
Felix -
6. Re: Entity Convert
nusseis Sep 26, 2007 3:00 AM (in response to nusseis)That sounds got, thanks!
Could you tell me how the specify the class? I can't find anything in the seam docu or on google... -
7. Re: Entity Convert
atzbert Sep 26, 2007 5:33 AM (in response to nusseis)Hi there..
I have a very similar problem. In fact I am fighting with it for weeks now, postponing its solution over and over...I don't know when it happened the first time, but it arose out of the blue.
I am using Seam 1.2.1GA on JBoss 4.0.5GA with Facelets, Ajax4JSF, seam managed persisten context, and JSF 1.2 RI.
It's the User entity, a select many dropdown will give me random invalid values for the select items in it. Say, there are 10 values in that list, all are shown, then the first, the 3rd and maybe the fifth will be accepted all others receive a "value is not valid". On the same page I am using the selectItems with another entity type (Customer) with no problem at all. Further I am deriving my entities all from a DbItem super class which ensures ID equality and such...
I tried nearly everything imaginable. Changed the entity name, refactored the class name, copied the entityConverter and overrode it with my more verbose implementation. I really have no idea why this happens only for this particular entity. I was even migrating to Seam-2CR1 tested it shortly and noticed the same problem, but with a minor difference: after trying to apply the values, i.e. submitting the form, the rerendered paged showed empty labels in the dropdown, with all values set to ??.noSelectionValue???...
Does this sound familiar to anybody? Or is there anybody out there having an idea for a possible solution?
Pete?
thanks,
Tino
The XHTML piece:<h:selectOneMenu value="#{query.example.cataloguer}" id="item_cataloguer"> <s:selectItems value="#{allUserList.resultList}" var="user" label="#{user.stringRep}"/> <s:convertEntity/> </h:selectOneMenu>
-
8. Re: Entity Convert
pmuir Sep 26, 2007 9:17 AM (in response to nusseis)You should try upgrading to Seam2 - the entity converter is significantly different.
-
9. Re: Entity Convert
newlukai Sep 26, 2007 9:40 AM (in response to nusseis)@ffh: The tag convertEntity doesn't have any attributes. And as far as I can see, the EntityConverter is intelligent enough to recognize classes.
Perhaps the problem is not the EntityConverter but the implementation of h:selectManyMenu? Since nusseis doesn't have problems with selectOneMenu.
@Peter: I got the same advice from you. But I think that updating to Seam2 is only imaginable when Seam2 is released. I read a few times about this "selection is invalid" problem. Maybe they are all caused by the same little bug. Would be nice if this could be fixed. -
10. Re: Entity Convert
pmuir Sep 26, 2007 10:13 AM (in response to nusseis)There are currently no plans for 1.2.2.GA release.