• Lexie Xiao
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi! I am very new to visualforce page. I am trying to nest a very simple VF page with checkboxes within the event detail page. However, I cannot save my checkbox values. Every time I hit save, it refreshes the page and then the checked boxes become unchecked again. I do not know why that happens. Could anybody please tell me why and how I can fix it? Thank you very much!
<apex:page standardController="Event">
    
    <apex:detail subject="{!event}" relatedList="false"/>
    
    <apex:form id="theForm">
    
        <apex:pageBlock title="Event Check List" id="thePageBlock" mode="detail">
    
            <apex:pageblockButtons >
                <apex:commandButton action="{!save}" value="Save" id="save"/>
                <apex:commandButton action="{!cancel}" value="Cancel"/>
                <apex:message for="save"/>
            </apex:pageblockButtons>
            
            <apex:actionSupport event="onclick" reRender="theBlock" action="{!save}"/>
                
            <apex:pageBlockSection columns="2" >
                <apex:inputCheckbox id="repregis" label="Representatives registered" onselect="{!event}"/>
                <apex:inputCheckbox id="boothregis" label="Booth registered"/>
                <apex:inputCheckbox id="payment" label="Payment made"/>
                <apex:inputCheckbox id="hotel" label="Hotel booked, if applicabale"/>
                <apex:inputCheckbox id="litsent" label="Literature sent"/>
                <apex:inputCheckbox id="boothsent" label="Booth sent"/>
                <apex:inputCheckbox id="promosent" label="Promotional materials sent"/>
                <apex:inputCheckbox id="Misc" label="Miscellaneous stuffs sent"/>
                <apex:inputCheckbox id="furniture" label="Furniture ordered"/>
            </apex:pageBlockSection>
        
        </apex:pageBlock>
    
    </apex:form>
    
    <apex:relatedList list="Attachments"/>
    
</apex:page>
Hi! I am very new to visualforce page. I am trying to nest a very simple VF page with checkboxes within the event detail page. However, I cannot save my checkbox values. Every time I hit save, it refreshes the page and then the checked boxes become unchecked again. I do not know why that happens. Could anybody please tell me why and how I can fix it? Thank you very much!
<apex:page standardController="Event">
    
    <apex:detail subject="{!event}" relatedList="false"/>
    
    <apex:form id="theForm">
    
        <apex:pageBlock title="Event Check List" id="thePageBlock" mode="detail">
    
            <apex:pageblockButtons >
                <apex:commandButton action="{!save}" value="Save" id="save"/>
                <apex:commandButton action="{!cancel}" value="Cancel"/>
                <apex:message for="save"/>
            </apex:pageblockButtons>
            
            <apex:actionSupport event="onclick" reRender="theBlock" action="{!save}"/>
                
            <apex:pageBlockSection columns="2" >
                <apex:inputCheckbox id="repregis" label="Representatives registered" onselect="{!event}"/>
                <apex:inputCheckbox id="boothregis" label="Booth registered"/>
                <apex:inputCheckbox id="payment" label="Payment made"/>
                <apex:inputCheckbox id="hotel" label="Hotel booked, if applicabale"/>
                <apex:inputCheckbox id="litsent" label="Literature sent"/>
                <apex:inputCheckbox id="boothsent" label="Booth sent"/>
                <apex:inputCheckbox id="promosent" label="Promotional materials sent"/>
                <apex:inputCheckbox id="Misc" label="Miscellaneous stuffs sent"/>
                <apex:inputCheckbox id="furniture" label="Furniture ordered"/>
            </apex:pageBlockSection>
        
        </apex:pageBlock>
    
    </apex:form>
    
    <apex:relatedList list="Attachments"/>
    
</apex:page>