1 Reply Latest reply on Oct 8, 2007 1:04 PM by Michael Griffith

    Create New Entity -> Page Round Trip & Update autoincrement

    Michael Griffith Newbie

      Hello all,

      I am new to seam & JSF in general, I have searched the forum for this problem and could not find anything related. I am using an application that was generated by seamgen.

      I have an entity, called status. If I create a new status, the proper table is updated, but upon the round trip from the server, the page does not contain the autoincremented ID from the status table. Subsequently, when I try to add related information or update it without going back to the list to select it, I get an error, because the ID = 0, which of course is incorrect.

      I'm sure there must be a common way to handle this type of situation.

      I have the status id mapped as follows in my xhtml fragment:

       <s:decorate id="idDecoration" template="layout/edit.xhtml">
       <ui:define name="label">id</ui:define>
       <h:inputText id="id"
       required="true"
       disabled="#{statusHome.managed}"
       value="#{statusHome.instance.id}">
       <a:support event="onblur" reRender="idDecoration" bypassUpdates="true"/>
       </h:inputText>
       </s:decorate>
      


      Can anyone give me a push in the right direction? Ideally, I want the id field to appear as a hidden field so the user does not see it.

      I am using seam 2.0.0CR1.

      Thanks in advance,

      MG