3 Replies Latest reply on Dec 6, 2011 10:20 AM by jlpktnst

    DataTable command link selecting the row

    jlpktnst Newbie
           <a4j:commandLink id="Edit" value="Edit" actionListener="#{bean.editActionHandler}" render="table@body" execute="table" >
                <f:setPropertyActionListener target="#{bean.currentRow}" value="#{row}"></f:setPropertyActionListener>


      So, I have this command link and I want it to assign current row to a variable in the bean. It does that just right, with one problem. I need that to access row value inside editActionHandler() method, but it gets assigned after invocation. Any ideas how I should handle that? I am doing DataTable inline editing so I need that row with changes.


      Worstcase scenario I could just do the ordinary html post, but I'd prefer to have it ajaxified since its all inline.


      I was thinking of using iterationStatusVar and <a4j:param value="#{it.index}" assignTo="#{bean.index}"/>, but that does not guarantee I have the data in the moment of event.


      Maybe I could put the code that persists data in another event that gets raised later after rowdata is posted?