Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

binding map in tapestry 5

in my action class i want to have a map of strings. and in my tml i want to access this map with textfield. something like

<t:form>
    <t:textfield value="myMap['key1']"/>
    <t:textfield value="myMap['key2']"/>
...

i don't insist on syntax, but is there anything like this currently in tapestry? if not, what do i need to create such conversion in the most easy way? type coercing? custom components? i'm starting to learn tapestry so feel free to be verbose :)

like image 381
piotrek Avatar asked Mar 28 '26 19:03

piotrek


1 Answers

Another option is to bind your own tml prefix. There is an example of binding prefixes here.

We wrote our own prefix for map which allows us to get the value in the tml like this:

${map:myMap.key1}
like image 93
Nick Avatar answered Apr 02 '26 12:04

Nick



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!