Skip to main content
Hello everyone...

I'm trying to align in to the same row, two input fields contained in the same block, is this possible or am I wasting my time trying to achieve this point.

I've been tried using style= (margin, padding, position, etc...)... any idea???

Vertical Alignment - two fields same row

My Code

<apex:pageBlockSection columns="1" id="Fabric_Tape" >

<apex:pageBlockSectionItem id="STD_Width" rendered="{!IF(Customer_s_Price_List__c.Wide_Imperial__c<>TEXT(ProductMaxWidth),true,false)}">

<apex:outputLabel value="Length (Yards)" style="position:absolute; margin-top: -9pt; margin-left: -60pt; " />

<apex:selectList size="1" value="{!Customer_s_Price_List__c.Long_Imperial__c}" style="margin-top: -9pt; margin-left: 0pt; margin-right: -10pt;" rendered="{!IF(Customer_s_Price_List__c.Wide_Imperial__c<>TEXT(ProductMaxWidth),true,false)}">

<apex:selectOptions value="{!length_FT_Imp}" />

</apex:selectList>

</apex:pageBlockSectionItem>

 
8 respuestas
  1. 5 oct 2015, 14:05

    I didn't find any other way to resolve this issue more that rerender the Visualforce page with an Apex Controller, even when all the time I was trying to avoid accomplish this, using more deep code, so solution below, and it';s pretty easy, because is using selectOption method:

    VF Page:

    <apex:selectList value="{!Customer_s_Price_List__c.Length_Units__c}" size="1" style="margin-top: -8pt;" >

    <apex:selectOptions value="{!length_Units}"/>

    </apex:selectList>

    Apex Controller:

    public List<SelectOption> getlength_Units(){

    List<SelectOption> options = new List<SelectOption>();

    options.add(new SelectOption('Yards','Yards'));

    options.add(new SelectOption('Feet','Feet'));

    return options;

    }

    Now it's working smooth...

    Thanks for your help...

     
0/9000