You need to sign in to do that
Don't have an account?
DeepV
popup visualforce shows no data
When I click the edit button, the popup displays but does not display any data. Please help!
What is the mistake I'm doing it here.
what I have tried so far:
Visual Force:
<apex:page standardcontroller="UCF_REL__c" extensions="UCFController" sidebar="false" >
<apex:sectionheader title="UCF Review" />
<apex:messages />
<apex:form rendered="{!displaySection}">
<script type="text/javascript"> function LegalNameChangePopup(){ var newwindow = window.open('RELLegalNameChangePopup', 'name=_blank','height=500,width=500,left=250,top=100'); newwindow.focus(); }
</script>
<apex:pageblock title="General Information" >
<apex:pageblocksection title="Legal Name">
<apex:panelgrid columns="2">
<!-- <apex:outputlabel value="Account Name: " for="accountName" />-->
<apex:outputfield id="accountName" value="{!aaccount.name}"/>
<apex:commandbutton value="Edit" id="accpopup" onclick="LegalNameChangePopup();" styleclass="btn"/>
</apex:panelgrid>
</apex:pageblocksection>
</apex:pageblock>
<apex:pageblock >
<apex:pageblocksection columns="4">
<apex:commandbutton action="{!step2}" value="Save and Continue" styleclass="btn" />
<apex:commandbutton action="{!reset}" value="Reset Page" styleclass="btn" immediate="true"/>
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
</apex:page>
VF for popup: RELLegalNameChangePopup
<apex:page standardcontroller="UCF_REL__c" extensions="UCFController" showheader="false" sidebar="false" id="the">
<apex:form id="page">
<apex:pageBlock >
<apex:pageBlockSection columns="1" title="Legal Name change">
<apex:pageblocktable value="{!aAccount}" var="item" id="editAccountName">
<apex:column headervalue="Proposed Legal Name">
<apex:inputtext value="{!item.Name}" />
</apex:column> </apex:pageblocktable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
What is the mistake I'm doing it here.
what I have tried so far:
Visual Force:
<apex:page standardcontroller="UCF_REL__c" extensions="UCFController" sidebar="false" >
<apex:sectionheader title="UCF Review" />
<apex:messages />
<apex:form rendered="{!displaySection}">
<script type="text/javascript"> function LegalNameChangePopup(){ var newwindow = window.open('RELLegalNameChangePopup', 'name=_blank','height=500,width=500,left=250,top=100'); newwindow.focus(); }
</script>
<apex:pageblock title="General Information" >
<apex:pageblocksection title="Legal Name">
<apex:panelgrid columns="2">
<!-- <apex:outputlabel value="Account Name: " for="accountName" />-->
<apex:outputfield id="accountName" value="{!aaccount.name}"/>
<apex:commandbutton value="Edit" id="accpopup" onclick="LegalNameChangePopup();" styleclass="btn"/>
</apex:panelgrid>
</apex:pageblocksection>
</apex:pageblock>
<apex:pageblock >
<apex:pageblocksection columns="4">
<apex:commandbutton action="{!step2}" value="Save and Continue" styleclass="btn" />
<apex:commandbutton action="{!reset}" value="Reset Page" styleclass="btn" immediate="true"/>
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
</apex:page>
VF for popup: RELLegalNameChangePopup
<apex:page standardcontroller="UCF_REL__c" extensions="UCFController" showheader="false" sidebar="false" id="the">
<apex:form id="page">
<apex:pageBlock >
<apex:pageBlockSection columns="1" title="Legal Name change">
<apex:pageblocktable value="{!aAccount}" var="item" id="editAccountName">
<apex:column headervalue="Proposed Legal Name">
<apex:inputtext value="{!item.Name}" />
</apex:column> </apex:pageblocktable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
Please refer the code below which will open a popup with a parameter from the parent page.
Controller (acctControllPopup)-
Its a very basic one but it will probably get your job Done.
I hope it helps.
All Answers
Could you please share the Controller code as well ?
Modify your script as follows:
<script type="text/javascript">
function LegalNameChangePopup(){
var newwindow = window.open('/apex/RELLegalNameChangePopup', 'name=_blank','height=500,width=500,left=250,top=100');
newwindow.focus();
}
</script>
Let me know if it helps.
Thanks
this is what i have in the controller:
public Account aAccount { get; set; }
public String aAccountID { get; set; }
//inside the constructor
ID aAccountID = [Select AccountID from Contact where id = :contactid].AccountId;
aAccount = [select id, name from account where id = :aAccountID];
I suggest you share your entire controller class. It will be a whole lot easier to provide you with a solution that way.
I tried with the Account and It worked with the following results. Please refer the screenshots
Following is the code :-
MainPage
Controller
Popup Page
Please let me know if you are trying to pass any data from main page to popup page ?
When the user clicks on Edit Button, then the popup should show up a text field to edit the account name.
I am unalbe to show account data on the page.
Few points.
Write a new custom controller for your VF Page. It is always good to have modularised code. It's easily manageable.
Once you do that, you can pass account id as a parameter in the url of pop up page at the click of edit button.
Now in the controller of your pop get that parameter using Apexpages.currentpage().getParameters('Your Parameter name')
once you have the account id you can query that record and populate it in your inputtext field.
Please refer the code below which will open a popup with a parameter from the parent page.
Controller (acctControllPopup)-
Its a very basic one but it will probably get your job Done.
I hope it helps.
Your profile has read access on the visualforce page right?