Thursday, May 14, 2009

Xpages: Has anyone created a picklist yet?

I was wondering because it would be nice to have a button to pop up a dialog with a view in it, have check boxes and be able to return values back to the underlying webpage when done.

I have created a dialog inside an iframe for a simple pop up form, so i am familiar with that step. I guess i could put an xpage view inside the dialog and then when the select button is pushed, transfer the values, but how would one get the values of the selected document?

Any help is appreciated, this seems to be the only big thing missing from xpages, and maybe they will add an @picklist function in the future

3 comments:

Tim Tripcony said...

Mark, check out Dojo's Dialog... looks like a popup but isn't, so you don't have to deal with cross-frame interaction: just encapsulate the checkboxes inside the dialog.

Mark Hughes said...

@tim i did not make that clear, thats what i am talking about, but the question becomes how to capture the checked values.

Tim Tripcony said...

You mentioned an iframe, so I assumed the checkboxes were in that iframe...

If the checkbox control is bound to a document data source, you can retrieve their value using:

currentDocument.getDocument().getItemValue("fieldName");
(or replace currentDocument with the variable associated with that data source)

If not, you can still use getComponent("controlID").getValue() to retrieve the values.

Post a Comment