使用view.PostScript从SSJS调用partialRefreshGet [英] call partialRefreshGet from SSJS using view.PostScript

查看:110
本文介绍了使用view.PostScript从SSJS调用partialRefreshGet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在BeforePageKoad事件中运行了一个SSJS。作为SSJS的最后一步,我想进行部分刷新。在我的脚本中,我有以下代码行:

I have a SSJS running in the BeforePageKoad event. As the last step of the SSJS I want to do a partial refresh. In my script I have this line of code:

view.postScript("partialRefreshGet('#{id:panelAll}')")

执行时,我收到一条错误消息,提示未定义partialRefreshGet。我猜想我错过了电话格式的内容,但是据我所知,这应该可行。
任何人以前都做过这样的事情。
如果我忽略此代码,则可以通过按钮手动刷新panelAll,一切正常。

When it executes I get an error that says partialRefreshGet is undeffined. I'm guessing I'm missing something in the format of the call, but as I understand it this should work. Anyone done something like this before. If I leave this code out then do a manual refresh of panelAll from a button everything works correctly.

推荐答案

您在beforePageLoad中不能在view.postScript之前使用。尝试将其移动到afterPageLoad或beforeRenderResponse。我最近遇到了同一问题。

You can't use before view.postScript in the beforePageLoad. Try moving it to afterPageLoad or beforeRenderResponse. I recently ran across the same issue.

http://notesspeak.blogspot.com/2013/08/viewpostscript-only-works-for-certain.html

此处是摘要可以在其中使用view.postScript()的地方:

Here is a summary where you can use view.postScript():


  1. onClientLoad =什么都不会发生

  2. beforePageLoad = XSP错误

  3. afterPageLoad =工作!

  4. afterRestoreView =什么都没有发生

  5. beforeRenderResponse =工作!

  6. afterRenderResponse =什么也没发生

  1. onClientLoad = nothing happens
  2. beforePageLoad = XSP error
  3. afterPageLoad = WORKS!
  4. afterRestoreView = nothing happens
  5. beforeRenderResponse = WORKS!
  6. afterRenderResponse = nothing happens

要知道为什么会这样,请阅读Tim Tripcony的评论,网址为博客文章的底部。

To know why this is happening, read Tim Tripcony's comment at the bottom of the blog post.

这篇关于使用view.PostScript从SSJS调用partialRefreshGet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