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

Rerender Page Based on Checkbox or InputField
I'm having trouble rerendering a section on a Visualforce page.
I want to rerender the "Output Panel" with the id 'changeEm'. I've got a lookup to a Contact ct.Buyer__c and a checkbox that if changed to show/hide id='changeEm'
Let me know if there is a better Apex solution. Also, is there a way to how this occured in an AJAX fashion on page?
I want to rerender the "Output Panel" with the id 'changeEm'. I've got a lookup to a Contact ct.Buyer__c and a checkbox that if changed to show/hide id='changeEm'
Let me know if there is a better Apex solution. Also, is there a way to how this occured in an AJAX fashion on page?
<apex:form > <apex:pageBlock > Find Existing Contact <apex:inputField value="{!ct.Buyer__c}" ><apex:actionSupport event='onchange' reRender='changeEm'/></apex:inputField><br/><br/> Create New Buyer? <apex:inputCheckbox value ='{!turn}'><apex:actionSupport event='onchange' reRender='changeEm'/></apex:inputCheckbox> </apex:pageBlock> <apex:outputPanel id='changeEm'> <apex:pageBlock> First Name: <apex:inputText title="First Name" /><br/> Last Name: <apex:inputText title="Last Name" /><br/> Email Address: <apex:inputText title="Email Address"/> </apex:pageBlock> </apex:outputPanel> <apex:dataTable id="cart" value="{!cart}" var="carti" rowClasses="odd,even"> <apex:column headerValue="ID" rendered="false"> <apex:outputText value="{!cart[carti].merchandise.Id}" > </apex:outputText> </apex:column> <apex:column headerValue="Product"> <apex:outputText value="{!cart[carti].merchandise.name}"> </apex:outputText> </apex:column> <apex:column headervalue="Price"> <apex:outputText value="{!cart[carti].merchandise.price__c}" /> </apex:column> <apex:column headerValue="#Items"> <apex:outputText value="{!cart[carti].count}"/> </apex:column> </apex:dataTable> <apex:commandButton action="{!back}" value="Back"/> </apex:form>
Try something like this. Get the checkbox value in your controller.
public Boolean isChecked {get;set;}
And assign isChecked to true or false based on the checkbox.
In VF page,
<apex:outputPanel rendered='{!ischecked == true}'>
Thanks,
Vetri
Agreeing with to Vetriselvan's comment, I would like to add something.
change your vf like this,
Apex:
Visualforce
Change this rendered='{!flip}' to rendered='{!flip == true}' and let me know whether it works. Also check the debug logs whether the value for flip is assigned or not.
Thanks,
Vetri
I've added this and it still doesn't seem to be firing. I've put debug's all over my code and it doesn't seem to be firing ont he checkbox change.
Visualforce
Confirm Page
Find Existing ContactCreate New Buyer? First Name:
Last Name:
Email Address:
Apex
Thank you!