+ Start a Discussion
Russell baker 1Russell baker 1 

VF page with divide one textbox in 4 section

I have an opprtunty plan page where i want to put a rectangle which is divided in four part under one section so I can put text in all four box. or another wat I want to create 4 text box with single name.
It's just like a single page divided in four equal part.
plz help!

 
Best Answer chosen by Russell baker 1
Chandra Prakash PandeyChandra Prakash Pandey
Hi Russell,

you can do this very easily....

User-added image
VF Page Code:
<table width="50%" border="2" style="border-collapse: collapse;padding:0px;">
    <tr>
        <td>
             <apex:inputTextarea style="width:98%;" rows="20" value="{!txtContent1}"/>
        </td>
        <td>
             <apex:inputTextarea style="width:98%;" rows="20" value="{!txtContent2}"/>
        </td>
    </tr>
    <tr>                
        <td>
            <apex:inputTextarea style="width:98%;" rows="20" value="{!txtContent3}"/>
        </td>
        <td>
            <apex:inputTextarea style="width:98%;" rows="20" value="{!txtContent4}"/>
        </td>
    </tr>
</table>
<apex:commandButton value="Show Data" action="{!getFullContent}"  reRender="lblDisplayContent"/>
<apex:outputLabel id="lblDisplayContent" value="{!fullContent}"></apex:outputLabel>
Apex Code:
public string fullContent {get; set;}
public string txtContent1 {get; set;}
public string txtContent2 {get; set;}
public string txtContent3 {get; set;}
public string txtContent4 {get; set;}

public void getFullContent()
{
    fullContent = txtContent1 + ' ' + txtContent2 + ' ' + txtContent3 + ' ' + txtContent4;
}

Now just click Show Data button on VF Page and you will get your desired concatenated content.

You can convert this entire code in a component shape also so that you can reuse the same on the multiple places.

Let me know if you need more help on this.

Regards,
Chandra Prakash
pandey.chandra2011@gmail.com

All Answers

Russell baker 1Russell baker 1
User-added image Like this I have to create a textbox or four text box and it should show like this plz help..
Chandra Prakash PandeyChandra Prakash Pandey
Hi Russell,

you can do this very easily....

User-added image
VF Page Code:
<table width="50%" border="2" style="border-collapse: collapse;padding:0px;">
    <tr>
        <td>
             <apex:inputTextarea style="width:98%;" rows="20" value="{!txtContent1}"/>
        </td>
        <td>
             <apex:inputTextarea style="width:98%;" rows="20" value="{!txtContent2}"/>
        </td>
    </tr>
    <tr>                
        <td>
            <apex:inputTextarea style="width:98%;" rows="20" value="{!txtContent3}"/>
        </td>
        <td>
            <apex:inputTextarea style="width:98%;" rows="20" value="{!txtContent4}"/>
        </td>
    </tr>
</table>
<apex:commandButton value="Show Data" action="{!getFullContent}"  reRender="lblDisplayContent"/>
<apex:outputLabel id="lblDisplayContent" value="{!fullContent}"></apex:outputLabel>
Apex Code:
public string fullContent {get; set;}
public string txtContent1 {get; set;}
public string txtContent2 {get; set;}
public string txtContent3 {get; set;}
public string txtContent4 {get; set;}

public void getFullContent()
{
    fullContent = txtContent1 + ' ' + txtContent2 + ' ' + txtContent3 + ' ' + txtContent4;
}

Now just click Show Data button on VF Page and you will get your desired concatenated content.

You can convert this entire code in a component shape also so that you can reuse the same on the multiple places.

Let me know if you need more help on this.

Regards,
Chandra Prakash
pandey.chandra2011@gmail.com
This was selected as the best answer
Russell baker 1Russell baker 1
Hi Chandra,

Thank you so much for your reply. 
I don't want to show data I just want add this thing in a section of standard page. and the data which i will enter after save whole page it will show on detail page.

Please suggest what to do.

make a great day cheers!.
 
Chandra Prakash PandeyChandra Prakash Pandey
Hi Russell,

Since the requirement is not a standard salesforce functionality so I don't see any way to do this on any standard page. Standard page has tight coupling with objects one to one. You can have custom VF page with a standard controller and then you will have the liberty to do this.

Regards,
Chandra Prakash
Russell baker 1Russell baker 1
Hi Chandra,

I have created VF page and when I drag that page into Edit page layout section and save it. afther go to detail page it is not showing. it is hsowing like this.

User-added image

but when i go to detail page it is not showing. 
 
Chandra Prakash PandeyChandra Prakash Pandey
Hi Russell,

This is Edit Layout of your object. How is it looking on view mode when you open any record.
Russell baker 1Russell baker 1
Hi Chandra,

It is not showing on view mode. I would not able to see it. So  how can i enter data and save it. 
please help me to build an apex call.
I need these boxes for enter number. and when i open the record it would show like that.

please help