Retrieve column value in xpages view - xpages

I have a view control showing documents with an external url in document fieldA.
How can I write a onclick Event to open this URL?
Thanks for help.

In your view column choose a content type of HTML.
In your view add a column that formats the link using the tag. Make this column hidden in the Notes client (if you use it there). Then show this view column in your view control with the content type set to HTML.
Because you are using HTML, you don't need to have an onClick event per say, although the effect is the same.

Related

Sharepoint Document list edit

Is there anyway to edit a column in a document library? directly from the list view? So in Review Completed column below, just toggle the value rather than clicking on edit?
I noticed this is a modern page, you may have a try Field Customizer extension.
Below is a sample:
React Toggle Field Customizer

Want to create an column in Dynamic View Panel that displays "Favorites" icon

I am using a Dynamic View Panel and would like to create a "Favorites" column in the view. The underlying view has a "Favorites" multivalue names field that contains all users that have flagged the document as a favorite. What I would like to do is to handle this conversion in a "Customizer" bean where I can compare the current user with the stored vales in the "Favorites" column and see if they are in the list. If they are I would present a "Green Star" icon (not a standard Notes icon) else I would present an empty star icon. I would also like to make the star icon live so if you click on the star it would toggle the favorite value in the database on/off.
How do I implement such a feature?
What are the DominoViewCustomizer methods I need to override? (looking at afterCreateColumn)
How do I get and set the column values? (really lost here)
How do I get the column to display a Notes resource image (my stars) or do I need to store it in a directory on server?
How do I make the star icon clickable?
How do I capture that click event?
Using Domino v9.0.1
If you don't have to use a dynamic view panel here's a way of doing it that will work with a view panel, repeat, or data table...
Use a "favorites" document for each user. Have it contain one multi-value item to store the Note IDs of all the documents the user favorited.
When the user logs on read the contents of the multi-value field into a sessionScope variable. Then in your view column all you need to do is check if the NoteID of the current row is in your sessionScope variable and display the appropriate icon.
For the part when a user clicks on a star you would have an event handler on that column that does a lookup to the user's favorites document (create it if it doesn't exist) and add or remove the NoteID then do a partial refresh on the view.
You can probably still do this with a dynamic view panel but I can't speak to the particulars of it since I don't use it much.

Lotus xpages: xpage containing multiple views

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.

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.

Format lookup column to display Name (FileLeafRef)

I have a custom publishing page layout I have created. The content type behind the page layout has a lookup column pointing to a document library where I store images. Basically, the pages I am creating from the layout are 'articles' and I have an associated image with each.
As you can probably guess by now, I want to display the lookup image on the page. However, I cannot for the life of me figure out how to do this. I have been inserting columns into the page layout via controls, but I'm not sure how to format it to look at the source document behind the lookup column. I am wondering if it is possible somehow through controls, and if not this way, if it can be done through modifying the XSL of a webpart. My last option which I don't want to use but I know it would work is a workflow (on new item creation, copy Name (FileLeafRef) into a hidden single line text field I coult utilize).
Does anyone know how to format a lookup column to display Name (FileLeafRef)?
Help is greatly appreciated!
-Josh

Resources