myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Delbecq <delbd+jaka...@oma.be>
Subject Re: Caching JSF Dropdown Results
Date Wed, 23 May 2007 20:27:54 GMT
You need a void setManufacturerList(List l) so saveState can restore the
state.

bansi a écrit :
> Thanks Andrew. As suggested i have placed the snippet right above <h:form>
> <f:view>
>   <t:saveState id="save1"  value="#{manufacturerBean.manufacturerList}" /> 
>   <h:form id="manufacturerForm">
>
> It results in following exception
> javax.faces.el.PropertyNotFoundException: /manufacturerForm.xhtml @23,75
> value="#{manufacturerBean.manufacturerList}": Bean:
> com.boeing.nmt.nams.view.bean.ManufacturerBean, property: manufacturerList
> (no write method for property!)
>
> I didnt understood what does it mean by "no write method for property!" . I
> do have getManufacturerList in backing bean
>
> Regards
> Bansi
>
>
>
> Andrew Robinson-5 wrote:
>   
>> How about <t:saveState value="#{manufacturerBean.manufacturerList}"
>> />? If you are using a4j:region, you will need to make sure the save
>> state tag in in the region (BTW - I haven't tested this).
>>
>> On 5/23/07, bansi <mail2bansi@yahoo.com> wrote:
>>     
>>> I have  following dropdown
>>>
>>> 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  value from the dropdown it
>>> results in 3 datbase calls
>>> Here is the sequence of method calls
>>> - First time the method in f:selectItems gets called which results in a
>>> database call
>>> <f:selectItems value="#{manufacturerBean.manufacturerList}" />
>>> - Second time as expected/desired Ajax4JSF onchange event action method
>>> gets
>>> called
>>> <a4j:support action="#{manufacturerBean.loadManufacturerDetails}"
>>> event="onchange"
>>> reRender="manufName,manufDescription,manufSource,btnSave,btnDelete" />
>>> - Third time again the method in f:selectItems gets called which results
>>> in
>>> a database call
>>> <f:selectItems value="#{manufacturerBean.manufacturerList}" />
>>>
>>> I understand its due to JSF Lifcycle.
>>>
>>>
>>> Any pointers/suggestion on how to Cache the method getManufacturerList()
>>> to
>>> avoid unnecessary database calls will be highly appreciated
>>>
>>> Regards
>>> Bansi
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Caching-JSF-Dropdown-Results-tf3805830.html#a10770409
>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>>
>>>
>>>       
>>     
>
>   


Mime
View raw message