xpages - Does view.postscript() allow you to call functions loaded as output scripts? -


i using <xpscriptblock> store contents of 2 rather long client side functions loads extjs grid. can call function using clientside javascript fine.

i discovered need show different grid based on condition in underlining document. reference backend moved code serverside , tried call grid using view.postscript. not work , basis of question.

is approach possible? not wish put code event. functions quite long , better kept in script block readability , maintainability. functions loaded in client, can manually load them using firebug console. perhaps missing simple wanted ask before changing approach.

var typepo = document1.getitemvaluestring("typepo"); if(typepo == "afs"){     view.postscript("loadgridafs();") } else {     view.postscript("loadgridother();") } 

this code in serverside onclientload event of panel. have tried adding 'return' keyword , makes no difference.

update: can't simple alerts work using view.postscript(). method work in types of events in ssjs???

after experimenting using simple alert can view.postscript() not work everywhere.

for test, put same code in 6 event of xpage. here example of code used: view.postscript("alert('onclientload');"); changed message match event.

here results:

  1. onclientload = nothing
  2. beforepageload = xsp error
  3. afterpageload = works!
  4. afterrestoreview = nothing
  5. beforerenderresponse = works!
  6. afterrenderresponse = nothing

i haven't tried every available event out there, bottom line here shouldn't count on view.postscript() work everywhere. , if nothing, try simple alert first see of event supports view.postscript before questioning client javascript code attempting run.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -