Using makes my labels disappear

The question is quite simple, yet, I’m unable to answer it myself. Is there any solution to stop my label from a selectRadio/selectList/anything from disappearing everytime I use an action region? I need to use it due to having required fields whenever one of these radio values is changed but it is breaking my my design.

<apex:pageBlockSection id="Info" title="Some Information" columns="2">
   <apex:actionRegion >
       <apex:selectRadio id="taxType" label="Why does this disappear?" value="{!answer}">
           <apex:selectOptions value="{!itemsAnswer}"/>
           <apex:actionSupport event="onchange" rerender="Info" status="status"/>
       </apex:selectRadio>                       
   </apex:actionRegion>
   <apex:outputLabel >Is the Tax paid at the same time as the Cost?</apex:outputLabel>
</apex:pageBlockSection>

Answer

You need to use an <apex:pageBlockSectionItem> in order to preserve the formatting.

Try this:

 <apex:pageBlockSection id="Info" title="Some Information" columns="2">
      <apex:outputLabel for="taxType" value="Why does this disappear?" />
      <apex:pageblocksectionitem>
          <apex:actionRegion >
               <apex:selectRadio id="taxType" value="{!answer}">
                   <apex:selectOptions value="{!itemsAnswer}"/>
                   <apex:actionSupport event="onchange" rerender="Info" status="status"/>
               </apex:selectRadio>                       
          </apex:actionRegion>
      </apex:pageblocksectionitem>
      <apex:outputLabel >Is the Tax paid at the same time as the Cost? </apex:outputLabel>
  </apex:pageBlockSection>

Attribution
Source : Link , Question Author : Rui Rocha , Answer Author : Matt Lacey

Leave a Comment