You need to sign in to do that
Don't have an account?
Ron9
Page parameters don't work when using rendered
Hey
Can anyone help me understand why using page parameters don't work when using rendered?
I've tried this, which only works if I remove the rendered property from the outputPanel:
<apex:page standardController="Parent__c" > <apex:pageBlock title="Children for {!Parent__c.name}"> <apex:form > <apex:pageBlockTable value="{!Parent__c.Children__r}" var="child"> <apex:column headerValue="Name" > <apex:commandLink rerender="detail"> {!child.Name} <apex:param name="cid" value="{!child.id}"/> </apex:commandLink> </apex:column> </apex:pageBlockTable> </apex:form> </apex:pageBlock> <apex:outputPanel id="detail" rendered="{!$CurrentPage.parameters.cid!=''}"> <apex:detail subject="{!$CurrentPage.parameters.cid}" relatedList="true" title="false" relatedListHover="true"/> ...some other stuff... </apex:outputPanel> </apex:page>
I hope anyone can help me get a bit wiser, thanks
- Ronni
You are doing rerender and render in the same panel.
Try this in separate panel
<apex:page standardController="Parent__c" >
<apex:pageBlock title="Children for {!Parent__c.name}">
<apex:form >
<apex:pageBlockTable value="{!Parent__c.Children__r}" var="child">
<apex:column headerValue="Name" >
<apex:commandLink rerender="detail">
{!child.Name}
<apex:param name="cid" value="{!child.id}"/>
</apex:commandLink>
</apex:column>
</apex:pageBlockTable>
</apex:form>
</apex:pageBlock>
<apex:outputPanel id="detail">
<apex:outputPanel rendered="{!$CurrentPage.parameters.cid!=''}">
<apex:detail subject="{!$CurrentPage.parameters.cid}" relatedList="true" title="false" relatedListHover="true"/>
...some other stuff...
</apex:outputPanel>
</apex:outputPanel>
</apex:page>
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks
All Answers
You are doing rerender and render in the same panel.
Try this in separate panel
<apex:page standardController="Parent__c" >
<apex:pageBlock title="Children for {!Parent__c.name}">
<apex:form >
<apex:pageBlockTable value="{!Parent__c.Children__r}" var="child">
<apex:column headerValue="Name" >
<apex:commandLink rerender="detail">
{!child.Name}
<apex:param name="cid" value="{!child.id}"/>
</apex:commandLink>
</apex:column>
</apex:pageBlockTable>
</apex:form>
</apex:pageBlock>
<apex:outputPanel id="detail">
<apex:outputPanel rendered="{!$CurrentPage.parameters.cid!=''}">
<apex:detail subject="{!$CurrentPage.parameters.cid}" relatedList="true" title="false" relatedListHover="true"/>
...some other stuff...
</apex:outputPanel>
</apex:outputPanel>
</apex:page>
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks
Thank you @souvik9086, It worked. Guess problem wassen't as general as I thought.