Visualforce Page for ActionRegion Demo


/ Published in: XML
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <apex:page controller="regioncontroller" sidebar="false" showHeader="false" standardStylesheets="true" >
  2. <style>
  3. .outergridvalidationcolumn {
  4. padding: 0px 30px 10px 0px;
  5. }
  6. </style>
  7.  
  8. <apex:sectionHeader title="Action Region Demos"/>
  9. <apex:outputPanel style="max-width:30%;" layout="block">
  10. <apex:pageBlock >
  11. <apex:form >
  12. <apex:pageMessages id="messagesForm1"/>
  13. <apex:pageBlockSection columns="2" title="WITHOUT Action Region">
  14. <apex:outputText value="Name" />
  15. <apex:inputText value="{!name}">
  16. <apex:actionSupport event="onkeyup" reRender="outname,messagesForm1" />
  17. </apex:inputText>
  18. <apex:outputText value="Job" />
  19. <apex:inputText required="true" id="job2" value="{!job}" />
  20. </apex:pageBlockSection>
  21. </apex:form>
  22.  
  23. <apex:form >
  24. <apex:pageMessages id="messagesForm2"/>
  25. <apex:pageBlockSection columns="2" title="WITH Action Region">
  26. <apex:outputText value="Name" />
  27. <apex:actionRegion >
  28. <apex:inputText value="{!name}">
  29. <apex:actionSupport event="onkeyup" reRender="outname,messagesForm2" />
  30. </apex:inputText>
  31. </apex:actionRegion>
  32. <apex:outputText value="Job" />
  33. <apex:inputText required="true" id="job1" value="{!job}" />
  34. </apex:pageBlockSection>
  35.  
  36. <apex:outputText id="outname" style="font-weight:bold" value="Typed Name: {!name}" />
  37.  
  38. </apex:form>
  39. </apex:pageBlock>
  40. </apex:outputPanel>
  41. </apex:page>

URL: http://www.tgerm.com/2010/09/visualforce-actionregion-deep-dive.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.