You need to sign in to do that
Don't have an account?

hide panelGrid until commandbutton click
Hello,
I am trying to perform the following
M
I am trying to perform the following
- Hide commandbutton unless a picklist value has been selected
- Hide panelgrid until commandbutton has been clicked.
<apex:page standardStylesheets="true" showHeader="True" sidebar="true" Controller="AccountDealerController" > <apex:form > <apex:pageBlock title="Select an Account"> <apex:outputpanel id="Outputtext"> <apex:outputtext value="{!fieldValue}"/> </apex:outputpanel> <apex:selectList value="{!selectedFields}" size="1"> <apex:selectOptions value="{!AccountNames}" /> <apex:actionSupport event="onchange" reRender="values" action="{!passValueToController}"/> </apex:selectList><br/><br/> <apex:outputText value="{!fieldValue}" label="You have selected:" id="values" /> <!-- used to verify Id --> </apex:pageBlock> <apex:commandButton value="See Charts" reRender="chart"/><br/> <apex:outputPanel id="chart"> <apex:outputPanel rendered="{!fieldValue}"> <apex:panelGrid columns="3" id="theGrid"> <analytics:reportChart showRefreshButton="false" reportId="AAAAAA" filter="[{column:'ACCOUNT_ID',operator:'equals',value:'{!fieldValue}'}]" size="small"> </analytics:reportChart> <analytics:reportChart showRefreshButton="false" reportId="AAAAAA" filter="[{column:'ACCOUNT_ID',operator:'equals',value:'{!fieldValue}'}]" size="small"> </analytics:reportChart> <analytics:reportChart showRefreshButton="false" reportId="AAAAA" filter="[{column:'ACCOUNT_ID',operator:'equals',value:'{!fieldValue}'}]" size="small"> </analytics:reportChart> <analytics:reportChart showRefreshButton="false" reportId="AAAAAA" filter="[{column:'ACCOUNT_ID',operator:'equals',value:'{!fieldValue}'}]" size="small"> </analytics:reportChart> <analytics:reportChart showRefreshButton="false" reportId="AAAAAAA" filter="[{column:'ACCOUNT_ID',operator:'equals',value:'{!fieldValue}'}]" size="small"> </analytics:reportChart> <analytics:reportChart showRefreshButton="false" reportId="AAAAAA" filter="[{column:'ACCOUNT_ID',operator:'equals',value:'{!fieldValue}'}]" size="small"> </analytics:reportChart> </apex:panelGrid> </apex:outputPanel> </apex:outputPanel> </apex:form> </apex:page>Suggestions are greatly appreiated.
M
I am using your Controller.
To see where I am hiding buttons and graphs please go through the comments in code.
Controller :
page : Best Regards,
Amit.
All Answers
Declare two proprties in controller one for rendering parent tag of button and other for rendering parent tag of panelGrid. Set default false in constructor.
1) on changing picklist update property declared for button to true in action.
2) on click button update property declared for panelGrid to true.
use rendered attribute to render parent tag of commandButton and panelGrid.
I have created a mockup from your vf page.
vf page:
CommAccountDealerController : hope it helps.
Best Regards,
Amit.
Thank you for the fast reply. I have attached my current class to help clarify for reference.
What lines of code in your example actually hides the graphs and button? Trying to make sure I understand the logic used.
Thanks.
I am using your Controller.
To see where I am hiding buttons and graphs please go through the comments in code.
Controller :
page : Best Regards,
Amit.
The functionality works as describe if I leave the value as '3 Columns' it works but if I replace it with my graphs it does not render anything.
is it my analytic:reportchart syntax?
I do not think the id is getting returned after the picklist value is selected/
This use to populate after the picklist field was selected
Maybe this is why the graphs aren't showing?
Let me know if you have any other thoughts on how to approach this. I tried leveraging "oncomplete" thinking that woukld allow me to call 2 methods with an onchnage event but I am still unable toget both methods to fire. Any additional suggestions would be appreciated.
Regards,
Michael