• dhana
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Hi,

 

  I am trying to built an lookup functionality using the visualforce. I am able to open a popup window as well as able to display the data on it. whenever I am closing the second page, it is not updating the value to the first page.

 

Here is same  code.value should be displayed in the textbox in the parent form .plz help me .

 

 

Parent Window:

<apex:page controller="popupwindow">
<apex:form >
<apex:inputtext value="{!textval}"/>
<apex:commandLink value="get" onclick="popup('/apex/childwindow')"/><br/>
<script>
function popup(url)
{
newwindow=window.open(url,'name','width=400,height=400,top=0,toolbar=no,personalbar=no,location=no,directories=no,statusbar=no,menubar=no,status=no,re sizable=yes,left=60,screenX=60,top=100,screenY=100');
if (window.focus){newwindow.focus()}
}
</script>

</apex:form>
</apex:page>

 

 

Child Window:

<apex:page controller="popupwindow" sidebar="false">
<apex:form >
<apex:dataTable value="{!accounts}" var="a" cellPadding="4" border="1">
<apex:column headervalue="Account Name">
<apex:commandLink onclick="close1()" action="{!filltextval}">
<apex:param name="name1" value="{!a.Name}"/>
{!a.Name}</apex:commandLink></apex:column>
</apex:dataTable>
<script>
function close1()
{
<!-- parent.window.opener.location.reload(); -->
parent.window.close();
}
</script>
</apex:form>
</apex:page>

 

Controller:

public class popupwindow
{
Public string textval{get;set;}

Public List<Account> getAccounts()
{
List<Account> acclist = [select name from account limit 10];
return acclist;
}

Public void filltextval()
{
textval = apexpages.currentpage().getparameters().get('name1');
}

 

  • March 24, 2009
  • Like
  • 0

Hi,

 

  I am trying to built an lookup functionality using the visualforce. I am able to open a popup window as well as able to display the data on it. whenever I am closing the second page, it is not updating the value to the first page.

 

Here is same  code.value should be displayed in the textbox in the parent form .plz help me .

 

 

Parent Window:

<apex:page controller="popupwindow">
<apex:form >
<apex:inputtext value="{!textval}"/>
<apex:commandLink value="get" onclick="popup('/apex/childwindow')"/><br/>
<script>
function popup(url)
{
newwindow=window.open(url,'name','width=400,height=400,top=0,toolbar=no,personalbar=no,location=no,directories=no,statusbar=no,menubar=no,status=no,re sizable=yes,left=60,screenX=60,top=100,screenY=100');
if (window.focus){newwindow.focus()}
}
</script>

</apex:form>
</apex:page>

 

 

Child Window:

<apex:page controller="popupwindow" sidebar="false">
<apex:form >
<apex:dataTable value="{!accounts}" var="a" cellPadding="4" border="1">
<apex:column headervalue="Account Name">
<apex:commandLink onclick="close1()" action="{!filltextval}">
<apex:param name="name1" value="{!a.Name}"/>
{!a.Name}</apex:commandLink></apex:column>
</apex:dataTable>
<script>
function close1()
{
<!-- parent.window.opener.location.reload(); -->
parent.window.close();
}
</script>
</apex:form>
</apex:page>

 

Controller:

public class popupwindow
{
Public string textval{get;set;}

Public List<Account> getAccounts()
{
List<Account> acclist = [select name from account limit 10];
return acclist;
}

Public void filltextval()
{
textval = apexpages.currentpage().getparameters().get('name1');
}

 

  • March 24, 2009
  • Like
  • 0