javascript - Adding a document to another document through modal checkbox selection -


i'm new xpages , ibm in general i'm new javascript. make understand question little bit easier i've added example of want do.

example: create person document, want add event person , vice-versa (meaning when add event person, person gets added event).

so i'm using document read-only mode preview person document , inside read-only mode have <xp:panel> contains bootstrap panel. in bootstrap panel's header theres button that's connected modal, contains view of event documents.in bootstrap panel's body there's view preview added events.

in modal, added checkbox in first column, can select items want add person document.

what action need add modal's "add" button, add selected documents person document?

<xp:panel>         <xp:this.rendered><![cdata[#{javascript:!dodajoseb.isnewnote() !dodajoseb.iseditable()}]]></xp:this.rendered>          <div class="panel panel-default" style="margin-left:auto;margin-right:auto;width:60%">             <div class="panel-heading">                 <h3 class="panel-title">                     events                     <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#mymodal" style="margin-left:80%;">                         add event                     </button>                 </h3>                  <!-- modal -->                 <div id="mymodal" class="modal fade" role="dialog">                     <div class="modal-dialog">                          <!-- modal content-->                         <div class="modal-content">                             <div class="modal-header">                                 <button type="button" class="close" data-dismiss="modal">                                     <span class="glyphicon glyphicon-remove-circle"></span>                                 </button>                                 <h4 class="modal-title">                                     choose events&#160;<small>that want add</small>                                 </h4>                             </div>                             <div class="modal-body">                                 <p>                                     <xp:panel>                                         <xp:this.data>                                             <xp:dominoview var="dogodekview" viewname="dogodki_rez" keys="#{javascript:sessionscope.imedogodka}">                                             </xp:dominoview>                                         </xp:this.data>                                         <xp:viewpanel rows="7" id="viewpanel1" viewstyle="width:100.0%">                                             <xp:this.facets>                                                 <xp:pager partialrefresh="true" layout="previous group next" xp:key="headerpager" id="pager1">                                                 </xp:pager>                                             </xp:this.facets>                                              <xp:this.data>                                                 <xp:dominoview var="dogodki" viewname="dogodki" keys="#{javascript:sessionscope.imedogodka}">                                                 </xp:dominoview>                                             </xp:this.data>                                              <xp:viewcolumn columnname="nmnaziv" id="viewcolumn2" style="text-align:center" showcheckbox="true">                                                 <xp:viewcolumnheader value="event" id="viewcolumnheader2" style="text-align:center">                                                 </xp:viewcolumnheader>                                             </xp:viewcolumn>                                             <xp:viewcolumn columnname="radiobutton" id="viewcolumn4" style="text-align:center">                                                 <xp:viewcolumnheader value="duration" id="viewcolumnheader4" style="text-align:center">                                                 </xp:viewcolumnheader>                                             </xp:viewcolumn>                                             <xp:viewcolumn columnname="txlokacija" id="viewcolumn15" style="text-align:center">                                                 <xp:viewcolumnheader value="location" id="viewcolumnheader15" style="text-align:center">                                                 </xp:viewcolumnheader>                                             </xp:viewcolumn>                                             <xp:viewcolumn columnname="auorganizator" id="viewcolumn16" style="text-align:center">                                                 <xp:viewcolumnheader value="author" id="viewcolumnheader16" style="text-align:center">                                                 </xp:viewcolumnheader>                                             </xp:viewcolumn>                                         </xp:viewpanel>                                     </xp:panel>                                 </p>                             </div>                             <div class="modal-footer">                                  <xp:button value="save" id="button6">                                     <xp:eventhandler event="onclick" submit="true" refreshmode="complete" immediate="false" save="true"></xp:eventhandler>                                 </xp:button>                             </div>                         </div>                      </div>                 </div>             </div>             <div class="panel-body">                 <xp:panel id="panelmain">                     <xp:this.data>                         <xp:dominoview var="view1" viewname="dogodki">                         </xp:dominoview>                     </xp:this.data>                     <xp:text escape="true" id="computedfield1" style="display:none;">                         <xp:this.value><![cdata[#{javascript://*var vw:notesview = database.getview("(vwpovezava)"); requestscope.data = new array(@dblookup("","(vwpovezava)","385a946ecd7c3207c1257e58002de8a3",2),"467dd3771032d779c1257e570043cf5d");}]]></xp:this.value>                     </xp:text>                     <div class="row">                         <div class="col-md-2">                             <xp:label value="" id="label2">event</xp:label>                         </div>                         <div class="col-md-2">                             <xp:label value="" id="label4">duration</xp:label>                         </div>                         <div class="col-md-2">                             <xp:label value="" id="label5">starting date</xp:label>                         </div>                         <div class="col-md-2">                             <xp:label value="" id="label6">ending date</xp:label>                         </div>                         <div class="col-md-2">                             <xp:label value="" id="label7">location</xp:label>                         </div>                         <div class="col-md-2">                             <xp:label value="" id="label8">author</xp:label>                         </div>                     </div>                     <xp:br></xp:br>                     <xp:repeat id="repeat1" rows="30" var="rowdata" indexvar="indexdata" value="#{javascript:requestscope.data}" style="text-align:center;">                         <div class="row" rows="0">                         <xp:text escape="true" id="computedfield3" style="display:none;">                             <xp:this.value><![cdata[#{javascript:var vw = database.getview("dogodki"); requestscope.docdata = vw.getdocumentbykey(rowdata);}]]></xp:this.value>                         </xp:text>                          <div class="col-md-2">                         <xp:text escape="true" id="event" tagname="div" style="float:left;">                             <xp:this.value><![cdata[#{javascript:return requestscope.docdata.getitemvaluestring("nmnaziv");}]]></xp:this.value>                         </xp:text>                         </div>                         <div class="col-md-2">                         <xp:text escape="true" id="duration" tagname="div" style="float:left;">                             <xp:this.value><![cdata[#{javascript:return requestscope.docdata.getitemvaluestring("radiobutton");}]]></xp:this.value>                         </xp:text>                         </div>                         <div class="col-md-2">                         <xp:text escape="true" id="startingdate" tagname="div" style="float:left;">                             <xp:this.value><![cdata[#{javascript:return requestscope.docdata.getitemvalue("txoddatuma");}]]></xp:this.value>                         </xp:text>                         </div>                         <div class="col-md-2">                         <xp:text escape="true" id="endingdate" tagname="div" style="float:left;">                             <xp:this.value><![cdata[#{javascript:return requestscope.docdata.getitemvalue("txdodatuma");}]]></xp:this.value>                         </xp:text>                         </div>                         <div class="col-md-2">                         <xp:text escape="true" id="location" tagname="div" style="float:left;">                             <xp:this.value><![cdata[#{javascript:return requestscope.docdata.getitemvaluestring("txlokacija");}]]></xp:this.value>                         </xp:text>                         </div>                         <div class="col-md-2">                         <xp:text escape="true" id="author" tagname="div" style="float:left;">                             <xp:this.value><![cdata[#{javascript:return requestscope.docdata.getitemvaluestring("auorganizator");}]]></xp:this.value>                         </xp:text>                         </div>                         <div style="clear:both;">&#160;</div>                         </div>                     </xp:repeat>                 </xp:panel>             </div>         </div>     </xp:panel>' 

i'd suggest rather trying add events person document, add person's name attendee field on each event document selected. then, can display events person has been added using we'd call in 'old notes', single-category embedded view.

the challenge have modal, values aren't saved anywhere. saving document when data not bound document means checkbox column choices have no meaning. it's display of information. if re-opened document using xpage, nothing checked when re-opened modal.

see answer @serdarbasegmez question how add person's name each document that's checked: how marked rows in xpages extension library <xe:dataview> design element?


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -