I have a simple dialog2 form with a Tab control. The tab control is "based on" the ship-to address type in that each tab represents a different address type.
The address type value associated with the currently selected tab is shown beside the title. As the user selects the different tabs, the corresponding tab value
is shown in the text box. In the example below, the user has selected the 3rd tab for "freeform input" and the tab number 3 is shown in the text box.
selectTabPane dialog2.jpg
When the user presses the "Save Selection" button, the calling dialog is updated with the ship-to address type value and the associated address information. This works correctly.
If the user then re-opens this dialog to make a different selection, I would like this dialog to open to the correct tab pane - i.e. the user selected
FreeForm last time and wants to change his/her mind so the form should open with the current selection of 3 / FreeForm showing.
However, this is where my problem lies. As you can see below, the correct ship-to type (3) is showing in the text box but the first tab is in view, not the 3rd (FreeForm).
selectTabPane dialog.jpg
I have the following code in the onRenderComplete client side event and have also tried it in the onInitializeComplete event.
At first thought, it would seem that the .selectTabPane is simply being ignored but I don't think so. I added 3 buttons to the dialog for testing, each one with a specific statement for selecting a tab pane and they all worked just fine.
It would seem perhaps that I just have the code to select the initial tab pane in the wrong event to get the dialog to initialize properly or there is something a little off in my JavaScript (which would not be a bit surprise).
Any suggestions would be very helpful. Likely something quite simple that I am overlooking.
Thanks for your help,
Peter
The address type value associated with the currently selected tab is shown beside the title. As the user selects the different tabs, the corresponding tab value
is shown in the text box. In the example below, the user has selected the 3rd tab for "freeform input" and the tab number 3 is shown in the text box.
selectTabPane dialog2.jpg
When the user presses the "Save Selection" button, the calling dialog is updated with the ship-to address type value and the associated address information. This works correctly.
If the user then re-opens this dialog to make a different selection, I would like this dialog to open to the correct tab pane - i.e. the user selected
FreeForm last time and wants to change his/her mind so the form should open with the current selection of 3 / FreeForm showing.
However, this is where my problem lies. As you can see below, the correct ship-to type (3) is showing in the text box but the first tab is in view, not the 3rd (FreeForm).
selectTabPane dialog.jpg
I have the following code in the onRenderComplete client side event and have also tried it in the onInitializeComplete event.
Code:
function setInitialTabPane() { //Get the current value in 'ShipToTypeID' var curShipToTypeID = {dialog.object}.getValue('ShipToTypeID'); //Set the current pane number if (curShipToTypeID == 0) { {dialog.object}.selectTabPane('TAB_1',4); } else { {dialog.object}.selectTabPane('TAB_1',curShipToTypeID); } }
Code:
{dialog.object}.selectTabPane('TAB_1',1); ... {dialog.object}.selectTabPane('TAB_1',2); ... {dialog.object}.selectTabPane('TAB_1',3);
Any suggestions would be very helpful. Likely something quite simple that I am overlooking.
Thanks for your help,
Peter
Comment