Lotus xpages: xpage containing multiple views - xpages

I have a xpage which contains one big table with 1 row and 2 columns. I created this table to separate the xpage into 2 parts: the left one where I have some buttons and the right one where I want to display some views.
From the container controls I drag a View on the right column, but is there any chance to do this in such a way that 1st button clicked => 1st view is shown, 2nd button clicked => 2nd view is shown and so on.
Or every xpage should contain one view?
I raise this question considering the fact that in Lotus Notes if you had one frameset with 2 frames, you could easily create an outline in one frame, and some views that will be open by every outline entry in the 2nd frame. What I want to do is quite the same thing.
I appreciate your time. If you think this question isn't 'good' enough, I will just delete it. I'm new in XPages development.

Use simple table with one row and two columns. Place your buttons inside the left cell. Put the switch control (mentioned by Tim) to the right one.
More about the control in extlib demo DB... online demo here

Create separate custom control for each view and drag and drop "Include Page" from container control to the right column of your table and compute the page name instead of selecting an XPage. You can compute like this sessionScope.CCName + ".xsp". And onclick of the button set appropriate custom control(which contains the view) name as the value to the sessionScope variable and reload the page. This will do what you want. I hope this too helps.

You could do this on a single XPage using a xe:navigator control in the left column and an xe:dynamicViewPanel control in the right. These controls are available in the Extension Library if you are running 8.5.3 and natively available in release 9.
The Dynamic View Panel control is the dynamic content control for displaying one of several Domino views. Only the component for the displayed view is loaded in the component tree so it is highly efficient compared to alternative designs (like an xp:viewPanel control in each facet of an xe:switchFacet control as each viewPanel is loaded in the component tree on the server, not just the one that is rendered).
See this online demo http://xpages.jp/demos/xpagesext.nsf/Domino_DynamicView.xsp

put each content on a seperate panel in a custom control.
Have those custom controls in seperate divs and show/hide divs based on button click.
If you are using different xpages, you can use IncludePage(from container controls), which will act like a computed subform.

Related

Xpages chained djFilteringSelect in separate dialogs

I am trying to make a 2nd djFilteringSelect using a #Dbcolumn depending on the value selected in the 1st djFilteringSelect control. That's a common task, using a partial refresh. However, each of the controls is within a dialog control from the extension library. One dialog pops up, the user selects a value, and automatically the 1st dialog closes and the 2nd opens. YOU CAN'T SEEM TO REFRESH THE FIELD (I'm guessing b/c it's not in the DOM). I've tried writing the first value to to an computed field and/or a text box on the main Xpage using CSJS and then looking for that value for the second lookup. Also, tried with SSJS, etc. I tried do updates and writing to fields on either the onChange or on the click of button. How do I go about using the selected value of the first to do the lookup in the 2nd?
You can use a single dialog control where you hide and show the relevant controls. I am using this approach in several apps.

Can we change the diaplsy format of data from one kendo component to other on runtime in mvc?

I have a page with two buttons in header. I need to display same data on click of both buttons resp. but in different layout, means at click of first button i want to display a kendo asp.net mvc grid and at click of second i want tot display that data in a form of listview. So the question is, is it possible to display the data initially as a grid or listview (any one ) and at runtime we can change the format from grid to listview so that we don't have to create seperate controls partial views for that. Or any better idea on how to implement it is also welcomed.

Select All checkbox lotus xpages

I'm working on an Xpages application on which I have a view control.
I tried to put a checkbox in the column header to select all of the check boxes in the view.
The problem is when I go to another page from the view, its lines are not checked and the selection is made only on the visible page.
So, I want to be able to select all the rows in all the pages of the view, this without the selection disappears when switching from one page to another of the view.
There are couple of problems with views and selections.
First of all, pager actions to move between pages does not process 'select all rows' data because it is enabled to use partial execution by default. If you put partialExecute="false" into your pager, you will see that 'select all rows' checkbox will be maintained between pages.
However, if you have a checkbox on a column and the columnHeader, the component maintains a selectedIds array in the back-end. Unfortunately, this array holds only visible selections. Because the array is maintained by the viewPanel component, which is not aware of the list of data entries that are not shown.
Also, checkbox implementation does not provide any even mechanism where you can grab selections on the back-end to cache them between pages.
To determine select all checkbox can be doable with a little trick. Assuming you are using all default styles;
<xp:inputHidden
id="inputAllSelected"
value="#{viewScope.allSelected}"
defaultValue="false"></xp:inputHidden>
<xp:scriptBlock
id="scriptBlock1">
<xp:this.value><![CDATA[
function getSelectAllCheckbox() {
return dojo.query("input.xspCheckBoxViewColumnHeader")[0];
}
function toggleSelectAll(){
dojo.byId("#{id:inputAllSelected}").value=getSelectAllCheckbox().checked;
}
dojo.addOnLoad(function() {
dojo.connect(getSelectAllCheckbox(), "onchange", toggleSelectAll);
});
]]></xp:this.value>
</xp:scriptBlock>
To cache checkboxes between pages, you would implement your own checkboxes by using custom columns. I recommend using a data table component to get more flexibility.

XPages newbie - view columns in discussion database

I'm a traditional domino developer just beginning XPages. I'm working on modifying the standard 8.5.3 Domino discussion database. I've added some fields on the Main Topic and response forms, one called category. I've added a categorised column in the ($xpAllDocuments) view to the left of "Topic" for the category field. This works fine in Notes as you'd expect, but when the view is rendered in the All Documents xpage, the category twiste displays without any label. I'm not sure how to modify the column data for the xpage, as it seems to use a repeat? instead of a view?
Any help greatly appreciated, and apologies for the presumably basic enquiry!
You have to add the categories column to custom control allDocumentsView which renders the view for browser.
How to find out where to set the new categorized column? A good way is to look at the "All properties" of a certain element. For that, open the Source pane of custom control allDocumentsView, position cursor on <xe:dataView and look at "All Properties". If you hover over the properties' labels you get a helper window with a short explanation.
In your case, property categoryColumn is what you are looking for. Assuming you added a categorized column Categories to view ($xpAllDocuments) then you would have to put into property categoryColumn:
With that, your source code gets expanded by
<xe:this.categoryColumn>
<xe:viewCategoryColumn
columnName="Categories"
columnTitle="Categories">
</xe:viewCategoryColumn>
</xe:this.categoryColumn>
and you will see the added categorized column in your rendered XPage.
I don't know the discussion template in detail, but when the All Documents Xpage is using a repeat control, then you cannot expect an automatic category expand/collapse feature as in a Notes view.
If you want that, you need a View control on the Xpage.

How to use <h:selectOneRadio> on more than one datatable

I'm trying to achieve the well known feature of being able to select a datatable's row by using a radio button.
I have followed this blog:
http://balusc.blogspot.com/2006/06/using-datatables.html#SelectRowByRadioButton
It works perfectly if there is one datatable on the form, but when I add another one (even if it's placed on other form), and try to select a row there, the radio button gets selected then instantly unselected. The data is correctly set on the backing bean though.
Any ideas about how to extend the results of the above blog on more than one datatable?
Thank you
That script will group all radio buttons with the same component ID in the same form. So to fix your particular problem, put the other data table in a different form or give the other <h:selectOneRadio> a different ID.

Resources