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