This content has been marked as final.
Show 5 replies
-
1. Re: s:convertEntity
admin.admin.email.tld Aug 6, 2008 8:29 PM (in response to mickgiu.mickgiu.gmail.com)<h:selectManyListbox size="10" value="#{member.roles}"> <s:selectItems var="r" value="#{availableRoles}" label="#{r.name}"/> <s:convertEntity/> </h:selectManyListbox>
<h:selectOneMenu value="#{person.continent}" required="true"> <s:selectItems value="#{continents.resultList}" var="continent" label="#{continent.name}" noSelectionLabel="Please Select..."/> <s:convertEntity /> </h:selectOneMenu>
-
2. Re: s:convertEntity
mickgiu.mickgiu.gmail.com Aug 6, 2008 10:25 PM (in response to mickgiu.mickgiu.gmail.com)Hi, thanks for the answer but i had done as you wrote me.
I have a page that contains this code<h:selectOneMenu value="#{hotelSearch.pippolo}"> <s:selectItems value="#{hotelSearch.capitalsList}" var="continent" label="#{continent.countryName}" noSelectionLabel="Please Select..."/> <s:convertEntity /> </h:selectOneMenu>
and an ejb like this
public class UtiSearchAction implements UtiSearch { @PersistenceContext private EntityManager em; private Countries pippolo; private List<Countries> capitalsList; @Create public void init() { capitalsList = em.createQuery("select c from Countries c ").getResultList(); pippolo = new Countries(); pippolo = capitalsList.get(1); } @DataModel private List<Locations> hotels; public List<Countries> getCapitalsList() { return capitalsList; } public void setCapitalsList(List<Countries> capitalsList) { this.capitalsList = capitalsList; } public Countries getPippolo() { return pippolo; } public void setPippolo(Countries pippolo) { System.out.println("ciao"); this.pippolo = pippolo; }
when i load data for dropdown all is ok: when dropdown put value (i think) i get this error
value is not validi don't understand where is the error.
thank
mickgiu -
3. Re: s:convertEntity
admin.admin.email.tld Aug 6, 2008 10:52 PM (in response to mickgiu.mickgiu.gmail.com)that indicates that the data value for the drop-down is invalid. find out what the data value is. also, are you using any validators or Hibernate validators?
-
4. Re: s:convertEntity
mickgiu.mickgiu.gmail.com Aug 7, 2008 8:57 PM (in response to mickgiu.mickgiu.gmail.com)Hi,
i found that problem is inpublic boolean equals(Object object)
of Entity object ( as i read in other forum).
Data value is ok, if i override that method (and return true) all is ok.
Bu this is not a solution.
Can you help me ?
Thanks
-
5. Re: s:convertEntity
twoencore Sep 17, 2009 4:50 PM (in response to mickgiu.mickgiu.gmail.com)I think your missing the id attribute.
<h:selectOneMenu value="#{hotelSearch.pippolo}"> <s:selectItems value="#{hotelSearch.capitalsList}" var="continent" label="#{continent.countryName}" id="pk" noSelectionLabel="Please Select..."/> <s:convertEntity /> </h:selectOneMenu>