Issue while migrating Dhtmlxtabbar from 3.5 to 4.1.3 - dhtmlx

I am updating dhtmlx from v3.5 to v4.1.3 and loading tabbar from ajax call and each tabbar is having different href urls. Previously only selected tab gets load(hitting the url) while doing tabbar.loadStruct but in v4.1.3 all the href urls of tabbar are gets hitting at once while loading tabbar.loadStruct.
Following is the my tabbar xml
<tabbar hrefmode="ajax-html">
<row>
<tab id="151" width='100px' height='17px' selected="1" href="/domain/url1.action">Quick View</tab>
<tab id="198" width='100px' height='17px' href="/domain/url2.action">Chart Status</tab>
<tab id="159" width='100px' height='17px' href="/domain/url3.action">Blackline</tab>
</row>
</tabbar>
only selected first url(i.e /domain/url1.action) gets invoked first time in previous version, but in v4.1.3 all the tabbar's url gets invoked immediate after tabbar.loadStruct.
Can some help me to load only selected tabbar's url?

Here is an official tutorial that should help you: http://www.dhtmlx.com/blog/loading-content-into-tabs-on-demand/

Related

Navigating from Shell FlyoutItem to one level down

I have following structure in Shell View
<FlyoutItem Route="home" Title="Home">
<ShellContent ContentTemplate="{DataTemplate views:HomePage}" />
</FlyoutItem>
<FlyoutItem Route="leaverequest" Title="Leave Request">
<ShellContent ContentTemplate="{DataTemplate views:LeaveRequestView}" />
</FlyoutItem>
The items are appearing properly.
When I click on Leave Request item, the LeaveRequestView opens with a Hamburger menu in top navigation. I want the LeaveRequestView to show a back button instead.
I have tried setting Route attribute in ShellContent instead of FlyoutItem but the result is same.
Is there something to be done in the route definition above or this is a property to be set in LeaveRequestView XAML?
PS: If I navigate in code behind using Shell.Current.GoToAsync("leaverequest"), the behavior is right. I see the back button on top navigation.
Unfortunately, it can not show the back button with follow defined XAML.
<FlyoutItem Route="home" Title="Home">
<ShellContent ContentTemplate="{DataTemplate views:HomePage}" />
</FlyoutItem>
<FlyoutItem Route="leaverequest" Title="Leave Request">
<ShellContent ContentTemplate="{DataTemplate views:LeaveRequestView}" />
</FlyoutItem>
From above the route definition above, we can not make the LeaveRequestView to show a back button.
Because it's designed by Xamarin Forms Shell. If using FlyoutItem in XAML, it means the child view will be navigated by Humburger menu.
As your said, unless using Shell.Current.GoToAsync("leaverequest") to navigate, the back button will show. Meanwhile, you will see that Humburger menu not shows not.
Note :This should be the typical feature of Xamarin Forms FlyoutItem. If not need this feature, you will not need to create a Shell application.

How to setup a content page of a tabbed page in XAML in Xamarin?

I want to setup a tabbed page with three content pages they are page1, page2 and page3 all of them are content pages. When the program starts I want to show page1 content page with page1 tab selected. They do not follow item template model since they are all different content pages compared to the example showing in the Tabbed Page example # xamarian.
<TabbedPage.Children>
<ContentPage Title="Page 1" />
<ContentPage Title="Page 2" />
<ContentPage Title="Page 3" />
</TabbedPage.Children>
What property I should set here so that I can point to the content of the associated content page or do I follow tab selecte event and manually call the appropriate content page? I would like to try to do it with XAML as much as possible.
Thanks
Found the answer here just in case looking for the same question. In my case, I was able to do it in the code behind, but you can do the same in XAML as the post says. One additional thing is, when you add a content page to a tab item and if you want to add title and Icon to it, then you can reference the index of the child and you can set them manually as .Tile and .Icon.
this.Children.Add( new Page1 ());
this.Children[0].Title = "Page 1";
this.Children[1].Icon = "page1.png"

Primefaces Change menu entry via ajax an rerender content on full layout

