how can i load data when click on tab in salesforce? - salesforce

i had created 4 Visualforce tab. and also implement that when user click on the tab at that time only respective page load. and it is working also. but problem is data of default page is loading but the data of included page is not loading with page. i had post my code here. so how can i load data when click on particular tab. ?????![enter image description here][1]
<apex:tab id="tab1" name="tab1" >
<apex:detail/>
</apex:tab>
<apex:tab id="tab2" name="tab2" >
<apex:include pageName="page2" />
</apex:tab>
`

You need to wrap your <apex:tab> components in an <apex:tabpanel> component, like so:
<apex:tabpanel selectedTab="tab1">
<apex:tab name="tab1">
<!-- put tab 1 content here -->
</apex:tab>
<apex:tab name="tab2">
<!-- put tab2 content here -->
</apex:tab>
<!-- etc -->
</apex:tabpanel>

Related

Display IconFile in DNN menu

I am trying to modify the default skin of DNN 9.3.2 to display the IconFile which I have set under page settings for each page.
To display the icon anywhere on a page I used
<img src="<%= Server.HtmlEncode(PortalSettings.ActiveTab.IconFile) %>" />
but it's not what I want.
It should appear like this:
Any ideas?
OK, solved:
<img src="[=ICON]" />

Ugly Url with in single page Angularjs

I have a <div id="section1"> </div> at the bottom of my page.
And I have a button I want this functionality in button
$location.hash('section1');
$anchorScroll();
It is working as I want but it is giving me ugly url all this is in single page than why my url is updating?
my expecting Url is :
/Order/BuildOrder
when page load I get this but when I click button screen took me to my anchor div with id='section1'
but now url change to /Order/BuildOrder#!#section1
How can I remove #!# as this is scrolling on a single page. href location is not changing

ActionFunction won't call controller function without Alert Message

I'm trying to capture the selected tab in my controller. I have the below code and it works fine if I leave in the alert message in the script. Once I remove the alert it no longer seems to make the call to the controller. I'm only displaying one tab in the code snippet. I have 3 others defined.
<apex:page showheader="true" sidebar="true" controller="mycontroller">
<script>
function setActiveTabJava(value){
alert('here');
setActiveTab(value);
}
</script>
<apex:form >
<apex:actionFunction id="activeTab" name="setActiveTab" action="{!setTab}" reRender="">
<apex:param name="activeTab" assignTo="{!activeTab}" value=""/>
</apex:actionFunction>
</apex:form>
<apex:pageblock >
<apex:tabpanel selectedtab="Tab One" width="100%">
<apex:tab label="This is tab one" name="tabone" id="referralTab" ontabenter="setActTabJava('TAB1');">
<!-- other tab code-->
</apex:tab>
</apex:tabpanel>
</apex:pageblock>
I basically fixed this by using the value attribute on the tab panel. Since my controller only interested in know which tab was selected, and not when the tab was selected it worked. Basically:
<apex:tabpanel value="{!activeTab}">
<apex:tab name="tab1">...</apex:Tab>
So whenever a tab is changed, as long as you've specified a name attribute on the tab it will be accessible in your controller.
So sorry I no longer have that controller code to post but it was basically just a method that set a variable in the controller.

Tabs menu with ionic framework

i use ionic-framework to create my webapp. I need to insert in the middle of the page (inside ion-content) a block with 3 tabs. There is a conponent called ion-tabs but it has only 2 possibilities of position: bottom or top. Nobody knows any solutions? thanx
<ion-view>
<!-- TOP BAR -->
<ion-nav-buttons side="left"></ion-nav-buttons>
<!-- PAGE CONTENT -->
<ion-content class="has-header">
...some content
TABS menu
...other content
</ion-content>
</ion-view>

Load all pages scrolled to top of the body instead of my ng-view

I have a main menu item inside of my base template which resides outside of my ng-view container. I would like for my links to work so that whenever I change pages between them, the pages load scrolled on top instead of the ng-view nested within my body and outside of my main menu.
It should be noted that when loading a view directly instead of through a link, the view starts on top, as I desire.
<body>
<header>
<search />
<login />
<!-- more main menu stuff -->
</header>
<div ng-view="" class="content">
<!-- This link should redirect me to /profile *and* start on top of my body! -->
<a ng-href="#/profile/john">John</a>
</div>
</body>
PS - The main menu is outside of my ng-view and directly on my base template so it easily resides on all my views.
You can use the autoscroll param with ng-view to make this work.

Resources