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:
- onclientload = nothing
- beforepageload = xsp error
- afterpageload = works!
- afterrestoreview = nothing
- beforerenderresponse = works!
- 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
Post a Comment