1

In the below page, I want to have a line break after Project Phase field. And then Hours and Date field should be in the same row
only puts a blank space like shown. Multiple
not working too. How can I achieve that?

enter image description here

Below is my VF Page

<apex:page standardController="Project_Timesheet__c" recordSetVar="TS"  extensions="i3_ProjectTimesheet_Controller" sidebar="false">
<apex:form >
<apex:pageBlock title="Project Timesheet">
<div align="center">
<apex:outputPanel >
<apex:commandButton value="Save" action="{!Save}"/>
<apex:commandButton value="Save & New" action="{!Submit}"/>
<apex:commandButton value="Cancel" action="{!Cancel}"/>
</apex:outputPanel> 
</div>
<br></br>
<apex:pageBlocksection title="Enter Timesheet Details">  
<apex:selectList size="1" multiselect="false" label="Contract" value="{!SelectedContract}">
      <apex:selectOptions value="{!Contracts_for_Account}"></apex:selectOptions>
  </apex:selectList>

<apex:selectList size="1" multiselect="false" label="Account" disabled="true">
      <apex:selectOptions value="{!Account_for_Project}"></apex:selectOptions>
  </apex:selectList>

<apex:selectList size="1" multiselect="false" label="Project" disabled="true">
      <apex:selectOptions value="{!Project_for_ProjPhase}"></apex:selectOptions>
  </apex:selectList> 

<apex:selectList size="1" multiselect="false" label="Project Phase" value="{!SelectedPhase}">
      <apex:selectOptions value="{!TS_from_ProjPhase}"></apex:selectOptions>
  </apex:selectList> 

<apex:inputField value="{!PTimesheet.Hours__c}" label="Hours"/>
<apex:inputField value="{!PTimesheet.Date__c}" label="Date"/>

</apex:pageBlocksection>
<apex:pageBlocksection title="Comments" columns="1">

<apex:inputField value="{!PTimesheet.Comments__c}" label="Public Comments" style="width:450px;height:80px"/>
<apex:inputField value="{!PTimesheet.Private_Comments__c}" label="Private Comments" style="width:450px;height:80px"/>
</apex:pageBlocksection>


<div align="center">
<apex:outputPanel >
<apex:commandButton value="Save" action="{!Save}"/>
<apex:commandButton value="Save & New" action="{!Submit}"/>

<apex:commandButton value="Cancel"/>
</apex:outputPanel> 
</div>
</apex:pageBlock>
</apex:form>
</apex:page>
1

You can inject empty cells into an <apex:pageBlockSection> by using the <apex:pageBlockSectionItem> tag. If you want a blank row, make sure you have one item for each column in the section (two by default). For example, this markup would render two fields, followed by an empty row, followed by two more fields:

<apex:pageBlockSection>
    <apex:inputField value="{!record.Field1__c}" />
    <apex:inputField value="{!record.Field2__c}" />

    <apex:pageBlockSectionItem />
    <apex:pageBlockSectionItem />

    <apex:inputField value="{!record.Field3__c}" />
    <apex:inputField value="{!record.Field4__c}" />
</apex:pageBlockSection>

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.