|
Hello Ean,
That was a great metaphor that you used. In fact, my inspiration to continue battling seemingly impossible tasks has been a car design & execution effort - Tata Nano - world's cheapest(!) car - http://www.counterjumper.com/2008/01/11/tata-nano-making-the-impossible-possible/.
|
|
In reply to this post by Vasanth Kamatgi
On Tue, 2009-12-22 at 18:40 -0800, Vasanth Kamatgi wrote:
> ..... > But, I would see some merit in continuing > the discussion to find the silver bullet for decoupling at rendering stage. > :) it is called proof of concept....? -- Antwebsystems.com: Quality OFBiz services for competitive rates |
|
In reply to this post by Ean Schuessler
Apologies if I have been rather insensitive to the your exogitation. I was certainly not implying that we use Wicket. I am neither an expert in Wicket nor a champion of Ofbiz. I am merely elucidating the thoughts on the problems that I faced while having a whole team work on Ofbiz. I like Ofbiz and am sold out on it. I know that I have to work more, to convince the community of the change I am proposing and I am planning to do that in the next few weeks. I am planning to follow the HEMP approach as suggested by David, starting next week and share with the community, what I arrive at.
|
|
In reply to this post by Ean Schuessler
Hi Ean,
Below is the modification of the example you have given as per what I propose. Groovy: def user = dispatcher.runSync("getSpecialUser", []) context.userDetails = { user }; FTL: <table> <#if(userDetails != null)> <tr> <td> <span class="firstname">$user.firstName</span> <span class="lastname">$user.lastName</span> </td> </tr> <else> <tr> <td> <span class="notperson">User doesn't exists</span> </td> </tr> <#if> </table> - Abdullah On Wed, Dec 23, 2009 at 2:24 AM, Ean Schuessler <[hidden email]> wrote: > Abdullah Shaikh wrote: > >> "If your groovy compile some information, do findList, getRelated ... , if >> you deploy for a customer a screen that don't use all information, you >> generate unnecessary work to your database." >> >> But in groovy you will need to get only that data from database which will >> be required for the FTL page >> >> It's like if an existing FTL gets "xyz" data from database, using this >> approach it will be like, groovy get "xyz" data from the database and >> putting it inside the context, FTL will get this data from the context. >> > If you use closures then the calls will only occur when they are used... > > Groovy: > > context.userDetails = { > def user = dispatcher.runSync("getSpecialUser", []) > if (user.entityName == "Person") return """ > <tr> > <td> > <span class="firstname">$user.firstName</span> > <span class="lastname">$user.lastName</span> > is definitely a person. > </td> > </tr> > """ else return """ > <tr> > <td> > <span class="notperson">User is not a person.</span> > </td> > </tr> > """ > } > > FTL: > > <table> > $userDetails.call() > </table> > > This way the work of generating the user details is never done unless the > FTL pulls them in. This approach is useful for all kinds of formatting > chores. > |
| Free forum by Nabble | Edit this page |
