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
vishwa attikerivishwa attikeri 

need help in apex:tab onclick

Hi,

i have a 4 apex:tab and in 3 apex:tab i have inputfield to insert the data and in last tab i need to display what data i have selected without insert,
i think it is possible only by onclick function, can any one help me how can i achiev this

<apex:tabpanel >
<apex:tab name="tab1">
<apex:inputfield value="{!object.field1}">
<apex:inputfield value="{!object.field2}">
</apex:tab>

<apex:tab name="tab2">
<apex:inputfield value="{!object.field3}">
<apex:inputfield value="{!object.field4}">
</apex:tab>

<apex:tab name="tab3">
<apex:inputfield value="{!object.field5}">
<apex:inputfield value="{!object.field6}">
</apex:tab>

<apex:tab name="tab4">
<apex:outputfield value="{!object.field1}">
<apex:outputfield value="{!object.field2}">
<apex:outputfield value="{!object.field3}">
<apex:outputfield value="{!object.field4}">
<apex:outputfield value="{!object.field5}">
<apex:outputfield value="{!object.field6}">

</apex:tab>
</apex:tabpanel >

 

 Thank you

vishal@forcevishal@force

Maybe I haven't understood your requirement clearly, but from I understand - you want to retain the values entered by user in the three tabs and then show them on the fourth.

 

So, for that you don't need to do anything separately. Your variables store the values while you move from one tab to the other. So on your fourth tab, you can directly refer to your variables.

 

Check the following code: 

 

Page:

 

<apex:page controller="TabbedVisualforce_Controller">
<apex:form >
<apex:tabpanel >
<apex:tab name="tab1">
1: <apex:inputText value="{!input1}" />
2: <apex:inputText value="{!input2}" />
</apex:tab>

<apex:tab name="tab2">
3: <apex:inputText value="{!input3}" />
4: <apex:inputText value="{!input4}" />
</apex:tab>

<apex:tab name="tab3">
5: <apex:inputText value="{!input5}" />
6: <apex:inputText value="{!input6}" />
</apex:tab>

<apex:tab name="tab4">
1: <apex:outputText value="{!input1}" /> <br/>
2: <apex:outputText value="{!input2}" /> <br/>
3: <apex:outputText value="{!input3}" /> <br/>
4: <apex:outputText value="{!input4}" /> <br/>
5: <apex:outputText value="{!input5}" /> <br/>
6: <apex:outputText value="{!input6}" /> <br/>

</apex:tab>
</apex:tabpanel>
</apex:form>
</apex:page>

 

Class:

 

public with sharing class TabbedVisualforce_Controller
{
public String input1 {get;set;}
public String input2 {get;set;}
public String input3 {get;set;}
public String input4 {get;set;}
public String input5 {get;set;}
public String input6 {get;set;}

public TabbedVisualforce_Controller()
{
input1 = input2 = input3 = input4 = input5 = input6 = '';
}
}

 

Now here, your fourth tab will show whatever text you have entered in the input boxes in previous tabs.