function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
slaneslane 

Best VF layout components for horizontal search form?

I'm sure I can figure this out for myself eventually, but thought someone might have a quick tip.

 

I have a VF page that shows the results of a custom SOQL query, in pages. Right now I'm hard-coding the query but I want to provide the user a few search fields across the top of the list. A small form with five fields corresponding to the list columns, in a row, with Search and Clear buttons at the end.

 

My question is, how best to lay out this little form in VF? So far I have a pageBlockSection, with pairs of outputLabel and inputText thrown into it, but they seem to lay out sparsely/randomly.

 

Would some of the "panel" components be better?

 

Thanks for any advice.

Message Edited by slane on 10-02-2009 04:12 PM
HarmpieHarmpie

Pageblock -> Pageblocksection (set columns attribute) -> PageblockSectionItem -> Label/Field

 

That order of components should allow almost any layout. If necessary use multiple pageblocks. All sections items will be ordered left to right, across the number of columns you specified, which might seem randomly at first glance. You will have more control when you also start adding empty pageblockitems (<apex:pageBlockItem />), to have the fields 'skip' a column.

Message Edited by Harmpie on 10-04-2009 11:18 PM