0

I have a custom tabpanel with 8 tabs and i have a button in tab 3 which will trigger an action to update the info in tab 2.

<apex:tabPanel id="theTabPanel" switchType="client" selectedTab="tTab1" styleClass="theTabPanel">
<apex:tab label="Tab 1" id="tab1">
content
</apex:tab>

<apex:tab label="Tab 2" id="tab2">
content
</apex:tab>

<apex:tab label="Tab 3" id="tab3">
content
<apex:commandButton  value="Copy Info to Tab2" action="{!copyInfo}" reRender="tab2" />
</apex:tab>

but the reRender doesnt work. nothing happen when i click the button

  • Are you expecting the rerender to also somehow switch it to display that tab? – Adrian Larson Jan 5 '17 at 4:15
  • i dont need to switch to display the tab, just 'refresh' tab2 with updated information. – user2074703 Jan 5 '17 at 5:56
0

Apex Command button can invoke javascript on Oncomplete. so call a javascript method and switch tabs.

oncomplete is an attribute on command Button

oncomplete String The JavaScript invoked when the result of an AJAX update request completes on the client.

oncomplete="switchtabs();"

function switchtabs() { //logic goes here }

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.