You need to sign in to do that
Don't have an account?
Custom Fields with SF styling
I have a scenario where I need custom fields within my custom visualforce page that cannot be generated using <apex:inputField>. Here's a look at the code (devoid of spaces, for some reason):
<apex:pageBlockSectiontitle="Event Date and Time"id="dateSection">
<inputtype="text"id="startDate"style="width:120px"/>
<apex:selectListvalue="{!startHour}"multiselect="false"size="1"id="startHour">
<apex:selectOptionitemValue="01"itemLabel="1"/>
<apex:selectOptionitemValue="02"itemLabel="2"/>
<apex:selectOptionitemValue="03"itemLabel="3"/>
<apex:selectOptionitemValue="04"itemLabel="4"/>
<apex:selectOptionitemValue="05"itemLabel="5"/>
<apex:selectOptionitemValue="06"itemLabel="6"/>
<apex:selectOptionitemValue="07"itemLabel="7"/>
<apex:selectOptionitemValue="08"itemLabel="8"/>
<apex:selectOptionitemValue="09"itemLabel="9"/>
<apex:selectOptionitemValue="10"itemLabel="10"/>
<apex:selectOptionitemValue="11"itemLabel="11"/>
<apex:selectOptionitemValue="12"itemLabel="12"/>
</apex:selectList>:
<apex:selectListvalue="{!startMinute}"size="1"id="startMinute">
<apex:selectOptionitemValue="00"/>
<apex:selectOptionitemValue="15"/>
<apex:selectOptionitemValue="30"/>
<apex:selectOptionitemValue="45"/>
</apex:selectList>
<apex:selectListvalue="{!startAmPm}"size="1"id="startAmPm">
<apex:selectOptionitemValue="AM"/>
<apex:selectOptionitemValue="PM"/>
</apex:selectList>
<apex:inputHiddenvalue="{!startTimeStamp}"id="startTimeStamp"/>
</apex:pageBlockSection>
You get the idea. It's a date. It has a Date text field, and an Hour, Minue, and AM/PM selectList field.
I want to make it look like standard salesforce, within a pageBlockSection. However, this makes the whole page blow up. I tried to make the pageBlockSection tag empty and manually create the fields within a table that I made myself using the SF class names on the cells, but then the whole following section disappears in FF and IE. I can't put them into a pageBlockSectionItem, because it complains that pageBlockSectionItem can only have 2 child elements.
Does this make any sense? Anybody have any clues?
Try this :
<apex:pageBlockSectiontitle="Event Date and Time"id="dateSection">
<apex:outputpanel>
<inputtype="text"id="startDate"style="width:120px"/>
<apex:selectListvalue="{!startHour}"multiselect="false"size="1"id="startHour">
<apex:selectOptionitemValue="01"itemLabel="1"/>
<apex:selectOptionitemValue="02"itemLabel="2"/>
<apex:selectOptionitemValue="03"itemLabel="3"/>
<apex:selectOptionitemValue="04"itemLabel="4"/>
<apex:selectOptionitemValue="05"itemLabel="5"/>
<apex:selectOptionitemValue="06"itemLabel="6"/>
<apex:selectOptionitemValue="07"itemLabel="7"/>
<apex:selectOptionitemValue="08"itemLabel="8"/>
<apex:selectOptionitemValue="09"itemLabel="9"/>
<apex:selectOptionitemValue="10"itemLabel="10"/>
<apex:selectOptionitemValue="11"itemLabel="11"/>
<apex:selectOptionitemValue="12"itemLabel="12"/>
</apex:selectList>:
<apex:selectListvalue="{!startMinute}"size="1"id="startMinute">
<apex:selectOptionitemValue="00"/>
<apex:selectOptionitemValue="15"/>
<apex:selectOptionitemValue="30"/>
<apex:selectOptionitemValue="45"/>
</apex:selectList>
<apex:selectListvalue="{!startAmPm}"size="1"id="startAmPm">
<apex:selectOptionitemValue="AM"/>
<apex:selectOptionitemValue="PM"/>
</apex:selectList>
<apex:inputHiddenvalue="{!startTimeStamp}"id="startTimeStamp"/>
</apex:outputpanel>
</apex:pageBlockSection>
If this work for you, mark this as solved.
Thanks
Rakesh Aggarwal
www.rakeshaggarwal.com | twitter