Creating Global Array in in xPages using SSJS

≡放荡痞女 提交于 2020-01-05 07:22:27

问题


I have a custom control having a but submit and multiple SSJS libraries. I have require a global array initialized in in submit button and array values are populated from different libraries. I have declared and initialized an array button but its not available in libraries. Any clue how can I declare an array as global to make this available for all libraries? If not than how an array can be created using scope variables?

Please guide me . Thanks in advance

Best Regards,

Qaiser


回答1:


You could define it as a viewScope array - this question ... xPages repeat control with scoped variable as data source .. isn't directly about that, but shows how to define an array via viewscope.

essentially for a one-dimentional array, it would be:

viewScope.myArray=["1","2","3"];

You can define it in the event on thye xpage :

<xp:this.beforePageLoad>
  <![CDATA[#{javascript:viewScope.myArray = ["1","2","3"];}]]>
</xp:this.beforePageLoad>


来源:https://stackoverflow.com/questions/26929374/creating-global-array-in-in-xpages-using-ssjs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!