Primefaces:是否有任何 get p:effect 对 Glassfish 起作用

发布于 2024-09-28 08:13:48 字数 723 浏览 0 评论 0原文

这是我的代码。当我单击链接 Comment 时,应该会出现 inputTextareacommandButton

    <h:outputLink id="link" value="javascript:void(0)">
            <h:outputText value="Comment"/>
            <p:effect type="fade" event="click" for="reply">
                <f:param name="mode" value="'show'"/>
            </p:effect>
        </h:outputLink>
        <h:panelGrid id="reply" style="display:none;">
            <h:inputTextarea id="keyword" rows="2" /> &nbsp;                
        </h:panelGrid>
    </h:outputLink>

当我单击链接时,似乎什么也没有发生,什么也没有出现。任何想法。我在 Glassfish 上运行这个。 primeface.org 的展示在 Tomcat 下运行。

Here is my code. When I click the link Comment, a inputTextarea and commandButton suppose to appear

    <h:outputLink id="link" value="javascript:void(0)">
            <h:outputText value="Comment"/>
            <p:effect type="fade" event="click" for="reply">
                <f:param name="mode" value="'show'"/>
            </p:effect>
        </h:outputLink>
        <h:panelGrid id="reply" style="display:none;">
            <h:inputTextarea id="keyword" rows="2" />                  
        </h:panelGrid>
    </h:outputLink>

When I click on the link, nothing seem to happen, nothing appear. Any idea. I run this on Glassfish. The showcase from primeface.org is running under Tomcat.

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

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

发布评论

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

评论(1

红ご颜醉 2024-10-05 08:13:48

有两个问题:

首先,根据 PrimeFaces 用户指南出现< /code> 效果不受支持。

以下是 PrimeFaces 支持的效果列表。

  • 盲目
  • 剪辑
  • 掉落
  • 爆炸
  • 折叠
  • 噗噗
  • 幻灯片
  • 规模
  • 弹跳
  • 突出显示
  • 脉动
  • 摇晃
  • 尺寸
  • 转移

因此将 p:effect 更改为:

<p:effect type="blind" event="click" for="reply">
    <f:param name="mode" value="'show'" />  
</p:effect>

其次,生成的链接源告诉以下内容:

<a href="javascript:void(0)">Comment<script type="text/javascript">
YAHOO.util.Event.addListener('j_idt6:j_idt7', 'click', function(e) {
  jQuery(PrimeFaces.escapeClientId('j_idt6:reply')).effect('blind',{mode:'show'},1000);
});</script></a>

客户端 ID j_idt6:j_idt7 没有出现在源代码中的任何地方。它必须是链接本身。因此,将 id 添加到 h:outputLink 应该可以修复它。看起来像是 PrimeFaces 中的一个错误。

There are two problems:

First, according to the PrimeFaces User Guide the appear effect is not supported.

Following is the list of effects supported by PrimeFaces.

  • blind
  • clip
  • drop
  • explode
  • fold
  • puff
  • slide
  • scale
  • bounce
  • highlight
  • pulsate
  • shake
  • size
  • transfer

So change the p:effect to:

<p:effect type="blind" event="click" for="reply">
    <f:param name="mode" value="'show'" />  
</p:effect>

Second, the generated source of the link tells the following:

<a href="javascript:void(0)">Comment<script type="text/javascript">
YAHOO.util.Event.addListener('j_idt6:j_idt7', 'click', function(e) {
  jQuery(PrimeFaces.escapeClientId('j_idt6:reply')).effect('blind',{mode:'show'},1000);
});</script></a>

The client ID j_idt6:j_idt7 doesn't appear anywhere in the source. It has to be the link itself. So adding an id to the h:outputLink should fix it. Look like a bug in PrimeFaces.

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