You need to sign in to do that
Don't have an account?
Vandana Rattan 4
Apex:tab enable/disable on button click with Javascript
Hi All,
I am using RichFaces.switchTab('j_id0:frm:tabPanel','j_id0:frm:tabId','tabname'); to navigate between tabs. I want to disbale all tabs and enable them only when Continue or previous button is clicked. However if I set the property disabled="true" for a tab and navigate to it using RichFaces.switchTab('j_id0:frm:tabPanel','j_id0:frm:tabId','tabname'); navigation does happen but the tab is blank and still disabled. I tried setting the classes using:
document.getElementById("j_id0:frm:tab_cell").className = "rich-tabhdr-cell-active";
document.getElementById('j_id0:frm:tab_lbl').className ="rich-tab-header rich-tab-active activeTab ";
this does take effect but still the tab is disabled and blank.
Kindly suggest.
Regards,
Vandana
I am using RichFaces.switchTab('j_id0:frm:tabPanel','j_id0:frm:tabId','tabname'); to navigate between tabs. I want to disbale all tabs and enable them only when Continue or previous button is clicked. However if I set the property disabled="true" for a tab and navigate to it using RichFaces.switchTab('j_id0:frm:tabPanel','j_id0:frm:tabId','tabname'); navigation does happen but the tab is blank and still disabled. I tried setting the classes using:
document.getElementById("j_id0:frm:tab_cell").className = "rich-tabhdr-cell-active";
document.getElementById('j_id0:frm:tab_lbl').className ="rich-tab-header rich-tab-active activeTab ";
this does take effect but still the tab is disabled and blank.
Kindly suggest.
Regards,
Vandana
NOTE: When adding code please use the "Add a code sample" button (icon <>) to increase readability and make it easier to reference.
Code is huge. So I am just attaching snippets. VF Page:
Javascript:
Thanks for your time.
I did that coz all my formatting was getting lost if I rerendred the tabPanel to navigate between tabs. Look at a query I raised earlier:
https://developer.salesforce.com/forums/ForumsMain?id=906F00000005I2jIAE
Thanks,
Vandana
On click of Next button I called functions to enable tabs:
function enableXXX(){
RichFaces.switchTab('j_id0:frm:tabPanel','j_id0:frm:quals','quals1');
}
On load all the tabs were disabled as:
if(document.getElementById("j_id0:frm:XXX") != null)
{
document.getElementById("j_id0:frm:XXX").onclick="return false;";
}