parse templates on demand

3 Messages Forum Options Options
Permalink
getagrip
parse templates on demand
Reply Threaded More
Print post
Permalink
Hi,
Is it possible to parse a template in a Page class so I could for
example assign the result to another String?
Something like this maybe:

String temp = getTemplate.parse()

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Click-user mailing list
Click-user@...
https://lists.sourceforge.net/lists/listinfo/click-user
sabob
Re: parse templates on demand
Reply Threaded More
Print post
Permalink
Maybe this?

public void onGet() {
   Map model = new HashMap();
   model.put("key1","value1");
   model.put("key2","value2");
   String result =
getContext().renderTemplate("/html/edit-customer.htm", model);
}


getagrip wrote:

> Hi,
> Is it possible to parse a template in a Page class so I could for
> example assign the result to another String?
> Something like this maybe:
>
> String temp = getTemplate.parse()
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Click-user mailing list
Click-user@...
https://lists.sourceforge.net/lists/listinfo/click-user
getagrip
Re: parse templates on demand
Reply Threaded More
Print post
Permalink
Ah, I was looking for such a method in the page class directly so thank
you again for putting me on the right path. Your framework rocks.


bob wrote:

> Maybe this?
>
> public void onGet() {
>    Map model = new HashMap();
>    model.put("key1","value1");
>    model.put("key2","value2");
>    String result =
> getContext().renderTemplate("/html/edit-customer.htm", model);
> }
>
>
> getagrip wrote:
>> Hi,
>> Is it possible to parse a template in a Page class so I could for
>> example assign the result to another String?
>> Something like this maybe:
>>
>> String temp = getTemplate.parse()
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Click-user mailing list
> Click-user@...
> https://lists.sourceforge.net/lists/listinfo/click-user

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Click-user mailing list
Click-user@...
https://lists.sourceforge.net/lists/listinfo/click-user