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
cignuscignus 

contact name and address components

Hi 

I want to create a VF page for contact.( I need to remove some fields and add some extended functionality)

When I add <apex:inputField value="{!contact.name}"> what I get is a label and no input field, but in the standard contact layout you can move the name field and it creates a combo box (salutation) and firstname and last name.

 

The same happens for the address.

How can  use the name and address component in my own VF page?

 

Cheers

 

Best Answer chosen by Admin (Salesforce Developers) 
Starz26Starz26

Again, visualforce taxes

 

 

You will have to create a small table in that column.

 

Here is the code from the standard edit page:

 

<tr>

<td class="labelCol">
<td class="dataCol col02">
<select id="name_salutationcon2" title="Salutation" tabindex="2" name="name_salutationcon2">
<input id="name_firstcon2" type="text" value="Fisher" tabindex="3" size="12" name="name_firstcon2" maxlength="40">
</td>
</tr>

All Answers

Starz26Starz26

You have to create them individually in VF the VF page

cignuscignus

But isn't there a way to use the components SF is already using? 

It looks ugly when I create them individually, specially the way salutation stays as a independent field with a label.

 

The definition of the name field in contact is strange. You have the name field and there are 3 different fields under it with data types instead of field names.

Starz26Starz26

Again, visualforce taxes

 

 

You will have to create a small table in that column.

 

Here is the code from the standard edit page:

 

<tr>

<td class="labelCol">
<td class="dataCol col02">
<select id="name_salutationcon2" title="Salutation" tabindex="2" name="name_salutationcon2">
<input id="name_firstcon2" type="text" value="Fisher" tabindex="3" size="12" name="name_firstcon2" maxlength="40">
</td>
</tr>
This was selected as the best answer
cignuscignus

Thanx

Starz26Starz26

Oh and i believe the field names are:

 

Salutation

FirstName

LastName

 

Use the schema explorer in Eclipse or some other explorer or trial and error to find out for sure.