5

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>
2
  • Hello once again. Just came by to say I couldn't find a solution ever since I made this topic, so I just wanted to know to those that see this post if this is actually possible to workaround.
    – Rui Rocha
    Nov 15, 2013 at 11:27
  • Hi Rui, I know this is from last year but if these answers work could you mark one as accepted?
    – Matt Lacey
    Oct 4, 2014 at 1:06

2 Answers 2

3

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>
0

The solution in this forum discussion worked for me. You need to wrap the input field in a pageBlockSectionItem, so the order of things would be: pageBlockSectionItem, then add the label, then the output region, then the input field:

<apex:pageBlockSectionItem>
    <apex:outputLabel.../>
    <apex:actionRegion...>
        <apex:inputField...>
            <apex:actionSupport />
        </apex:inputField>
    </apex:actionRegion>
</apex:pageBlockSectionItem>
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .