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

Toby updated TAP5-420:
----------------------

    Description: 
Currently the @Loop component for dynamic input field generation only works if 
the data is saved back into the source data list.

But if the source contains a list of "configurations" read from a database, the 
generated input fields are unrelated to the "source" objects.

So there is missing a solution to read the values back in other scenarios.

Example:

<t:loop source="configObjects" value="configObject" encoder="encoder">
...
 <t:select model="valueSelectModel" encoder="valueSelectModel" 
value="genericItem"/>
...
</t:loop>


public GenericSelectModel<Value> getValueSelectModel() {
                Category category = configObject.getCategory(); // for every 
Select model in the loop, different values are shown, depending on the context
                List<Value> list = getValues(category);
                GenericSelectModel<Value> model = new 
GenericSelectModel<Value>(list, Value.class, "name", "id", _access);
                return model;
}

However encoder only refers to the mapping between the source/value and the 
values shown in the select model are only derived from the "value" but
can not be stored back there.....

So what about:


<t:loop source="configObjects" value="configObject"  data="objectList"> or 
something...so that you could
iterate over a list with the submitted data somehow...... ?



  was:
Currently the @Loop component for dynamic input field generation only works if 
the data is saved back into the source data list.

But if the source contains a list of "configurations" read from a database, the 
generated input fields are unrelated to the "source" objects.

So there is missing a solution to read the values back in other scenarios.

Example:

<t:loop source="configObjects" value="configObjects" encoder="encoder">
..
</t:loop>


public GenericSelectModel<Value> getValueSelectModel() {
                Category category = configObject.getCategory(); // for every 
Select model in the loop, different values are shown, depending on the context
                List<Value> list = getValues(category);
                GenericSelectModel<Value> model = new 
GenericSelectModel<Value>(list, Value.class, "name", "id", _access);
                return model;
}

However encoder only refers to the mapping between the source/value and the 
values shown in the select model are only derived from the "value" but
can not be stored back there.....


> Dynamic input fields generation using the @Loop component
> ---------------------------------------------------------
>
>                 Key: TAP5-420
>                 URL: https://issues.apache.org/jira/browse/TAP5-420
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.17
>            Reporter: Toby
>
> Currently the @Loop component for dynamic input field generation only works 
> if the data is saved back into the source data list.
> But if the source contains a list of "configurations" read from a database, 
> the generated input fields are unrelated to the "source" objects.
> So there is missing a solution to read the values back in other scenarios.
> Example:
> <t:loop source="configObjects" value="configObject" encoder="encoder">
> ...
>  <t:select model="valueSelectModel" encoder="valueSelectModel" 
> value="genericItem"/>
> ...
> </t:loop>
> public GenericSelectModel<Value> getValueSelectModel() {
>               Category category = configObject.getCategory(); // for every 
> Select model in the loop, different values are shown, depending on the context
>               List<Value> list = getValues(category);
>               GenericSelectModel<Value> model = new 
> GenericSelectModel<Value>(list, Value.class, "name", "id", _access);
>               return model;
> }
> However encoder only refers to the mapping between the source/value and the 
> values shown in the select model are only derived from the "value" but
> can not be stored back there.....
> So what about:
> <t:loop source="configObjects" value="configObject"  data="objectList"> or 
> something...so that you could
> iterate over a list with the submitted data somehow...... ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to