Xpages - Make a dialog list / Picklist?

Hi,

Does anyone know how I would be able to make a dialog list (like the one available in the client) or a pick list?

I need to create a list (which is created via dblookup) which has checkboxes so multiple entries can be selected. I found this great little article from Mark Hughes(Getting Creative With Domino Web Development: Xpages: How to create a view picklist!!) which would have solved my problem, but he is implementing a view panel which as far as I know can’t work with dblookup (if I’m wrong, can anyone let me know how I would use a dblookup on a view panel?).

Instead of a view panel, I’ve been trying to use a repeat panel and a checkbox field for my application but I’m struggling with getting the selected data out of the repeat panel (everytime I try to get the data it extracts all fields, rather than just the selected ones …).

Any advice is greatly appreciated!

Thanks

Subject: maybe client side js

Hi,

i suppose the checkboxes in your repeat control has the id as value. so maybe you can use client side js.

maybe something like this (jQuery):

$(‘input:checkbox:checked’).each(function(i){

alert($(this).val());

});

Subject: found the SS way

Thanks for the suggestion Benjamin, I’ve found a different way to get it working but I appreciate the help nonetheless :slight_smile:

After some more playing around I finally found you can do a lookup on the view panel using ‘key’ under all properties rather than writing an @dblookup in javascript. I could then follow the tutorial from the earlier link and after changing his code slightly, I can now select multiple options rather than singular ones (his code iterates through all selected IDs but only seems to pull data from the last one selected).

Next problem I have to try and figure out, is how to get the view panel to remember what the user has previously ticked if they re-open the dialog window.

If anyone can shed any light on that or has any ideas how I could achieve this I’d once again be very grateful :slight_smile:

Subject: remember the decision

Hi Neemesh,

you could save the selected ids in a hashmap.

sessionScope.ids = (sessionScope.ids || new java.util.HashMap());

And if the user reopens the dialog you can get the selected values very simple.