ines
20 Mar 2007, 6:50 AM
Hello,
I have a problem with the tabs inside a Dialog.
I created a Basic Dialog in order to do a wizard. The first tab of the dialog is static.
When the user clicks on the next button, many tabs are created and the first is activate.
If he clicks on the cancel button, the dialog is hidden.
And then, he clicks to open the dialog: I remove all the generated tabs in order to keep the first static tab and i refresh its content.
Problem: in the tabPanel of the dialog, i see that the active tab is the tab where the user has clicked on the cancel button. But this tab doesn't exist in the TabPanel, and so when the dialog is open my first static page is not refresh event if i put myDialog.getTabs().getTab(0).activate().
Dialog creation:
loadHRDossierDialog : function loadHRDossierDialog(divTag){
var defaultUrl = 'hrdossierCreation.jsp';
if (!dialogHRDossier) {
dialogHRDossier = new YAHOO.ext.BasicDialog("HRDossierDialog", {
autoCreate: false,
width: 800,
height: 600,
resizable: true,
minHeight: 400,
minWidth: 300,
modal: true,
autoScroll: true,
closable: true,
constraintoviewport: true,
draggable: true,
autoTabs: true,
fixedcenter: false,
shadow: false,
minButtonWidth: 75,
});
// add buttons.
dialogHRDossier.addKeyListener(27, dialogHRDossier.hide, dialogHRDossier);
dialogHRDossier.addButton('OK', dialogHRDossier.hide, dialogHRDossier);
dialogHRDossier.addButton('Next', dialogHRDossier.hide, dialogHRDossier);
dialogHRDossier.addButton('Previous', dialogHRDossier.hide, dialogHRDossier);
dialogHRDossier.addButton('Cancel', dialogHRDossier.hide, dialogHRDossier);
var updater = dialogHRDossier.getTabs().getActiveTab().getUpdateManager();
updater.setDefaultUrl(defaultUrl);
updater.loadScripts = true;
}
// initial state of the buttons
dialogHRDossier.buttons[0].setVisible(false);
dialogHRDossier.buttons[1].disable();
dialogHRDossier.buttons[2].setVisible(false);
//if the properties groups already exists, remove them.
for (var i=dialogHRDossier.getTabs().getCount()-1; i > 0; i--) {
dialogHRDossier.getTabs().removeTab(i);
}
//force the interface to load the dialog on the first tab
dialogHRDossier.getTabs().getTab(0).activate();
var updater = dialogHRDossier.getTabs().getTab(0).getUpdateManager();
updater.refresh();
dialogHRDossier.show(divTag);
},
Thanks for yours answers.
ines.[/code]
I have a problem with the tabs inside a Dialog.
I created a Basic Dialog in order to do a wizard. The first tab of the dialog is static.
When the user clicks on the next button, many tabs are created and the first is activate.
If he clicks on the cancel button, the dialog is hidden.
And then, he clicks to open the dialog: I remove all the generated tabs in order to keep the first static tab and i refresh its content.
Problem: in the tabPanel of the dialog, i see that the active tab is the tab where the user has clicked on the cancel button. But this tab doesn't exist in the TabPanel, and so when the dialog is open my first static page is not refresh event if i put myDialog.getTabs().getTab(0).activate().
Dialog creation:
loadHRDossierDialog : function loadHRDossierDialog(divTag){
var defaultUrl = 'hrdossierCreation.jsp';
if (!dialogHRDossier) {
dialogHRDossier = new YAHOO.ext.BasicDialog("HRDossierDialog", {
autoCreate: false,
width: 800,
height: 600,
resizable: true,
minHeight: 400,
minWidth: 300,
modal: true,
autoScroll: true,
closable: true,
constraintoviewport: true,
draggable: true,
autoTabs: true,
fixedcenter: false,
shadow: false,
minButtonWidth: 75,
});
// add buttons.
dialogHRDossier.addKeyListener(27, dialogHRDossier.hide, dialogHRDossier);
dialogHRDossier.addButton('OK', dialogHRDossier.hide, dialogHRDossier);
dialogHRDossier.addButton('Next', dialogHRDossier.hide, dialogHRDossier);
dialogHRDossier.addButton('Previous', dialogHRDossier.hide, dialogHRDossier);
dialogHRDossier.addButton('Cancel', dialogHRDossier.hide, dialogHRDossier);
var updater = dialogHRDossier.getTabs().getActiveTab().getUpdateManager();
updater.setDefaultUrl(defaultUrl);
updater.loadScripts = true;
}
// initial state of the buttons
dialogHRDossier.buttons[0].setVisible(false);
dialogHRDossier.buttons[1].disable();
dialogHRDossier.buttons[2].setVisible(false);
//if the properties groups already exists, remove them.
for (var i=dialogHRDossier.getTabs().getCount()-1; i > 0; i--) {
dialogHRDossier.getTabs().removeTab(i);
}
//force the interface to load the dialog on the first tab
dialogHRDossier.getTabs().getTab(0).activate();
var updater = dialogHRDossier.getTabs().getTab(0).getUpdateManager();
updater.refresh();
dialogHRDossier.show(divTag);
},
Thanks for yours answers.
ines.[/code]