为什么每当 a4j:commandLink 中存在渲染属性时,不会调用操作属性?

发布于 2024-12-17 03:35:10 字数 562 浏览 3 评论 0原文

我在 a4j:commandLink 上遇到问题,我有条件地使用渲染来渲染我的链接 属性但不幸的是操作方法没有调用?

我做了一些发现,发现仅使用请求范围 bean 进行条件渲染时,action 属性存在问题。 解决方案是使 bean 会话具有作用域。 我将我的 bean 纳入了会话范围,但仍然不走运。

<a4j:commandLink rendered="#{someBean.enable}" action="#{someBean.doThis}" />

这是我的豆子:

@Name("someBean")
@Scope(ScopeType.Session)
public class SomeBean{

private boolean enable;

    public void doThis(){
        //not called here
    }

    //getters setters
}

我错过了什么吗?

我正在使用 jsf2、richfaces 和 seam。

提前致谢。

I have a problem on a4j:commandLink, i conditionally rendering my link using rendered
attribute but unfortunately the action method is not invoke?

I made some findings and found out that there are problems in action attribute when conditionally rendering using just request scope bean.
The solution is to make the bean sessions scope.
I made my bean into session scope but still out of luck.

<a4j:commandLink rendered="#{someBean.enable}" action="#{someBean.doThis}" />

Here is my bean:

@Name("someBean")
@Scope(ScopeType.Session)
public class SomeBean{

private boolean enable;

    public void doThis(){
        //not called here
    }

    //getters setters
}

Am i missing something?

I am using jsf2, richfaces and seam.

Thanks in advanced.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑红尘 2024-12-24 03:35:10

您没有提到您正在使用的 richfaces 或接缝的版本,但似乎是 richfaces 的版本 3.3
如果是这样,请使用 ajaxSingle="true" 属性。

You haven't mentioned the version of richfaces or seam you're using but seems it is version 3.3 for richfaces
if so, use ajaxSingle="true" attribute.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文