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
Ranu JainRanu Jain 

Mode edit in page block

would any one explain me  the effect of    " mode = 'edit ' " attribute in <apex:pageBlock  mode="edit"></apex:pageBlock>

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

From the developer's guide:

 

--- snip ---

 

The default user mode for the pageBlock component's child elements. This value determines whether lines are drawn separating field values. Possible values are: "detail", in which data is displayed to the user with colored lines; "maindetail", in which data is displayed to the user with colored lines and a white background, just like the main detail page for records; and "edit", in which data is displayed to the user without field lines. If not specified, this value defaults to "detail". These lines have nothing to do with requiredness, they are merely visual separators, that make it easier to scan a detail page. 

 

--- snip ---

 

So basically it makes it look like the regular page edit does - displays withouth separating lines.

All Answers

bob_buzzardbob_buzzard

From the developer's guide:

 

--- snip ---

 

The default user mode for the pageBlock component's child elements. This value determines whether lines are drawn separating field values. Possible values are: "detail", in which data is displayed to the user with colored lines; "maindetail", in which data is displayed to the user with colored lines and a white background, just like the main detail page for records; and "edit", in which data is displayed to the user without field lines. If not specified, this value defaults to "detail". These lines have nothing to do with requiredness, they are merely visual separators, that make it easier to scan a detail page. 

 

--- snip ---

 

So basically it makes it look like the regular page edit does - displays withouth separating lines.

This was selected as the best answer
BewitchedBewitched

Hi,

 

Mode Attribute explained:-

 

The default user mode for the pageBlock component's child elements. This value determines whether lines are drawn separating field values. Possible values are: "detail", in which data is displayed to the user with colored lines; "maindetail", in which data is displayed to the user with colored lines and a white background, just like the main detail page for records; and "edit", in which data is displayed to the user without field lines. If not specified, this value defaults to "detail". These lines have nothing to do with requiredness, they are merely visual separators, that make it easier to scan a detail page.

 

In simple words it's the way in which your page should appear.. Detail/MainDetail/Edit etc...

 

Thanks,

Tulika

Matt Cooper 7Matt Cooper 7
Hi,

I know this was posted awhile ago, but I was wondering if it is possible to have the white background of maindetail, but remove the field separating line like in edit. If so, how is this accomplished?

Thanks