1

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.

christopher
  • 26,815
  • 5
  • 55
  • 89
  • You have to refer to the XHTML code that generated that HTML code. The PF javascript framework is not documented for the general user, as there should be no need to use it directly. – Mindwin Remember Monica Aug 13 '13 at 11:25
  • Also, that seems to be a submit commandButton for a search form on a schedule app. DO you have access to the sources of that app, or are you trying to reverse-engineer it from the HTML code? If you have more code, show it. – Mindwin Remember Monica Aug 13 '13 at 11:26
  • I have the full source; I just dont have a clue which bit of code is getting called by this snippet, when the button is clicked. – christopher Aug 13 '13 at 11:35
  • If you have the source, show the that is creating that button tag. Assuming you have the XHTML or procedural code that is generating that html view. – Mindwin Remember Monica Aug 13 '13 at 12:32
  • @Mindwin Edited in the tag. – christopher Aug 13 '13 at 12:37

1 Answers1

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.

Hatem Alimam
  • 9,968
  • 4
  • 44
  • 56