Primefaces ab method

梦想与她 提交于 2019-12-24 06:41:11

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/18207246/primefaces-ab-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!