This content has been marked as final.
Show 6 replies
-
1. Re: value of selectItems not posted in the form?
pmuir Jun 21, 2007 5:50 AM (in response to idylle)Post your backing beans
-
2. Re: value of selectItems not posted in the form?
idylle Jun 21, 2007 6:08 AM (in response to idylle)Here are my beans :
The entity bean (just the attributes) :@Entity @Table(name = "collectivites", schema = "public") public class Collectivites implements java.io.Serializable { private int colidt; private Typcol typcol; private Departements departements; private String colnom; private String coltel; private String colfax; private String coladr; private String colcp; private String colnmc; private String coltlc; private Integer colpop; private String colaff; private String colvil; public Collectivites() { } + getter and setter ...
The query bean :@Name("collectivitesList") public class CollectivitesList extends EntityQuery { private static final String[] RESTRICTIONS = { "lower(collectivites.colnom) like concat('%',lower(#{collectivitesList.collectivites.colnom}),'%')", "lower(collectivites.coltel) like concat(lower(#{collectivitesList.collectivites.coltel}),'%')", "lower(collectivites.colfax) like concat(lower(#{collectivitesList.collectivites.colfax}),'%')", "lower(collectivites.coladr) like concat(lower(#{collectivitesList.collectivites.coladr}),'%')", "lower(collectivites.colcp) like concat(lower(#{collectivitesList.collectivites.colcp}),'%')", "lower(collectivites.colnmc) like concat(lower(#{collectivitesList.collectivites.colnmc}),'%')", "lower(collectivites.coltlc) like concat(lower(#{collectivitesList.collectivites.coltlc}),'%')", "lower(collectivites.colvil) like concat('%',lower(#{collectivitesList.collectivites.colvil}),'%')", "collectivites.colaff like concat(#{collectivitesList.collectivites.colaff},'%')", "collectivites.typcol like concat(#{collectivitesList.collectivites.typcol},'%')",}; private Collectivites collectivites = new Collectivites(); @Override public String getEjbql() { return "select collectivites from Collectivites collectivites"; } @Override public Integer getMaxResults() { return 25; } public Collectivites getCollectivites() { return collectivites; } @Override public List<String> getRestrictions() { return Arrays.asList(RESTRICTIONS); } }
-
3. Re: value of selectItems not posted in the form?
pmuir Jun 21, 2007 6:18 AM (in response to idylle)And you get no messages displayed in your h:message/h:messages?
-
4. Re: value of selectItems not posted in the form?
idylle Jun 21, 2007 6:25 AM (in response to idylle)no, the page is just redisplayed with the whole list of results, ignoring the "tpcidt" and the select box is back to "Select..." instead of having my choice selected.
If I put this :<h:commandButton id="search" value="Chercher" /> in my command button, it works but : 1- I need the firstresult=0 param 2- It won't work after if I try to use the next page link to navigate through results pages
-
5. Re: value of selectItems not posted in the form?
pmuir Jun 21, 2007 6:38 AM (in response to idylle)Surely you want to call an action on the backing bean. Normally you have action="#{backingBean.foo}". You certainly can't append query string parameters to an action like that.
-
6. Re: value of selectItems not posted in the form?
idylle Jun 21, 2007 7:04 AM (in response to idylle)But I don't understand why the other elements in the form are Ok and just this one is a problem.