myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Winer (JIRA)" <>
Subject [jira] Commented: (MYFACES-192) inputParam component
Date Fri, 19 Aug 2005 04:43:55 GMT
    [ ] 

Adam Winer commented on MYFACES-192:

A quick note:  this proposal was brought to the JSF EG, and was declined.  The alternative
- which will be available in JSF 1.2 - is an <f:setPropertyActionListener> that performs
an EL set.

This is a better choice because:
- It can be attached to an individual command instead of an entire form - thus avoiding the
hacky need to create a whole new form just to have different parameters.
- It doesn't subvert the component contract by having a UIInput with bonus behavior encapsulated
in a Renderer
- It's what the JSF spec will do

Hence, an EG recommendation against adopting this, and an overall suggestion to consider customized,
reusable listeners instead of extending component behavior.

> inputParam component
> --------------------
>          Key: MYFACES-192
>          URL:
>      Project: MyFaces
>         Type: New Feature
>     Versions: 1.0.9 beta
>  Environment: All
>     Reporter: Rob Decker
>  Attachments: inputParam.tar.gz
> inputParam extends inputHidden by adding an attribute, paramValue, which allows value
binding predefined form values to a managed bean. For example, if you have a managed bean
named searchBean with a setLastModified(Date d) method you can create a hidden form element
with a preset date:
> <h:form> 
> <h:commandLink action="">
>  <x:inputParam value="#{searchBean.lastModified}" paramValue="04/05/2005">
>    <f:convertDateTime type="date" dateStyle="short"/>  
>  </x:inputParam>
> </h:commandLink>
> </h:form>
> renders:
>  <input type="hidden" value="04/05/2005"/>
> When the form is submitted searchBean.setLastModified is called with the Date object.
When the link is clicked there is no need to look in the request for the parameters of the
search. There is no need to modify the bean if a different search is required. Just create
a new form/commandLink and specify the new parameters. I used it to create quick searches:
New in last Day/Week/Month using the same bean for a full fledged form that let's the user
specify the dates without having to modify the bean or tie it to faces/request to populate
> The attached archive contains the component package and the required xml fragments for
the tld and faces-config. 

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message