I implemented some page action on one of my view..it appears that when i load or access the page/view.. the method on my component get executed every time..IS this normal behavior in seam or i am missing something...
我在我的一个视图上实现了一些页面操作..当我加载或访问页面/视图时,看起来我的组件上的方法每次都被执行..我在缝中的这种正常行为或者我遗漏了一些东西.. 。
I already solved my problem..What i am trying to accomplish is a initial request when a page is requested either by typing the page URL of the page in the address bar or from a result of a bookmark. In SEAM it is achieved via they call page action.You declare page action in component descriptor or the component.xml...
我已经解决了我的问题。我想要完成的是当通过在地址栏中键入页面的页面URL或从书签结果请求页面时的初始请求。在SEAM中,它通过调用页面操作来实现。您在组件描述符或component.xml中声明页面操作...
<page view-id="/list.xhtml">
<action execute="#{conpoentName.componentMethod}" on-postback="false"/>
If the attribute on-postback is not stated..what happen is a continues call to component method when i tried to access the page..it's like having a infinite call..
如果没有声明on-postback属性..当我试图访问页面时,会发生什么事情继续调用组件方法...就像有一个无限的调用...
Anybody knows what is happening in the background?..Its seams related to postback..
有人知道后台发生了什么吗?它的接缝与回发相关..
1 个解决方案
#1
0
Yes it is normal behavior. Take a look at Seam FAQ JSF Postback You want to perform an action when a page is initially loaded, if you don't want that action executed on repeated access you use the Postback attribute, or put some logic in the execute method to prevent it.
是的,这是正常行为。看一下Seam FAQ JSF Postback你想在最初加载页面时执行一个动作,如果你不希望在重复访问时执行该动作你使用Postback属性,或者在execute方法中放入一些逻辑来防止它。
#1
0
Yes it is normal behavior. Take a look at Seam FAQ JSF Postback You want to perform an action when a page is initially loaded, if you don't want that action executed on repeated access you use the Postback attribute, or put some logic in the execute method to prevent it.
是的,这是正常行为。看一下Seam FAQ JSF Postback你想在最初加载页面时执行一个动作,如果你不希望在重复访问时执行该动作你使用Postback属性,或者在execute方法中放入一些逻辑来防止它。