1

I am trying to use field set to get list of fields to show in the VF page so the customer can adjust the fields without having to touch the code. But It seems to me that when using field set, I am getting blank lines after each input. I don't get the same issue with stand inputField. Here is my code:

<apex:form >
    <apex:pageBlock title="Mandatory Fields">
        <apex:pageBlockSection title="Input" columns="1">
            <apex:repeat value="{!$ObjectType.Order_Line__c.FieldSets.New_Mandatory}" var="f"> 
                <apex:inputField value="{!Order_Line__c[f]}" label="{!f.Label}"/><br/>
            </apex:repeat>           
        </apex:pageBlockSection>
        <apex:pageBlockSection title="Input without field set" columns="1">
            <apex:inputField value="{!Order_Line__c.Actual_Amount__c}"/>
            <apex:inputField value="{!Order_Line__c.Audio_End_Hour__c}"/>
        </apex:pageBlockSection>
    </apex:pageBlock>      
</apex:form>

And the result I am getting is like this: enter image description here

Note that I am setting columns="1" for debugging purpose only. But I am getting the same issue with any other columns settings. However, the issue is not that obvious.

  • 2
    I found a similar question that suggests either moving the repeat out of the pageBlockSection or wrapping it with an output panel. Haven't tried it but thought I'd share in case it helps... developer.salesforce.com/forums/… – Jenny B Nov 21 '14 at 1:21
  • 1
    Thank you, Jenny. I tried outputPanel. It doesn't directly resolve my issue. But combined with a outputLabel and some css I think I am getting there. – Lance Shi Nov 21 '14 at 1:39
1

You are using line break <br/> tag in your code , that is causing the issue Try removing it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.