0
votes

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?

  1. What are the DominoViewCustomizer methods I need to override? (looking at afterCreateColumn)
  2. How do I get and set the column values? (really lost here)
  3. 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?
  4. How do I make the star icon clickable?
  5. How do I capture that click event?

Using Domino v9.0.1

1

1 Answers

0
votes

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.