0 Replies Latest reply on Aug 25, 2011 8:33 AM by Badreddine BENBRAHIM

    Create and persist in inline editing

    Badreddine BENBRAHIM Newbie

      Hello Seamers, I have a table called QuestionReponse and another one called Non Confirmite .
      The Non Conformite table has a foreign key to the QuestionReponse table, and after generating entities I get an object of Questionreponse in  the NonConformite entity. The NonConformite entity contains just two attributs, the ID (generated automatically) and the Questionreponse Object

      There is the code I'm using now:

        <rich:dataTable value="#{questionreponseList.resultList}" var="_qr" rows="10">
            <h:outputText value="#{_qr.idquestionReponse}" />
            <rich:inplaceInput value="#{_qr.commentaire}" />
          <h:selectOneMenu value="#{_qr.reponse}" id="selectedReponse"
                               style=" width : 303px;">
                               <f:selectItem itemLabel="#{questionreponseHome.instance.reponse.reponse}"
                                    itemValue="" />
                               <s:selectItems value="#{reponseAction.initReponseToTrack()}"
                                    var="_reponse" label="#{_reponse.reponse}" />
                               <s:convertEntity />
                               <a:support event="onchange" action="#{reponseAction.test()}" />
                       <h:commandButton value="Create Non Conformite"/>
          <f:facet name="footer">
            <rich:datascroller maxPages="5" />
        <h:commandButton action="#{nonconformiteAction.initNonConformite()}" value="Save"/>

      I want that when I click on the Create Non Conformite an object of Nonconformite will be created containing the Questionreponse on the same row and put it in the database.

      Any idea how can I do that?

      I hope my post is clear, please help me.