I am trying to get a simple full layout to work with a navigation on the left side.
That works but I want to reload the center (content) via ajax on menu item selection.
The reason is, that I have a MP3 player on the right side and if the whole page reloads the mp3 player
start the playback again.
On Richfaces I did that with a session bean which holds the actual filename that needs to be rendered in the center
and on menu click the action method analyses the menu entry ID and sets the filename to its corresponding.
Actually that works a little bit for primefaces as well, but the content doesn't render correctly. After punshing F5
it is perfect.
Does anybody can give me a real simple example how I can do that?
Many greetings,
Hauke
I have never use menuitem but with commandButton I just use 'update' notation to refresh the form located in the center content via ajax.
On navigation layoutUnit
<p:commandButton
value="Enter"
image="ui-icon ui-icon-comment"
update="form_input_console form_output_console:tabbed_contents"
actionListener="#{dashboardUi.processCommand}" />
and on the center layout unit
<p:layoutUnit position="center">
<h:form id="form_output_console">
<p:tabView
id="tabbed_contents"
dynamic="true">

UpdatePanel does not fire on first click of link button

I have an update panel on an .aspx page. Within this aspx page I have a few ascx controls. One of the controls has my link button. When that button is pressed I'd expect to get the results I intend to get, but I expect to not see a page flicker or see the page postback. It does both. After I change some search information and click the link button again the page does an async postback (which is what I expected on the first click). After running this sequence through fiddler I see that the first time I click the button I am missing some information that is included in all subsequent requests.
ctl00$ScriptManager1=ctl00$cplContents$updatePanelOrderSearch|ctl00$cplContents$ucOrderSearchControl$btnRange&EVENTTARGET=ctl00%24cplContents%24ucOrderSearchControl%24btnRange&.....
Above is what I get on clicks 2, 3, etc.. This is not in the request when I click on the link button the very first time. Im wondering if this is why I am get a full, non async postback the first time.
Any help would be appreciated. My update panel code is below.
<asp:UpdatePanel ID="updatePanelOrderSearch" runat="server" UpdateMode="Always" ChildrenAsTriggers="true">
<ContentTemplate>
<uc:control1 "this control has the link button" />
<hr />
<div id="SearchResults">
<div id="SearchResultsMessage">
<asp:Literal ID="lblMessage" Text="No orders found" Visible="false" runat="server" />
</div>
<uc:contorl 2 />
</div>
<uc: control3 />
</ContentTemplate>
</asp:UpdatePanel>
Thanks
this was an issue from months ago and we wound up not using this solution

Lazy loading parts of seam pages?

I'm working on a seam application (2.1.1.GA under JBoss AS 4.2.2) where a particular has a number of (sometimes large) sections that do not need to be rendered untill the user interacts with that particular section, think along the lines of an article title where the user clicks on the title and it expands to show a box containing the text.
I can implement this without any problems with Seam and Richfaces but the contents of all the sections are downloaded to the browser when the user first loads the page. Is there anyway for these sections (which may or may not contain richfaces controls themselves) to be downloaded on demand using ajax?
Thanks.
Lots of ways.
Just set rendered="false" on the box and then reRender it's parent container when you click the title.
eg. Where you have a boolean called showContent in your backing Bean that is toggled by the toggleContent() method:
<a4j:commandLink
value="This is a title"
ajaxSingle="true"
reRender="contentDiv"
action="#{someBackingBean.toggleContent}"/>
<a4j:outputPanel id="contentDiv">
<a4j:outputPanel rendered="#{someBackingBean.showContent}">
This is some text that is not rendered when the page loads
</a4j:outputPanel>
</a4j:outputPanel>
EDIT: In response to comment. Another way to do it would be to use the a4j:jsFunction (very handy) and some javascript.
<h1 onclick="toggleContent(this);">This is a title</h1>
<a4j:outputPanel id="contentDiv">
<a4j:outputPanel rendered="#{someBackingBean.showContent}">
This is some text that is not rendered when the page loads
</a4j:outputPanel>
</a4j:outputPanel>
<script>
function toggleContent(element) {
//check if the contentDiv has any contents (maybe check if element has a child under contentDiv)
//if it doesn't then call a4j:jsFunction to load the contentDiv eg. loadContent();
//hide or show div depending on the current state of it
}
</script>
<a4j:jsFunction name="loadContent" action="#{someBackingBean.toggleContent}" reRender="contentDiv"/>
Something like this anyway.
What about if you using scrollable table. How to implement fetching data in chunks?
Ragards
Marko

Resources