4 Replies Latest reply on Aug 5, 2011 5:31 PM by kriss_96

    rich:inplaceInput + rich:dataTable

    tgebarowski

      Hello everyone,

      I am trying to use a rich:dataTable component in order to create a simple table with the possibility of editing its entries using rich:inplaceInput.

      I managed to load the values from my backing bean ( which takes all the entries from a database). My problem occurs when I want to handle the submit action properly, because the inplaceInput stores the old value, not the one that was entered by the user.

      here is my code:



       <rich:inplaceInput value="#{item.title}" layout="block" binding="#{ArticleBean.inplaceInputTitle}" id="inplace" required="true" showControls="true" requiredMessage="#{msg.errorMessage_emptyField}"
       selectOnEdit="true" editEvent="onclick" >
      
       <a4j:support event="onblur" timeout="100" action="#{ArticleBean.updateAction}" reRender="contentList, messages" ajaxSingle="true">
       <a4j:actionparam name="pk" value="#{item.pk}" assignTo="#{ArticleBean.id}" />
      
       </a4j:support>
      
       </rich:inplaceInput>
      
      


      I am trying to invoke an updateAction from my ArticleBean which takes ID and value of inplaceInput and stores it in DB. I used binding for getting this value ( ArticleBean.inplaceInputTitle ) but it stores the old value:( I guess that I am trying to invoke this action before the model is update. How can invoke it later?

      Do you have any ideas what can be wrong? I spent quite a lot of time on that. It's my first day with RichFaces, maybe I've chosen a wrong approach?

      Kind regards,

      Tomasz Gebarowski

        • 1. Re: rich:inplaceInput + rich:dataTable
          razvanp

          Hi,

          I am beginner with RichFaces and I try to implement the same simple use case of tabled data edit.

          There is a sample in the demo, Rich Input / Inplace Input, where we can see a editable cell table.

          It seems that after a change, the table does not call the apropriate "Set" method of the bean. I have tried to change the code, adding a button to submit the form, than the change is committed to the bean.

          Further, if the user changes more than one value, you may see the the previous changed value assuming its original value. In my opinion this is a bug in RichFaces, since it happens even on the online version.

          I have tied, without success, to enclose the inplaceInput in a form, which I tried to submit (through an a4j:support event="onChange"), but it is not working, and even worse, it doesn't report any error or clue to debug the issue.

          Razvan

          • 2. Re: rich:inplaceInput + rich:dataTable
            ilya_shaikovsky

            you should use support with event="onviewactivation" in order to submit value right after it was changed in inplace.

            • 3. Re: rich:inplaceInput + rich:dataTable
              ilya_shaikovsky

              b.t.w. thanks for your remark about demo. It works with this error because bypassUpdates set to false in a4j:support. Will be resolved.

              • 4. Re: rich:inplaceInput + rich:dataTable
                kriss_96

                I have the same problems... I can't save my input values.

                 

                I have a list of bean showed in a table.

                 

                When I edit a cell, the inplaceInput doesn't calls my beans setters. I suppossed that is because the beans are in a list and it doesn't know wich bean update.

                 

                So, I try with onViewActivation event, but I don't really know how to send to my Bean wich row and wich column have been changed...