Lately I've just turned to the client side because of things like this.  For 
example, to get around the aforementioned warning, one might always keep 
@rendered set to true for the inputText element, but set it's style to 
"display:none" .  Then, use js to programmitcally change this and avoid the 
round trip altogether.

Dennis Byrne

>-----Original Message-----
>From: Rogers Reilly [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, February 28, 2006 11:01 PM
>To: 'MyFaces Discussion'
>Subject: Re: immediate action for non commands
>
>Best way to do this now is with Cherokee (or whatever it's called).
><af:selectOneListbox> takes an "autoSubmit" attribute, which does
>exactly what you want.
>
>I was thinking you could also set "partialSubmit=true" and do your
>refresh with PPR, which would be slick, but I'm not seeing that
>attribute in the docs.  Looks like autoSubmit mandates a full refresh.
>:-(
>
>Dennis Byrne wrote:
>
>>The kludge you speak of is the most popular way to do this.
>>
>>One warning.  Let's say you have two controls, selectOneMenu and inputText.  
>>Your requirement is that the inputText is to be rendered *only* when a 
>>certain item (let's call it 'ITEM X') in the selectOneMenu is selected.  You 
>>accomplish this by hooking a js event hander into @onclick or @onchange of 
>>the selectOneMenu.  The js clicks a hidden commandButton and the form is 
>>submitted.  In the action or actionListener of the commandButton, you 
>>dynamically render the inputText element and the form is then rerendered.
>>
>>If the user clicks then back button, on both IE and FireFox at least, the 
>>browser will not go back to the server.  It will simple display the first 
>>page in the state it was in just *before* the form was submitted.  There are 
>>two important parts to keep in mind.  First, the selected item of the 
>>selectOneMenu was 'ITEM X'.  Second, the inputText field was *not* rendered 
>>when the form was submitted.  The user will have then effectivly placed the 
>>form into a state that is against the initial requirement.
>>
>>Dennis Byrne
>>
>>
>>
>>>-----Original Message-----
>>>From: Lance Frohman [mailto:[EMAIL PROTECTED]
>>>Sent: Tuesday, February 28, 2006 08:57 PM
>>>To: ''MyFaces Discussion''
>>>Subject: immediate action for non commands
>>>
>>>What is the "best practice" if I need a drop down list -
>>><h:selectOneListbox> - change
>>>to go to the server, as if there was an immediate="true" on a command
>>>button.
>>>Depending on what is selected in the <h:selectOneListbox>, the page will be
>>>displayed differently.
>>>I was using a kludge with onclick="" submitting a <h:commandButton
>>>style="visibility:hidden;" ...>
>>>
>>>Thanks,
>>>Lance
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>>
>>
>
>


Reply via email to