<apex:pageBlockSectionitem >
<apex:outputLabel value="Parent Name" style="width:20px; height:20px"/>
<apex:outputPanel layout="inline" style="vertical-align:middle">
<apex:actionRegion>
<apex:inputText value="{!acct.parentid}" id="targetId" >
<apex:actionSupport event="onblur"event="onchange"
action="{!checkParent}"
rerender="pbs1" />
</apex:inputText>
</apex:actionRegion>
<apex:inputText size="20" id="targetName" onFocus="this.blur()" value="{!parentName}" />
<a href="#"
onclick="openLookupPopup('{!$Component.targetName}', '{!$Component.targetId}');
return false">
<apex:image style="vertical-align:middle;width:24px; height:24px"
value="{!$Resource.lookup}" />
</a>
</apex:outputPanel>
</apex:pageBlockSectionitem>
</apex:pageblockSection>
<apex:pageblockSection id="pbs1" title="Family Information" columns="2" collapsible="false">
<script>
var newWin=null;
function openLookupPopup(name, id)
{
var url="/apex/LookupPopup?namefield=" + name + "&idfield=" + id ;
newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
if (window.focus)
{
newWin.focus();
}
return false;
}
function closeLookupPopup()
{
if (null!=newWin)
{
newWin.close();
}
}
function fillIn(name, id)
{
var winMain=window.opener;
if (null==winMain)
{
winMain=window.parent.opener;
}
var
ele=
winMain.document.getElementById('{!$CurrentPage.parameters.namefield}');
ele.value=name;
ele=
winMain.document.getElementById('{!$CurrentPage.parameters.idfield}');
ele.value=id;
winMain.closeLookupPopup();
}
</script>
Ratan Paul
- 22.8k
- 14
- 55
- 99