This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jul 28, 2011, 10:41 PM
19 Posts

How to simple XPages App

  • Category: Other
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: XPages Application
  • Replies: 8
 Hi All,
I have simple question I believe. . .  I'm a total newb to XPages so if this is an easy one, I apologize ahead of time.
 
I want to make a simple application that has a navigation panel on the left that is computed dynamically.  When you click on an item in the navigation it displays it's content to the right.  Much like this forum I suppose.  After looking at a dozen or so sample XPages apps they all seem to be built the same way where each navigation links to it's own Xpage.  I was hoping to have one Navigation XPage for the left side and one content page for the right page and dynamically update what should be displayed in the content page.
 
Any idea how to do this?
Jul 29, 2011, 1:25 PM
272 Posts
Re: How to simple XPages App
Hi Steve,
 
the only way to do this is creating a frameset and embed the XPages you want (You can not use the"<xp:include>-Tag because the included page can not be computed dynamically). But this is not a good way to create a nice web application...
 
Sven

Jul 29, 2011, 2:46 PM
19 Posts
Re: How to simple XPages App
So is there a way to achieve what I am trying to do without having to have an XPage for every View I want to display?
Jul 29, 2011, 7:56 PM
272 Posts
Re: How to simple XPages App
Yes.
 
You could create an XPage with a custom control. This custom control has a view datasource. The displayed view is bound to this datasource.
A click on a navigator link does a partial refresh on the custom control. To know which link was clicked, a parameter has to be added.
 
Now, the datasource can be recomputed via the parameter. The view you want will be displayed
Aug 1, 2011, 10:10 PM
19 Posts
Re: How to simple XPages App
Hey Sven,
 
That is exactly what I'm talking about.  Only one problem.  I'm totally new to XPages and don't have a clue how to implement what you just explained.
 
Do you know of an example app like you described?
Aug 4, 2011, 2:29 PM
8 Posts
Re: How to simple XPages App
Steve,
 
You might like to have a look at my post where I've used an include page:
http://www-10.lotus.com/ldd/xpagesforum.nsf/topicThread.xsp?documentId=DEB795C42373AB03852578720044B80A&action=openDocument&SessionID=CTSMBQDETU
 
Basically, create an XPage with an embedded include page. In the include page "Options", "Page name" compute the value with "context.getUrlParameter("Page")
Then direct your browser to "xxx.xsp?Page=includedPageName.xsp". The included page should pick up the Page parameter and show the "includedPageName.xsp" XP
 
For the menu bit, I've used a tree menu:
http://www.openntf.org/Projects/pmt.nsf/ProjectLookup/Tree%20XPage%20Control
 
which has a URL for each leaf item. When you click on the leaf, the URL (with the Page parameter) is loaded and the
included page is shown.
 
Let me know if you're struggling and I'll try to help.
 
   Kev
Aug 4, 2011, 8:29 PM
272 Posts
Re: How to simple XPages App
Oh, thanks for the update. Did not know that you can compute the included page this way (with a full reload of the page).
I have tried to compute it with an partial refresh and this does not work.
 
Sven
Aug 5, 2011, 2:13 PM
8 Posts
Re: How to simple XPages App
Sven,
 
No, I couldn't get a partial refresh of an included page to work either.
The solution I have is to refresh the whole page. In effect this is what happens when the tree menu item is clicked - a new URL is issued and the whole
page is reloaded. It's a double shame, because the tree menu I use gets loaded all over again even though it is static.
Still, I'm OK with it to keep the project moving.
 
I'm in total agreement that this sort of basic menu/page solution should have been covered elsewhere but somehow there are few articles about it on the web.
 
   Kev
Aug 10, 2011, 10:15 PM
19 Posts
Re: How to simple XPages App
Hey Kev,
 
thanks, your explanation and your link make sense!  I'm going to give it a ago in my sample app.
 
Thanks again for your help!

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal