UIComponents are free to call their value bindings as many times as
they want, so you should make sure you cache that data pre-request if
you are constructing data in a get method (like select items, maps,
etc).
In your case, it is being called twice because of the two phases it is
needed. (1) During validation to ensure the value the user submit is a
valid value (contained in a value of one of the select items) and (2)
when re-rendering during an encodeXxx method.
You can use the requestMap from the external context to cache data for
the request that will be left for the GC after the request is
completed.
On 5/4/07, bansi <[EMAIL PROTECTED]> wrote:
Here is the situation
I have the following dropdown defined with ajax4jsf event onchange
Code:
<h:panelGrid columns="3" styleClass="detail" columnClasses="label">
<h:outputText value="Manufacturer" />
<h:selectOneMenu id="manufList"
value="#{manufacturerBean.selectedManufacturer}" >
<f:selectItem itemLabel="New" itemValue="New" />
<f:selectItems value="#{manufacturerBean.manufacturerList}" />
<a4j:support
action="#{manufacturerBean.loadManufacturerDetails}" event="onchange"
reRender="manufName,manufDescription,manufSource,btnSave,btnDelete" />
</h:selectOneMenu>
</h:panelGrid>
The perfomance issue is
Whenever i pick a different value from the dropdown, i expect only ajax4jsf
action method is called i.e.
<a4j:support action="#{manufacturerBean.loadManufacturerDetails}"
event="onchange"
reRender="manufName,manufDescription,manufSource,btnSave,btnDelete" />
BUT why is the method defined in f:selectItems is getting called
twice as seen in log file
<f:selectItems value="#{manufacturerBean.manufacturerList}" />
Logs:
2007-05-04 14:16:31,694 INFO
[com.boeing.nmt.nams.view.bean.ManufacturerBean] - < *** In
getManufacturerList Backing Bean*** >
Any pointers/suggestions will be highly appreciated
Regards
Bansi
--
View this message in context:
http://www.nabble.com/Perfomance-Issues-with-JSF-dropdown-tf3694314.html#a10330594
Sent from the MyFaces - Users mailing list archive at Nabble.com.