• atinto
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
There are two VF Pages
X is parent vf page and Y is pop up vf page
there is a commandlink on Y page
and two <apex:param> component on pop vf page
There is one Command Link on X parent page on click of which Y pop up page will open.
 
Source Code:
 
X Page [parent page]:
 
<apex:page standardController="POS__c" extensions="PointOfSale" tabStyle="POS__c">
<script type="text/javascript">
function openclient()
{
     var clt = window.open("{!$Page.clientlookup}?ctxt=client&ctid=clientid","lookup","width=750,height=390");     
}
</script>
<apex:form id="frmpos">
<apex:pageBlock title="New Ticket" id="pos">
<apex:inputText value="{!clientId}" id="client"/>
<apex:commandLink onclick="openclient();return false();">
</apex:commandLink>
<apex:inputText id="clientid"/>
Y Page [pop up Page]:
 
<apex:page controller="ClientLookUp" showHeader="false" tabStyle="Client__c" sidebar="false" wizard="true">
               <script type="text/javascript">
                window.opener.document.getElementById('clientId').value = '{!$CurrentPageReference.parameters.cid}';
                alert('{!$CurrentPageReference.parameters.cid}');
                return false;               
               </script>
<apex:form id="list">
<apex:pageblock title="Select Client">   
<apex:pageBlockSection title="Client List" id="result">   
<apex:outputPanel id="rlist" title="Result">
            <apex:pageBlockTable value="{!searchresult}" var="clt" columns="5"  id="list" width="100%">        
                <apex:column value="{!clt.Name}"/>
                <apex:column >         
                    <apex:facet name="header"><b>Client</b></apex:facet>         
                    <apex:commandLink id="classtype" onclick="setvalue();">               
                    <apex:param name="cid" value="{!clt.Id}"/>
                    <apex:param name="ccode" value="{!clt.Client__c}"/>
                    {!clt.Client__c}        
                    </apex:commandLink>   
                </apex:column>   
            </apex:pageBlockTable>  
          </apex:outputPanel>
        </apex:pageBlockSection> 
    </apex:pageblock>
</apex:form>
</apex:page>
 
 
ERRORS:
1. Onclick of commandLink on Y Page it gives error "window.opener.document is null or not an object".
2. {!$CurrentPageReference.parameters.cid} is blank.
 
for first error i tried "window.opener.document.form.client.value", "window.opener.form.client.value" but error remains same.
 
any help/suggesions are greatly appreciated.......
 
Thanks