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
JayaJayaJayaJaya 

Please help with Tabbed VF Page creation

Hi,

 

Please suggest a solution for the following:

 

We have a Parent Object say P and 3 related Objects or child objects say C1, C2 and C3. We have a requirement in which we need to show P, C1, C2, C3 as tabs(similar to the tabs that are displayed in apex:tabPanel) and we need to display a custom VF page as part of each of these tabs. i.e. for C1 tab, we need to display a custom VF page(with C1 as standard controller); for C2 tab, we need to display a custom VF page(with C2 as standard controller) and for C3 tab, we need to display a custom VF page(with C3 as standard controller). Also tab highlighting should happen based on tab selected.

 

Please let us know the best possible way to implement the above.

 

Thanks in advance.

SRKSRK

you can create saparate pages for parent and all 3 child objaects then you can include the in sing VF page using iframe
try the below mention code

<apex:tabPanel id="firstTabPanel" switchType="client">
    <apex:tab id="ParentObj" name="ParentObj" label="Parent">
        <iframe id="ParentPage" frameborder="no" src="apex/ParentPage?id={!MagreFieldHaveingParentRecordID}"/>
    </apex:tab>               
    <apex:tab id="Child" label="Child" name="Child">
        <apex:tabPanel id="ChildTabPanel" switchType="client" >
            
            <apex:tab id="Child1" label="Child1" name="Child1">
                        <iframe id="Child1Frame" frameborder="no" src="apex/Child1PageName?id={!MagreFieldHaveingChild1}"/>
            </apex:tab>
            
            <apex:tab id="winStrategyTab" label="Win Strategy" name="WinStrategy" ontableave="return callValChkJS();">
                        <iframe id="Child2Frame" frameborder="no" src="apex/Child2PageName?id={!MagreFieldHaveingChild2}"/>
            </apex:tab>
            
            <apex:tab id="winStrategyTab" label="Win Strategy" name="WinStrategy" ontableave="return callValChkJS();">
                        <iframe id="Child3Frame" frameborder="no" src="apex/Child3PageName?id={!MagreFieldHaveingChild3}"/>
            </apex:tab>
            
        </apex:tabPanel>
    </apex:tab>
</apex:tabPanel>

JayaJayaJayaJaya

Hi Sharif,

 

Thanks a lot for the response. I was trying with your code, but it gives some error. Could you please share sample code for vf pages used in this page(i.e. for child objs) and the controller please?

 

 

Thanks.

SRKSRK
<apex:page standardController="Child1CustomeObject__c">
<apex:form>
<apex:inputField value="{!Child1CustomeObject__c.name}"/>
<apex:commandButton value="Save" action="{!save}"/>
</apex:form>
</apex:page>


what is the error u r getting ???