Using two p:ajax tags results in extra ajaxian requests

UI Components for JSF
Post Reply
bitec
Posts: 44
Joined: 20 Jan 2011, 21:34
Location: Russia

02 Nov 2011, 09:53

Hi.

I tried using two p:ajax constructions for select element, expected, that two action events will be fired in one request, but instead see two ajaxian requests sent. Actually this could be considered "the feature", but both actions are fired on EACH ajax request! So, the following construction:

Code: Select all

<h:selectOneMenu value="#{polis.osMatrixType}" id="registryType">
									<p:ajax listener="#{osagoPolisBean.drawModel}" update="osagoTable" process="osagoTable"  event="change"/>								
									<p:ajax listener="#{osagoPolisBean.rollOsagoEndDate}" update="osagoUsagePeriod osagoPeriod" process="osagoTable" event="change"/>								
								</h:selectOneMenu>		
results in calls to osagoPolisBean.drawModel and osagoPolisBean.rollOsagoEndDate on the first and second ajax request. This cannot be the feature at all :)

Sure, I can create the separate method, which would call both methods, but I though I could avoid creation of unnecessary backing bean methods in this case. IMHO it is ok to have several action sources for one component which would result in just one request.

Thanks
JSF: Mojarra 2.1 | PrimeFaces 2.2.1 | Glassfish 3.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 41 guests