Tab and dialog box

Hi, I am grateful for this community since it has helped me with my project so far, but now im hopelessly stuck

Im creating a web-app with one main page and the rest of the pages are shown in the form of content of dialog boxes( Ex: button2.onclick=window.showModalDialog("faces/EditPersonDetails.jsp","","dialog Width:900px;dialogHeight:585px;dialogLeft:200px; dialogTop:200px;");

now the dialog Boxes has 1 tabset with one layer of "tabs", and depending on button clicked from Main.jsp , different tabs need to be shown up on loading the same dialog box.

what i have tried so far are:

1. binding selected property of the tabset to a sessionbean string ("tab")which is set in the main (calling) page

public String button2_action(){

getSessionBean1().setTab("tab2");

returnnull;

}

when the button is clicked, and set again to the bean value in the dialogbox's pre-render of EditPersonDetails

publicvoid prerender(){

tabSet1.setSelected(null);

tabSet1.setSelected(getSessionBean1().getTab());

}

2. using no bean but making the tab public static setting in Main.jsp

public String button2_action(){

EditPersonDetails.tab2.setSelectedChildId("tab2");

}

3. I even tried putting Thread.sleep since i suspect its a timing/race issue in EditPersonDetails

publicvoid prerender(){

try{

Thread.sleep(1000);

catch(Exception e){}

tabSet1.setSelected(null);

tabSet1.setSelected(getSessionBean1().getTab());

try{

Thread.sleep(1000);

catch(Exception e){}

}

I have a feeling theres a simple way that im not aware of that will fix the problem.

I appreciate any comments/help from you experts

Thanks and regards,

Nick

[2685 byte] By [Carrierguya] at [2007-11-27 4:19:41]
# 1

Take a look at your JSP code and see if it is setting the selected attribute, such as:

selected="tab1"

If it is, remove that and build and run your program.

Always, before building, check the JSP and remove the selected setting. When you are in the visual designer and click on a tab, the IDE puts that attribute setting back into the JSP.

For more information see: http://blogs.sun.com/divas/entry/tabbing_thru_the_tulips

jetsonsa at 2007-7-12 9:26:37 > top of Java-index,Development Tools,Java Tools...