Primefaces ab法 [英] Primefaces ab method

查看:41
本文介绍了Primefaces ab法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的被一些代码搞糊涂了.我正在将一个巨大的 Scala 应用程序转换为 Java.这是一个网络应用程序,并使用 PrimeFaces 作为用户界面.然而,有一些事情让我感到不安.一个是这个代码片段:

我注意到对 ab 方法的调用.我一直在寻找文档几个小时,但似乎找不到任何东西.有谁知道 ab 方法是做什么的?

第二个问题是:任何人都可以深入了解这段代码的功能吗?我正在尝试确定调用了哪一部分 Scala 代码,但据我所知,这只是对 index.xhtml 页面的 AJAX 请求.>

编辑

 

认为就是生成提交按钮的标签.

解决方案

My"对 ab 方法的使用之一是更新 javascript 代码中的一些组件.有时 remoteCommand 不适合这种情况.

所以我必须在运行时使用 jQuery 选择器更新一些组件(复杂的不是按名称或类).

假设我想更新页面中的所有 p:lightBox 链接(为了清空 iFrame)

$('.ui-lightbox').each(function() {PrimeFaces.ab({source:'',update:$(this).attr('id').replace('_panel','')});}

希望有帮助.

I'm really getting confused by some code. I'm in the process of converting a giant Scala app over to Java. It's a web-app, and uses PrimeFaces for the User interface. However, there are a few things that are throwing me. One is this code snippet:

<td><button id="search:j_idt30" name="search:j_idt30" 
     class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
     onclick="PrimeFaces.ab({formId:'search',source:'search:j_idt30',process:'@all',update:'meetingIndices'});return false;" 
     type="submit"><span class="ui-button-text">Submit</span></button></td>

I've noticed a call to the ab method. I've been hunting for documentation for a few hours now, and I can't seem to find anything. Does anyone know what the ab method does?

The second question is: Can anyone give any insight into the function of this code? I'm trying to work out which bit of Scala code is called, but as far as I can tell it's just an AJAX request to the index.xhtml page.

Edit

  <p:commandButton type="submit"  value="Submit" update=":meetingIndices" />

I think that is the tag generating the submit button.

解决方案

One of "My" uses to ab method is to update some components inside javascript code. some times remoteCommand doesn't fit in the situation.

So I have to update some components at runtime using jQuery selectors (complicated ones not by name or class).

Let's say I want to update all the p:lightBox links in the page (in order to empty the iFrames)

$('.ui-lightbox').each(function() {
   PrimeFaces.ab({source:'',update:$(this).attr('id').replace('_panel','')});
 }

Hope it helps.

这篇关于Primefaces ab法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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