incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benj Fayle" <bfa...@maketechnologies.com>
Subject RE: table delete row and immediate="true"
Date Thu, 13 Jul 2006 23:46:26 GMT
I have done this many times using partial page rendering techniques.
There are two ways you can do it. I'm assuming you are deleting the row
in the table model.

Method 1:

Add partialSubmit="true" to your command button. Then add the following
line of code to your deleteAction method:

AdfFacesContext.getCurrentInstance().addPartialTarget(getValuesTable());

This assumes getValuesTable() returns the same component that you bound
your table to using binding="#{testTable.valuesTable}"


Method 2:
 
Change your command button to look like this:

          <af:commandButton id="deleteButton"
                            immediate="true"
                            partialSubmit="true"
                            text=" Delete"
                            actionListener="#{testTable.deleteAction}"/>

Change the table to look like:

<af:table value="#{testTable.valuesTableModel}" 
          var="test"
          binding="#{testTable.valuesTable}" 
          partialTriggers="deleteButton">

You will also need to change the method signature of the deleteAction
to:

  public void deleteAction(ActionEvent action)  {



-----Original Message-----
From: David Brunette [mailto:David.Brunette@chordiant.com] 
Sent: Wednesday, July 12, 2006 11:02 AM
To: adffaces-user@incubator.apache.org
Subject: af:table delete row and immediate="true"

 

     Hi everybody.  I am having a problem with deleting a row from an
<af:table /> when I have my command button specify immediate="true".

                                    

<af:table value="#{testTable.valuesTableModel}" var="test"
binding="#{testTable.valuesTable}">

                                                

            <f:facet name="selection">

                        <af:tableSelectMany text="Select and">

                                    <af:commandButton text="Delete"
action="#{testTable.deleteAction}" immediate="true">

                                    </af:commandButton>

                        </af:tableSelectMany>

            </f:facet>

                                                

            <af:column>

                        <f:facet name="header">

                                    <af:outputText value="Value" />

                        </f:facet>

                        <af:inputText value="#{test}" />

            </af:column>

                                                            

</af:table>

 

     While looking for what I was doing wrong, I came across an old post
on the Oracle forums:

 

http://forums.oracle.com/forums/thread.jspa?messageID=859139&#859139

 

     It seems as though this is exactly the problem that I'm having.
The last post was from a while ago so I was wondering if the enhancement
request that was mention has been fulfilled, or if this is still a
problem.  And if it is still a problem, can anybody elaborate on the
comment in the post of "implementing the "rowKey" part of that API to be
something stable across inserts and deletes" (sorry if it is obvious...
I'm still getting myself familiar with the CollectionModel stuff)?

 

     Thanks...

 

Dave


Mime
View raw message