[ 
https://issues.apache.org/jira/browse/TAP5-740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ulrich Stärk updated TAP5-740:
------------------------------

    Labels: bulk-close-candidate  (was: )

This issue has been last updated more than 1.5 years ago, has no assignee, 
affects an old version of Tapestry that is not actively developed anymore, and 
is therefore prone to be bulk-closed in the near future.

If the issue still persists with the most recent development preview of 
Tapestry, please update it as soon as possible. In the case of a feature 
request, please discuss it with the Tapestry developer community on the 
d...@tapestry.apache.org mailing list first.
                
> Writeable property expressions accessing java.util.Map entries at final term 
> (T4-style)
> ---------------------------------------------------------------------------------------
>
>                 Key: TAP5-740
>                 URL: https://issues.apache.org/jira/browse/TAP5-740
>             Project: Tapestry 5
>          Issue Type: Wish
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Igor Lobanov
>              Labels: bulk-close-candidate
>
> Consider following situation. Say there is a page which displays list of 
> products in some category. User must be able to add several products to 
> shopping cart from this page with single operation. To accomplish this we 
> place a textfield near each product to allow user to input desired quantity, 
> and we place "Add to cart" submit button after the list.
> As "value" parameter of TextField is bidirectional, we need some writeable 
> location to read initial zero from and to store entered quantity when form is 
> submited. Thus we need to write boilerplate stub:
> public class ProductOrder {
>   public Product product;
>   public int quantity;
> }
> To be able to render and then process such a form, we need to create an 
> instance of ProductOrder for each Product in category and bind TextField 
> values to corresponding ProductOrder.quantity.
> In T4 days it could be accomplished a bit easier. We only needed to create 
> page property of type java.util.Map (initialized to empty map) and use 
> binding expression like "ognl:orderMap[product]". Then on page render all 
> textfields' values would be set to "0", because binding expression yields 
> null. On page rewinding OGNL created entries in orderMap for us automatically 
> and fills entered values in.
> While such approach definitely lacks OOP-ness, it suired well in situations 
> when there is no particular need in the "stub" class other than facilitate 
> form operations. It would be great to be able to use it in T5 with property 
> expressions.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to