Re: T5 2 question about loop component parameters

2007-10-17 Thread Ivan Dubrov
Andreas Andreou wrote: > Not having to create getters & setters (or abstract getters in T4) just so > that @Loop (and @For) values and indexes can > become accessible is a fairly often request/question... > > Creating a custom binding prefix (perhaps named temp) that attaches objects > to the curre

Re: T5 2 question about loop component parameters

2007-10-14 Thread Andreas Andreou
Not having to create getters & setters (or abstract getters in T4) just so that @Loop (and @For) values and indexes can become accessible is a fairly often request/question... Creating a custom binding prefix (perhaps named temp) that attaches objects to the currect requestcycle and reads from the

Re: T5 2 question about loop component parameters

2007-10-14 Thread Howard Lewis Ship
You can define a variable as a field of your component class. However, it won't be visible without your providing a getter and setter. Example: ${user.name} Java code: public class MyPage { @Inject private UserDatabase _database; private User _user; public UserDatabase getDataba

Re: T5 2 question about loop component parameters

2007-10-14 Thread Mohammad Shamsi
hi Howard, i have no experience in Tapestry, i just test it for replacing my company framework. i use for 6 years struts, webworks and my own framework that based on both struts and webworks. in pages that made from JSP and JSTL , we can simply define a variable in page, this variable bind on

Re: T5 2 question about loop component parameters

2007-10-14 Thread Howard Lewis Ship
If we made the getIndex() and getValue() methods of Loop public, then you could: ${loop.currValue} But then you must define your loop in your Java class and expose it as a property: @Component private Loop _loop; public Loop getLoop() { return _loop; } how

Re: T5 2 question about loop component parameters

2007-10-14 Thread Nick Westgate
I can see what you mean, though it is quite common to use the index inside the page class too. T5 keeps things simple to cover the most common cases. You can create your own components if you don't like the default ones. It would be interesting to see an alternative if you write one. Cheers, Nic

Re: T5 2 question about loop component parameters

2007-10-14 Thread Ted Steen
java: private int currValue; public int getCurrValue() { return currValue; } public void setCurrValue(int currValue) { this.currValue = currValue; } template: ${currValue}

Re: T5 2 question about loop component parameters

2007-10-14 Thread Mohammad Shamsi
dear Nick, i want index just for iteration, i don't need it in may page class, i think that its better to define in Loop component class, suppose that i want to use Loop, 5 times in a singe page, then i most define 5 index value, and five item object ??? On 10/14/07, Nick Westgate <[EMAIL PROT

Re: T5 2 question about loop component parameters

2007-10-14 Thread Nick Westgate
The value and index have to go somewhere. Why not in your page class? Cheers, Nick. Mohammad Shamsi wrote: hi all, please take a look at my page bellow, ??? ${item.firstName} ${item.lastName} ${item.ph