xpages on click event from view panel column - pop up dialog forms from views -
there 2 datasources: cdoc
( doc. content ) , pdoc
( inside dialog ).
these 2 datasources linked based on cdoc'unid
.
my main view panel this:
[_a_common_field] cdoc1 , pdocs cdoc1 ( column categorized ) cdoc1 pdoc 1 cdoc1 pdoc 2 cdoc1 [_a_common_field] cdoc2 , pdocs cdoc2 ( column categorized ) cdoc2 pdoc 1 cdoc2
how can compute target property viewpanel1
considering fact want pdoc
opened in dialog ( created ) , cdoc
opened in 'clasical' mode when target
property wasn't added ?
this answer assumes trying open selected document view panel in dialog. (in essence, open dialog values document listed in embedded view)
forward
more open document in window , done it. if want open in dialog, fine. if define data source in dialog itself, warned have had issues such approaches in past , think datasources should defined in xpage view level.
answer
1. not allow links in view.
2. have checkbox available in view.
3. add button noteid of selected document, making sure document selected.
var vwpnl = getcomponent("homeviewpanel"); var docidarray = vwpnl.getselectedids(); if(docidarray.length != 1){ view.postscript("alert('"+messagecontroller.getmessageforcurrentuser("msg_selectonedocument") +"')"); return; } var firstid = docidarray.length > 0 ? docidarray[0] : ""; return firstid;
(you can ignore messagecontroller 1 of helper classes language specific user messages.)
4 use noteid (whether in viewscope or not) in calculation of data source in dialog making dialog has correct settings, refreshing etc.
edit
the part keeping approach (performance aside) in toolbox once handle on document itself, can compute anything. using noteid set dialog property 1 example. create document object , use values want, including opening page, other actions, whatever want. might not best option current use case (you did not specify use case), future readers help.
Comments
Post a Comment