Hi,
I need to open a popup from a commandLink in my
JSF page. On click of commandLink i need to pass a parameter to the URL of PopUp. Parameter is available in the parent JSF page through param.WorkItemId where WorkItemId is getting passed to the parent page using URL appending like
http://localhost:8080/MyProj/page.xhtml?WorkItemId=xxx
I need to append this WorkItem Id while opening popup also so that its available there also.
I tried in the following manner.
I am new to javascript so not sure if i m doing it write.
<script type="text/javascript" language = "JavaScript">
function open_win(page)
{
var popUp = document.getElementById('initPopUp').value;
var PopUpWindow= page+"?WorkItemId="+popUp;
mywindow = window.open(PopUpWindow,null,"height=400,width=400,status=yes,toolbar=no,menubar=no,location=no, scrollbars=1");
mywindow.moveTo(300,100);
}
</script>
<h:inputHidden id = "initPopUp" value = "${param.WorkItemId}">
</h:inputHidden>
<h:commandLink value=" Prepopulate KYC Parties"
rendered="#{userSessionInfo.userTasks[param.WorkItemId].partyObjType}"
onclick="open_win('prePopKYC.jsf')">
</h:commandLink>
While doing this when i click on hyperlink i get a JS error: Object required.
Can anybody please help me out with this or let me know a workaround?