Hi Greg,
For updating the selected records value in a label during callback, when clicking on a ''Nextpage''/''PreviousPage'' button we should follow the below steps.
a) Grid Grouping Control''s before Callback event:
---------------------------------------------
The GridGrouping Control''s before callback script event should be used to trigger the multiplexer''s callback event instead of gri''s callback. i.e In the grid''s before callback
what we does is we will cancel''s the Grid''s callback, and instead invoke the multiplexer''s doCallback method.
Here in this ''Client side'' event we will check the argument at client side which triggers the callback.
then based on our requirements we will have to decide on triggering the Callback multiplexer, also we will mention the control
that has to be refreshed in the grid''s event. please look in to the attached sample for more information
[Sample code]
Here is a sample code on how the script of before callback script will look like for a next page button click.
//We check the argument here, like if the argument contains the string ''NEXTPAGE'' , which is used to figure out that callback is triggered by clicking on a next page button, we also ensure
/this by checking the button''s index (''5 '') here then we cancel the grid''s callback (this.continueCallback = false;) .
//We trigger callback multiplexer''s callback and also the grid by specifying grid as the argumentfor multiplexer.
this.InboxGrid.BeforeCallbackScript = "if( arg.indexOf(''NEXTPAGE:BB:'')!=-1 && (arg.indexOf(''5'') != -1)){this.continueCallback = false;__sfCallbackMultiplexer1.doCallback(''InboxGrid'', arg);}";
//similarly you have to check in the client side for each action.
b)Using Multiplexer:
------------------
Once the above is done the callback will trigger the corresponding event and you can refresh your label which is inside a callbackpanel by refreshing the
callback panel.
[sample code]
this.CallbackMultiplexer1.ControlsToRefresh.Add(this.CallbackPanel1);
We faced some issues here and this made some delay. because in our situation we were in need of defining the
callbackMultiplexer''s refresh in both ''SelectedRecordsChanged'' event and ''ButtonBarClickEvent'' for previous and
next buttons.
To overcome this scenario we decided to keep each CallbackMuliplexer for each events and to refresh the callback panel seperately inside
the buttonbar click event. Eg (We will have ''3'' CallbackMultiplexer when we are in need of selection changed, next button and previous button
to be handled) . In the sample I have also illustrated for move last and move fist record.
Click the below link to download the sample.
Sample for updating the selection and paging in callback
Regards,
A.Sivakumar