Switch cursor focus from parent page to child layout panel(as a popup)

View: New views
1 Messages — Rating Filter:   Alert me  

Switch cursor focus from parent page to child layout panel(as a popup)

by Tayana :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hie.

I'm using netbeans to develop a web based application.

I'm using layout panel  as popups for entering data into the system. What i want to happen is when i invoke the popup the cursor changes its focus component to the first top component on the popup or a component on the popup that i specify. I have tried the following code but its not seem to be working.

I'm invoking the popup from a button but i also validate before invoking it.

In the backing bean i have the following code:
 /*----------Render scripts-----------------*/
    //Set focus on the popup layout panel
    boolean renderScript2 = false;

    public boolean isRenderScript2() {
        return renderScript2;
    }

    public void setRenderScript2(boolean renderScript2) {
        this.renderScript2 = renderScript2;
    }
then in the button action method i set boolean to true so that the script can be executed:
    setRenderScript2(true);

In the JSP i have the following script:
 <webuijsf:script id="script2" rendered="#{sec$SecUserRole.renderScript2}">
          function autotab(){
                   var tabTo = document.getElementById('form1:statusDropDown');
                   tabTo.focus();
          }
</webuijsf:script>

here:SecUserRole is the page name
       statusDropDown is the first component in the popup
LightInTheBox - Buy quality products at wholesale price