-
1. Re: h:selectOneMenu(s:selectItems and f:converter) problem
dhinojosa Jun 27, 2008 5:38 PM (in response to ericji)What's orgConverter? and can't you use
<s:convertEntity>
?
-
2. Re: h:selectOneMenu(s:selectItems and f:converter) problem
ericji Jun 27, 2008 7:06 PM (in response to ericji)orgConverter is my converter class,it works fine, my issue is: When I submit the page, invoke a MyBean method, in this method, I need the selected value from s:selectItems, but I can't get it, it's null, the set method doesn't work. set method as below: public void setSelOrg(String selOrg) { this.selOrg = selOrg; }
-
3. Re: h:selectOneMenu(s:selectItems and f:converter) problem
nagendra_singh_krishnawat Aug 2, 2008 2:57 AM (in response to ericji)I am facing the same issue dude... did u get the solution ??
-
4. Re: h:selectOneMenu(s:selectItems and f:converter) problem
luxspes Aug 2, 2008 3:45 AM (in response to ericji)Hi!
I am guessing your OrgBean.getAllOrg() method does not return a list of strings, but a list of object of type
Org
therefore, you should be using <s:convertEntity> (as Daniel suggested) and you set method (setSelOrg) should not receive a string, it should receive an object ofOrg
type.Regards,
-
5. Re: h:selectOneMenu(s:selectItems and f:converter) problem
ritchierd Dec 11, 2008 5:09 AM (in response to ericji)Hello,
What if your list of items you are passing to s:selectItems is not an enumeration OR a POJO annotated with @Entity?
<s:convertEntity/> throws an exception if the items in the list aren't an entity.
What I am trying to do is similar to what the original post in this thread stated:
<h:selectOneMenu value="#{value}">
<s:selectItems value="#{bean.choices}"
var="choice"
label="#{choice.label}" />
<s:convertEntity/>
</h:selectOneMenu>
The issue is that #{bean.choices} returns a list of "choice" objects that have a few attributes and a getLabel() method. The "choice" class, however, is not an Entity and has no table behind it.
The #{bean.choices} list is populated by a service call.
Do you know of any way to make a POJO an Entity without mapping it to a table so I can use the s:convertEntity tag?
OR
Do you know of any way to force the s:selectItems to use a specific converter?
Thanks,
#25
~BOB~ -
6. Re: h:selectOneMenu(s:selectItems and f:converter) problem
frer Apr 6, 2009 5:31 PM (in response to ericji)Hi Bob,
I had the same problem and had trouble formulating it. Did you get to solve your problem?
I also have a list of not-entity objects and would like to iterate it.
For now my temp solution is to use a4j:repeat with a seletItem inside but I need to bind my result to a string instead of an object which I find annoying. Its a workaround but its rather
unclean
.If anyone knows of a way to solve this I'd be really interested of knowing how.
Thanks,
François