Skip to content

Instantly share code, notes, and snippets.

@keirbowden
Created September 27, 2014 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keirbowden/0150a1e37b181323a0bb to your computer and use it in GitHub Desktop.
Save keirbowden/0150a1e37b181323a0bb to your computer and use it in GitHub Desktop.
Action Region, Required Field and HTML5 Page
<apex:page controller="RequiredCtrl" tabstyle="Account" doctype="html-5.0">
<apex:pageMessages id="msgs"/>
<apex:form>
<apex:pageBlock mode="maindetail">
<apex:pageBlockButtons location="top">
<apex:commandButton value="Save" action="{!save}" />
</apex:pageBlockButtons>
<apex:pageBlockSection title="Account Information">
<apex:pageBlockSectionItem>
<apex:outputlabel value="Name"/>
<apex:inputfield value="{!Acc.Name}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:outputPanel id="rows">
<apex:actionRegion>
<apex:pageBlockSection title="Related Information" columns="1">
<apex:pageBlockSectionItem>
<apex:commandButton value="Add Row" action="{!addRow}" rerender="rows,msgs"/>
</apex:pageBlockSectionItem>
<apex:pageBlockTable value="{!rows}" var="row">
<apex:column headerValue="Value 1">
<apex:inputText value="{!row.val1}" />
</apex:column>
<apex:column headerValue="Value 2">
<apex:inputText value="{!row.val1}" />
</apex:column>
<apex:column headerValue="Value 3">
<apex:inputText value="{!row.val3}" />
</apex:column>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:actionRegion>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
</apex:page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment