Skip to main content
Tweeted twitter.com/#!/StackSalesforce/status/308661219156443137
edited tags
Link
Jesse Altman
  • 19.8k
  • 10
  • 59
  • 103
Made the title more verbose. Fixed several grammatical and spelling errors.
Source Link
Jesse Altman
  • 19.8k
  • 10
  • 59
  • 103

rerender Rerender a page blockpageBlock if a value is entered in an inputField?

iI want to rerender a pageblockpageBlock by checking whether the inputfieldinputField is null. ifIf it is not null, then it should rerender the pageblock. I wrote the code, but the page block which needs to be rendered it is not getgetting displayed.

my code

<apex:page standardController="Event" extensions="CVFC_EventPage_ctrl_Dev" >
 <apex:form >  
  <apex:pageBlock >
     <apex:pageBlockSection >
         <apex:inputField value="{!Event.Ownerid}" />
         <apex:inputField value="{!Event.Subject}"/>             
         <apex:inputField value="{!Event.IsAllDayEvent}"/>
         <apex:inputField value="{!Event.StartDateTime}"/>
         <apex:inputField value="{!Event.EndDateTime}"/>
         <apex:inputField value="{!Event.WhatId}"/>
         <apex:inputField value="{!Event.WhoId}"/>
         <apex:inputField value="{!Event.IsPrivate}"/>
         <apex:inputField value="{!Event.Location}"/>                         
     </apex:pageBlockSection>         
     <apex:pageblockButtons >
         <apex:commandButton value="Save" action="{!saveAndNew}"/>
     </apex:pageblockButtons>         
  </apex:pageBlock>
  
  <apex:pageBlock rendered="{!Event.Ownerid != ''}">
     <apex:pageBlockSection id="Event_view"  title="Event View" >
         <apex:inputField value="{!Event.Subject}"/>
     </apex:pageBlockSection>
  </apex:pageBlock>
  

</apex:form> </apex:page>

when iWhen I remove rendered="{!Event.Ownerid != ''}"rendered="{!Event.Ownerid != ''}" from page blockthe pageBlock it getgets displayed else, otherwise it does not. Can anybody tell me what might be the issue.?

rerender a page block

i want to rerender a pageblock by checking whether the inputfield is null. if not null then it should rerender the pageblock. I wrote the code but the page block which needs to be rendered it is not get displayed.

my code

<apex:page standardController="Event" extensions="CVFC_EventPage_ctrl_Dev" >
 <apex:form >  
  <apex:pageBlock >
     <apex:pageBlockSection >
         <apex:inputField value="{!Event.Ownerid}" />
         <apex:inputField value="{!Event.Subject}"/>             
         <apex:inputField value="{!Event.IsAllDayEvent}"/>
         <apex:inputField value="{!Event.StartDateTime}"/>
         <apex:inputField value="{!Event.EndDateTime}"/>
         <apex:inputField value="{!Event.WhatId}"/>
         <apex:inputField value="{!Event.WhoId}"/>
         <apex:inputField value="{!Event.IsPrivate}"/>
         <apex:inputField value="{!Event.Location}"/>                         
     </apex:pageBlockSection>         
     <apex:pageblockButtons >
         <apex:commandButton value="Save" action="{!saveAndNew}"/>
     </apex:pageblockButtons>         
  </apex:pageBlock>
  
  <apex:pageBlock rendered="{!Event.Ownerid != ''}">
     <apex:pageBlockSection id="Event_view"  title="Event View" >
         <apex:inputField value="{!Event.Subject}"/>
     </apex:pageBlockSection>
  </apex:pageBlock>
  

</apex:form> </apex:page>

when i remove rendered="{!Event.Ownerid != ''}" from page block it get displayed else not. Can anybody tell me what might be the issue.

Rerender a pageBlock if a value is entered in an inputField?

I want to rerender a pageBlock by checking whether the inputField is null. If it is not null, then it should rerender the pageblock. I wrote the code, but the page block which needs to be rendered is not getting displayed.

my code

<apex:page standardController="Event" extensions="CVFC_EventPage_ctrl_Dev" >
 <apex:form >  
  <apex:pageBlock >
     <apex:pageBlockSection >
         <apex:inputField value="{!Event.Ownerid}" />
         <apex:inputField value="{!Event.Subject}"/>             
         <apex:inputField value="{!Event.IsAllDayEvent}"/>
         <apex:inputField value="{!Event.StartDateTime}"/>
         <apex:inputField value="{!Event.EndDateTime}"/>
         <apex:inputField value="{!Event.WhatId}"/>
         <apex:inputField value="{!Event.WhoId}"/>
         <apex:inputField value="{!Event.IsPrivate}"/>
         <apex:inputField value="{!Event.Location}"/>                         
     </apex:pageBlockSection>         
     <apex:pageblockButtons >
         <apex:commandButton value="Save" action="{!saveAndNew}"/>
     </apex:pageblockButtons>         
  </apex:pageBlock>
  
  <apex:pageBlock rendered="{!Event.Ownerid != ''}">
     <apex:pageBlockSection id="Event_view"  title="Event View" >
         <apex:inputField value="{!Event.Subject}"/>
     </apex:pageBlockSection>
  </apex:pageBlock>
  

</apex:form> </apex:page>

When I remove rendered="{!Event.Ownerid != ''}" from the pageBlock it gets displayed, otherwise it does not. Can anybody tell me what might be the issue?

Source Link
AnuRaj
  • 2.5k
  • 7
  • 53
  • 80

rerender a page block

i want to rerender a pageblock by checking whether the inputfield is null. if not null then it should rerender the pageblock. I wrote the code but the page block which needs to be rendered it is not get displayed.

my code

<apex:page standardController="Event" extensions="CVFC_EventPage_ctrl_Dev" >
 <apex:form >  
  <apex:pageBlock >
     <apex:pageBlockSection >
         <apex:inputField value="{!Event.Ownerid}" />
         <apex:inputField value="{!Event.Subject}"/>             
         <apex:inputField value="{!Event.IsAllDayEvent}"/>
         <apex:inputField value="{!Event.StartDateTime}"/>
         <apex:inputField value="{!Event.EndDateTime}"/>
         <apex:inputField value="{!Event.WhatId}"/>
         <apex:inputField value="{!Event.WhoId}"/>
         <apex:inputField value="{!Event.IsPrivate}"/>
         <apex:inputField value="{!Event.Location}"/>                         
     </apex:pageBlockSection>         
     <apex:pageblockButtons >
         <apex:commandButton value="Save" action="{!saveAndNew}"/>
     </apex:pageblockButtons>         
  </apex:pageBlock>
  
  <apex:pageBlock rendered="{!Event.Ownerid != ''}">
     <apex:pageBlockSection id="Event_view"  title="Event View" >
         <apex:inputField value="{!Event.Subject}"/>
     </apex:pageBlockSection>
  </apex:pageBlock>
  

</apex:form> </apex:page>

when i remove rendered="{!Event.Ownerid != ''}" from page block it get displayed else not. Can anybody tell me what might be the issue.