4 Replies Latest reply on Jun 27, 2007 9:22 AM by Adrien Loyat

    sending a class threw page parameters

    Adrien Loyat Newbie

      Hello, I have a pobleme with page parameters.

      I have generated a very simple CRUD application with seam-gen from a database containing 2 tables : col and typecol (which means the sort of col).
      The link between the two tables is : col.type = typecol.id
      typecol.id is an Integer

      The generation is ok. The col class contain a property Typecol typecol. A colList.xhtml was generated too.

      Now, I want to search for col of a certain type. So I've had a selectBox in colList.xtml :

      <s:decorate template="layout/display.xhtml">
       <ui:define name="label">Type de collectivité</ui:define>
       <h:selectOneMenu id="typecol" value="#{colList.col.typecol}" >
       <s:selectItems value="#{typecolList.resultList}" var="untypcol"
       label="#{untypcol.nom}" noSelectionLabel="Select..."
       <s:convertEntity />

      In ColList.page.xml, I've added the param :
      <param name="typecol" value="#{colList.col.typecol}" converter="EntityConverter" />

      In RESTRICTION property of ColList.java, I've added this :
      "col.typecol = #{colList.col.typecol}",

      When I tried the new selectBox, nothing happend.
      I put a conversation scope to colList class, then the search was ok. Was-it good to add conversation scope ?

      Nevertheless, all is not perfect, as I cannot use links (to order the list, or to navigate between the pages of results) because my param typecol is then not written in the url( http://localhost.../ColList.seam?firstResult=25&nom=&cid=4).

      Am I wrong from the beginning ? Am I wrong with the param in page.xml ?
      Thank you for having a look a fiew second at my issue.