Skip to main content The Trailblazer Community will be unavailable from 2/1/2025 to 2/2/2025. Please plan your activities accordingly.
error

We made a wrong turn. Try again.

Hello Helpers

I have a visual force page  with 2  tabs

On tab  1 I  have some components  like  grids  and customr button

I would like  to   switch automatically  from Tab 1  to Tab 2  when I press the custom button BUT ONLY AFTER  the apex controller method  associated to  custom buton Action has  completed

I tried  to use  oncomplete  to achieve this.  My problem is  that the tab  is switched but  it looks  like the operation  in DoSonethingatApexside  is not performed

     <apex:pageBlockButtons >

     <apex:commandButton action="{!DoSonethingatApexside}" value="Preview"            

     oncomplete="RichFaces.switchTab('{!$Component.theTabPanel}','{!$Component.tabPreview}','Preview')">

     </apex:commandButton> 

     </apex:pageBlockButtons> 

If  I remove the oncomplete  and press the custom button and switch tomTab 2  manually  all Are OK

I see in tab 2  the results  of the custom button action

any suggestions?

Thanks in adsvance

csbaa

​
1 answer
  1. Jun 26, 2015, 6:24 AM
    to use "oncomplete" attaribute, you have to use reRender attaribute with commandButton.

     
0/9000