function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TeddyAbleTeddyAble 

Rerender in Visualforce - Is it possible to declare rerender twice in a visualforce page?

Hello guys 

 

When i run the Code below for example it comes up with this error : 

ErrorError: newEvent line 58, column 31: The element type "apex:outputpanel" must be terminated by the matching end-tag "</apex:outputpanel>" 
ErrorError: The element type "apex:outputpanel" must be terminated by the matching end-tag "</apex:outputpanel>".

 

<apex:page standardController="Event">
<apex:form >
        <apex:pageBlock title="New Event" id="thePageBlock" mode="new">
            <apex:pageMessages />
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton action="{!cancel}" value="Cancel" onclick="return confirmCancel()" immediate="true"/>               
            </apex:pageBlockButtons>
            <apex:actionRegion >
                <apex:pageBlockSection title="Basic Information" columns="1">
                    
                     
                     
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="What is your Event About" />
                        <apex:outputPanel >
                            <apex:inputField value="{!event.Point__c}" required="true">
                                <apex:actionSupport event="onchange" rerender="thePageBlock" status="status"/>
                            </apex:inputField>
                            <apex:actionStatus startText="Please Wait!..." id="status"/>
                                                     
                        </apex:outputPanel> 
                        </apex:pageBlockSectionItem>
                        
                        </apex:pageBlockSection>
                        
            </apex:actionRegion>
            
            
             <apex:pageBlockSection title="(For Zero Balance Process ONLY) " columns="2"
                                   rendered="{!event.Point__c == '3'}">
                                   <apex:inputField value="{!event.Ownerid}" required="true"/>
                                    <apex:inputField value="{!event.IsPrivate}" required="true"/>
                                    <apex:inputField value="{!event.whatid}" required="true"/>
                                    <apex:inputField value="{!event.whoid}" required="true"/>
                                     <apex:inputCheckbox value="{!event.IsRecurrence}" required="true"/>
                                     <apex:inputField value="{!event.RecurrenceTimeZoneSidKey}"/>
             </apex:pageBlockSection>
             
             
             
            <apex:actionRegion >
                <apex:pageBlockSection title="Recurrence Information" columns="1">
                    
                     
                
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="Create Recurring Series of Events" />
                        <apex:outputPanel>
                            <apex:inputcheckbox value="{!event.isRecurrence}"/>
                                <apex:actionSupport event="onchange" rerender="thePageBlock" status="status"/>
                            </apex:inputField>
                            <apex:actionStatus startText="Please Wait!..." id="status"/>
                                                     
                        </apex:outputPanel> 
                        </apex:pageBlockSectionItem>
                        
                        <apex:inputCheckbox value="{!event.IsRecurrence}"/>
                        </apex:pageBlockSection>
                        
            </apex:actionRegion>
             
             
             
             
             </apex:pageBlock>
       
     
    </apex:form>
</apex:page>
 

 IS it because im Declaring the reRender function twice?

I need to declare the reRender for !Event.isRecurrence.

 

How do i acomplish this?

 

Thanks guys

Best Answer chosen by Admin (Salesforce Developers) 
TeddyAbleTeddyAble

Thanks guys the error was because the Apex:inputCheckbox was already closed (as well) 

 

 

apex:inputcheckbox value="{!event.isRecurrence}"/>
                                <apex:actionSupport event="onchange" rerender="thePageBlock" status="status"/>
                            </apex:inputField>

 

The updated line of code

 

<apex:inputcheckbox value="{!event.isRecurrence}">
                                <apex:actionSupport event="onchange" rerender="thePageBlock2" status="status"/>
                           </apex:inputcheckbox>

 

All Answers

kerwintangkerwintang

I think it's because of this line in the 2nd outputPanel:

 

</apex:inputField>

 

It doesn't have a matching <apex:inputField> start tag.

 

Remove it and should be ok. Hope this helps.

AravindBabu512AravindBabu512

Hi,

 

Its because inputcheckbox tag has been closed in the same line and you have provided an explicit close tag but as input field, please make the below changes, your code should work.

 

<apex:inputcheckbox value="{!event.isRecurrence}"/>
           <apex:actionSupport event="onchange" rerender="thePageBlock" status="status"/>
</apex:inputFieldcheckbox>

 

Thanks,

Aravind

TeddyAbleTeddyAble

Thanks guys the error was because the Apex:inputCheckbox was already closed (as well) 

 

 

apex:inputcheckbox value="{!event.isRecurrence}"/>
                                <apex:actionSupport event="onchange" rerender="thePageBlock" status="status"/>
                            </apex:inputField>

 

The updated line of code

 

<apex:inputcheckbox value="{!event.isRecurrence}">
                                <apex:actionSupport event="onchange" rerender="thePageBlock2" status="status"/>
                           </apex:inputcheckbox>

 

This was selected as the best answer