0

VF page displays the records using page block table. I'm updating the records from VF page by clicking on "Save" Button.

I've used standard Jquery pagination to implement the pagination.

When I am doing change the multiple records from multiple pagination pages and click on save button then changes from current pagination page is only sending to the controller.

Current Pagination page means pagination page from which we are clicking on save button.

What could be the workaround to send the changes from all pagination pages? Can you please help on this.

<apex:page controller="wrapperclass2"  >
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"/>
<apex:includescript value=" //cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js" />
<apex:stylesheet value="//cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" />

<script>
$(document).ready(function() {
    $('table.dataTable').dataTable({}); 
 });
 </script>

<apex:pageBlock >
<apex:form >
    <apex:commandbutton value="save" action="{!save1}"/>
    <apex:pageBlockTable value="{!lstAccWrapper}" id="accountId" var="a1" styleClass="dataTable">
        <apex:column styleClass="" headerValue="ID">
            <apex:outputText value="{!a1.Id}" />
        </apex:column>
        <apex:column styleClass="" headerValue="Name">
        <apex:outputLink value="/{!a1.id}" target="_blank">
            <apex:outputtext value="{!a1.Name}" />
            </apex:outputLink>
        </apex:column>

        <apex:column styleClass="memo" headerValue=" Gold">
            <apex:inputCheckbox value="{!a1.slaG}" styleClass="first" id="gggold"/>
        </apex:column>
         <apex:column styleClass="memo" headerValue="Silver">
            <apex:inputCheckbox value="{!a1.slaS}" styleClass="gold"/>
        </apex:column>
         <apex:column styleClass="memo" headerValue="Platinum">
            <apex:inputCheckbox value="{!a1.slaP}" styleClass="gold"/>
        </apex:column>
         <apex:column styleClass="memo" headerValue="Bonze">
            <apex:inputCheckbox value="{!a1.slaB}"  styleClass="gold second" />
        </apex:column>
    </apex:pageBlockTable>
     </apex:form>
</apex:pageBlock>

Controller :

public class wrapperclass2 {

   public List<Wrapper> lstAccWrapper{get;set;}   
   public PageReference save1() {
   //system.debug('Wrapper List'+lstAccWrapper);
   for(Wrapper lst:  lstAccWrapper)
   {
      system.debug('Wrapper List'+lst);
   }
    return null;
  }
}
0

You have to do a submit everytime you change a page, meaning call your save function on page change.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.