lotus notes - XPages - View doesn't update when a partial refresh occured -


i have page bound doc data source. @ top of page panel fields doc set. in bottom of page view of docs.

let's fields [a] , [b], , [b]'s value depends on [a], partial refreshes [b] on value change. when set [a] doesn't trigger partial refresh press submit/save, doc saved , page updates , doc appears in view below.

but if set [a] such [b] refreshes press submit/save, doc saved doc doesn't appear in view. need reload page pressing enter in url bar update view. tried research on no avail.

what think can update view on last scenario?

here simplified code:

 <?xml version="1.0" encoding="utf-8"?> <xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xc="http://www.ibm.com/xsp/custom"    style="font-size:11pt;font-weight:bold">      <xp:this.beforepageload>         <![cdata[#{javascript:var currlocation=context.geturl(); var webdbpath=@leftback(currlocation,"/"); sessionscope.jquery=webdbpath+"/jquery.min.js"; sessionscope.jqueryui=webdbpath+"/jquery-ui.min.js"; sessionscope.jqueryblockui=webdbpath+"/jquery.blockui.js"}]]>     </xp:this.beforepageload>      <xp:this.data>          <xp:dominodocument var="attachmentdoc" formname="attachment"></xp:dominodocument>     </xp:this.data>      <xp:this.resources>         <xp:script src="#{javascript:sessionscope.jquery}"          clientside="true">         </xp:script>         <xp:script src="#{javascript:sessionscope.jqueryui}"          clientside="true">         </xp:script>         <xp:script src="#{javascript:sessionscope.jqueryblockui}"          clientside="true">         </xp:script>         <xp:script src="/home.js" clientside="true"></xp:script>         <xp:stylesheet href="/style.css"></xp:stylesheet>         <xp:stylesheet href="/jquery-ui.css"></xp:stylesheet>         <xp:script src="/utils.jss" clientside="false"></xp:script>     </xp:this.resources>      <xp:span style="font-weight:bold;font-size:11pt"></xp:span>     <xp:span style="font-size:14pt"></xp:span>     <xp:span style="font-weight:bold;font-size:11pt"></xp:span>     <xp:inputtext id="reuploadattachmentid" style="display: none;"       styleclass="reuploadattachmentid"></xp:inputtext>     <xp:br style="font-size:11pt"></xp:br>     <xp:panel style="margin-left:auto;margin-right:auto;width:940.0px"       id="mainpanel">          <xp:span style="font-size:14pt"></xp:span>         <xp:span style="font-size:14pt"></xp:span>         <xp:br style="font-weight:bold"></xp:br>         <xp:br></xp:br>         <xp:inputtext id="errormessage" value="#{requestscope.errormessage}"          styleclass="errormessage"></xp:inputtext>          <xp:span style="font-weight:bold"></xp:span>         <xp:span style="font-weight:bold">             <xp:span style="font-weight:bold"></xp:span>         </xp:span>         <xp:br></xp:br>         <xp:panel styleclass="upload-details-panel">             <xp:span>upload:</xp:span>             <xp:fileupload id="fileupload1" value="#{attachmentdoc.attachment}"></xp:fileupload>         </xp:panel>         <xp:panel styleclass="upload-details-panel">             <span>type:</span>             <xp:combobox id="cbuploadtype" value="#{attachmentdoc.file_type}"             styleclass="cbuploadtype">                 <xp:selectitem itemlabel="attachment"></xp:selectitem>                 <xp:selectitem itemlabel="ecr master file"></xp:selectitem>                  <xp:selectitem itemlabel="financial analysis"></xp:selectitem>                 <xp:eventhandler event="onchange" submit="true"                refreshmode="partial" refreshid="paneluploaddetails">                 </xp:eventhandler>             </xp:combobox>         </xp:panel>          <xp:panel id="paneluploaddetails">             <xp:panel styleclass="upload-details-panel">                 <xp:this.rendered><![cdata[#{javascript:var uploadtype = getcomponent("cbuploadtype").getvalue(); if(uploadtype == "attachment" || uploadtype == null){     return false; } return true;}]]></xp:this.rendered>                 <span>division:</span>                 <xp:combobox id="combobox1" value="#{attachmentdoc.file_database}"                styleclass="cbuploaddatabase">                     <xp:selectitems>                         <xp:this.value><![cdata[#{javascript:var options = ["---"]; return options.concat(@unique(@dbcolumn("", "ecr database settings", 1)));}]]></xp:this.value>                     </xp:selectitems>                     <xp:eventhandler event="onchange" submit="true"                   refreshmode="partial"                   refreshid='#{javascript:var uploadtype = getcomponent("cbuploadtype").getvalue(); if(uploadtype == "financial analysis"){     return "panelfatype"; } return "panelextra"; }'>                      </xp:eventhandler>                  </xp:combobox>              </xp:panel>             <xp:panel id="panelextra">                 <!--                used redirect partial refresh of division                selection non-fa             -->             </xp:panel>             <xp:panel styleclass="upload-details-panel" id="panelfatype">                  <xp:this.rendered><![cdata[#{javascript:var uploadtype = getcomponent("cbuploadtype").getvalue(); if(uploadtype == "financial analysis"){     return true; } return false;}]]></xp:this.rendered>                 <span>financial analysis type:</span>                 <xp:combobox id="comboboxfatype" value="#{attachmentdoc.fatype}">                     <xp:selectitems>                         <xp:this.value><![cdata[#{javascript:var division = getcomponent("combobox1").getvalue(); if(division != null){     return getfatypeoptions(getcomponent("combobox1").getvalue()); } return "---";}]]></xp:this.value>                     </xp:selectitems>                 </xp:combobox>             </xp:panel>         </xp:panel>         <xp:panel styleclass="upload-details-panel">             <span></span>             <xp:button id="btnupload" value="upload" styleclass="btnupload"             style="height:26.0px">                 <xp:eventhandler event="onclick" submit="true"                refreshmode="complete" immediate="false" save="true">                     <xp:this.action><![cdata[#{javascript: var filedata:com.ibm.xsp.http.uploadedfile = facescontext.getexternalcontext().getrequest().getparametermap().get(getclientid('fileupload1'));  var db:notesdatabase = session.getcurrentdatabase();  var agent = database.getagent("import data document");  //var attdoc:notesdocument = attachmentdoc.getdocument(); //var doc:notesdocument = db.createdocument();  var doc:notesdocument = attachmentdoc.getdocument(); var settingsdoc:notesdocument = db.getprofiledocument("ecrfilesdbconfiguration", "");  var repositorypath:string;  if (filedata != null) {    //doc.replaceitemvalue('form', 'attachment');    doc.computewithform(true, false);      var clientfilename:string = filedata.getclientfilename();                var newfile:java.io.file = new java.io.file(filedata.getserverfilename());     var filepath:string = doc.getitemvaluestring("file_path");      doc.replaceitemvalue('file_name', clientfilename);      //   file extension         var extension:string = '';     var newfilename:string = '';     var i:int;     = clientfilename.lastindexof('.');    if (i > 0) {        extension = clientfilename.substring(i+1);    }       doc.replaceitemvalue('file_extension', extension);         newfilename = doc.getuniversalid() + '.' + extension;     //var savedfile:java.io.file = new java.io.file('c:\\' + newfilename);     //var savedfile:java.io.file = new java.io.file('c:\\' + clientfilename);      repositorypath = settingsdoc.getitemvaluestring("filerepositorypath")     var savedfile:java.io.file = new java.io.file(repositorypath + newfilename);      newfile.renameto(savedfile);      doc.replaceitemvalue("file_size", savedfile.length())     doc.replaceitemvalue("processed_ecr_template", "");      //   save new file     if (savedfile.exists()) {       // used retain icon/appearance of attachment       // in document             //doc.replaceitemvalue('attachment', attdoc.getitemvalue('attachment'));        doc.save();      } else {       //requestscope.errormessage = 'server file not found';       print('server file not found');     } } else {    requestscope.errormessage = 'no file found';    print('no file found'); }  // code prevents resubmit of uploaded file when user refreshes // page // var cururl = window.location.href; // var nsfurl = cururl.tolowercase().split( '.nsf')[0] + '.nsf';   // window.location.href = nsfurl}]]></xp:this.action>                     <xp:this.script><![cdata[//validate fields before submission  var uploadtype = document.getelementbyid("#{id:cbuploadtype}").value; if(uploadtype == "attachment"){     return true; }else{     var division = document.getelementbyid("#{id:combobox1}").value;     if(division == "---"){         alert("please specify division.");         return false;     }     if(uploadtype == "ecr master file"){         return true;     }else if(uploadtype == "financial analysis"){         var fatype = document.getelementbyid("#{id:comboboxfatype}").value;         if(fatype == "---"){             alert("please specify financial analysis type.");             return false;         }else{             return true;         }     } }  //if upload type not rcognized alert("upload type not recognized. please contact administrator."); return false;  ]]></xp:this.script>                 </xp:eventhandler>             </xp:button>          </xp:panel>         <xp:panel id="paneluploadedfiles">              <xp:viewpanel rows="30" id="viewpanel1" viewstyle="width:100%">                 <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="view1" viewname="attachments web"                   keys="#{javascript:@username()}" categoryfilter="file_owner">                     </xp:dominoview>                 </xp:this.data>                  <xp:viewcolumn columnname="file_name" id="viewcolumn2">                     <xp:viewcolumnheader value="file name"                   id="viewcolumnheader2">                     </xp:viewcolumnheader>                 </xp:viewcolumn>                 <xp:viewcolumn columnname="date_uploaded" id="viewcolumn3">                     <xp:viewcolumnheader value="date uploaded"                   id="viewcolumnheader3">                     </xp:viewcolumnheader>                 </xp:viewcolumn>                 <xp:viewcolumn columnname="last_attached" id="viewcolumn4">                     <xp:viewcolumnheader value="last attached"                   id="viewcolumnheader4">                     </xp:viewcolumnheader>                 </xp:viewcolumn>             </xp:viewpanel>         </xp:panel>     </xp:panel>     <xp:br></xp:br> </xp:view>  

the elements triggers partial refresh comboboxes (onchange). save button "upload" button. panel paneluploadedfiles contains view.

you need post sample code, there no way diagnose issue initial question.

i recommend take "xpages masterclass" training. 4 hours. show how use xpages toolbox, can use debug these kinds of issues.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -