• Jpaq
  • NEWBIE
  • 50 Points
  • Member since 2007

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

 

Hello Board,

 

I have created  tab for custom object Job__c, which is overidden by VF page.

 

The overrided page show Job information in <apex:Tabpanel>

 

The first tab in tabpanel is used to display Job detail information.

 

The other tabs are used to display related list for that Job.

 

The tabpanel is structure is like this:

 

<apex:page>
<apex:form>
<apex:tapanel>
<apex:tab label="Detail">
<apex:detail/>
</apex:tab>

<apex:tab label="Related List 1">
<apex:relatedList subject="{!Job__c}" list="Job_Specs__r"/> 
</apex:tab>

<apex:tab label="Related List 1">
<apex:include pageName="VF_page1"/> 
</apex:tab>
</apex:tabpanel>
</apex:form>
</apex:page>

 

I want to switch on-off these tabs based on User requirement. Is there any way to do this?

As, these tabs are from displayed using visualforce page Tabpanel.

 

Thanks,
Devendra

 

 

I created tabs following the Tabbed Accounts in 30 seconds post and my problem is that whenever I perform an action on any tab other than the detail tab I'm returned to the detail tab after the action is completed instead of returning to the tab I was on.  

 

I tried to find code samples that my lead me to an answer and I thought maybe I had to create an standard controller extension which I attached below.  However, I'm very green at this so I don't really know how to continue so any direction and sample code would be greatly appreciated.  I'm sure I'm not the only one who has implemented this cool technique and has run into this problem.

 

Keith

 

VS Page:

 

<apex:page standardController="Account" extensions="accountExt" id="p"
showHeader="true" tabStyle="account" >
<apex:tabPanel switchType="client" selectedTab="name2" id="theTabPanel">
<apex:tab label="Details" name="AccDetails" id="tabdetails">
<apex:detail relatedList="false" title="true"/>
</apex:tab>
<apex:tab label="Contacts" name="Contacts__r" id="tabContact">
<apex:relatedList subject="{!account}" list="contacts__r" />
</apex:tab>
<apex:tab label="Invoices" name="Invoices" id="tabInvoice">
<apex:relatedList subject="{!account}" list="invoices__r" />
</apex:tab>
<apex:tab label="Open Activities" name="OpenActivities" id="tabOpenAct">
<apex:relatedList subject="{!account}" list="OpenActivities" />
</apex:tab>
<apex:tab label="Products Offered" name="ProductsOffered" id="tabProdOffer">
<apex:relatedList subject="{!account}" list="Products_Offered__r" />
</apex:tab>
<apex:tab label="Products Sold" name="ProductsSold" id="tabProdSold">
<apex:relatedList subject="{!account}" list="Product_Releases__r" />
</apex:tab>
</apex:tabPanel>
</apex:page>

 Controller:

 

public class accountExt {

String aId;
String pId;

public accountExt(ApexPages.StandardController controller) {
aId = ApexPages.currentPage().getParameters().get('aId');
pId = ApexPages.currentPage().getParameters().get('pId');
}

public PageReference redirect(){
PageReference pageRef = new PageReference('/'+pId);
pageRef.setRedirect(true);
return pageRef;
}

public void setState(String n) {
state = n;
}

public String getState() {
return state;
}

public PageReference methodOne() {
return null;
}

private String state = 'no';
}

 

 

 

 

 

 

Hello Board,

 

I have created  tab for custom object Job__c, which is overidden by VF page.

 

The overrided page show Job information in <apex:Tabpanel>

 

The first tab in tabpanel is used to display Job detail information.

 

The other tabs are used to display related list for that Job.

 

The tabpanel is structure is like this:

 

<apex:page>
<apex:form>
<apex:tapanel>
<apex:tab label="Detail">
<apex:detail/>
</apex:tab>

<apex:tab label="Related List 1">
<apex:relatedList subject="{!Job__c}" list="Job_Specs__r"/> 
</apex:tab>

<apex:tab label="Related List 1">
<apex:include pageName="VF_page1"/> 
</apex:tab>
</apex:tabpanel>
</apex:form>
</apex:page>

 

I want to switch on-off these tabs based on User requirement. Is there any way to do this?

As, these tabs are from displayed using visualforce page Tabpanel.

 

Thanks,
Devendra

 

 

I created tabs following the Tabbed Accounts in 30 seconds post and my problem is that whenever I perform an action on any tab other than the detail tab I'm returned to the detail tab after the action is completed instead of returning to the tab I was on.  

 

I tried to find code samples that my lead me to an answer and I thought maybe I had to create an standard controller extension which I attached below.  However, I'm very green at this so I don't really know how to continue so any direction and sample code would be greatly appreciated.  I'm sure I'm not the only one who has implemented this cool technique and has run into this problem.

 

Keith

 

VS Page:

 

<apex:page standardController="Account" extensions="accountExt" id="p"
showHeader="true" tabStyle="account" >
<apex:tabPanel switchType="client" selectedTab="name2" id="theTabPanel">
<apex:tab label="Details" name="AccDetails" id="tabdetails">
<apex:detail relatedList="false" title="true"/>
</apex:tab>
<apex:tab label="Contacts" name="Contacts__r" id="tabContact">
<apex:relatedList subject="{!account}" list="contacts__r" />
</apex:tab>
<apex:tab label="Invoices" name="Invoices" id="tabInvoice">
<apex:relatedList subject="{!account}" list="invoices__r" />
</apex:tab>
<apex:tab label="Open Activities" name="OpenActivities" id="tabOpenAct">
<apex:relatedList subject="{!account}" list="OpenActivities" />
</apex:tab>
<apex:tab label="Products Offered" name="ProductsOffered" id="tabProdOffer">
<apex:relatedList subject="{!account}" list="Products_Offered__r" />
</apex:tab>
<apex:tab label="Products Sold" name="ProductsSold" id="tabProdSold">
<apex:relatedList subject="{!account}" list="Product_Releases__r" />
</apex:tab>
</apex:tabPanel>
</apex:page>

 Controller:

 

public class accountExt {

String aId;
String pId;

public accountExt(ApexPages.StandardController controller) {
aId = ApexPages.currentPage().getParameters().get('aId');
pId = ApexPages.currentPage().getParameters().get('pId');
}

public PageReference redirect(){
PageReference pageRef = new PageReference('/'+pId);
pageRef.setRedirect(true);
return pageRef;
}

public void setState(String n) {
state = n;
}

public String getState() {
return state;
}

public PageReference methodOne() {
return null;
}

private String state = 'no';
}