You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Jochen Kemnade (JIRA)" <ji...@apache.org> on 2014/05/13 15:23:17 UTC

[jira] [Closed] (TAP5-740) Writeable property expressions accessing java.util.Map entries at final term (T4-style)

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

Jochen Kemnade closed TAP5-740.
-------------------------------

    Resolution: Not a Problem

Another year has passed since the last comment. Therefore, we assume this issue has either been resolved in the meantime or it is no longer relevant to you.
If recent versions of Tapestry (i.e. 5.4 betas and 5.3.7) are still affected, please reopen the issue and adjust the "Affected Version/s" property.

> 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 was sent by Atlassian JIRA
(v6.2#6252)