The templating function is deliberately kept simple. If you want it's
pretty easy to create your own template thingies using e.g. Velocity
or Freemarker. But in this case, it's probably sufficient to just
concatenate the list yourself and do substitution of one variable
placeholder. Thus: in your Java code you do the loop and create the
'message' part:
messages.append("first feedback\n'").append("second feedback\n");
or something smarter, and then replace ${messages}
function showFeedback() {
var '${messages}';
alert(message);
}
Eelco
On 5/9/06, Ittay Dror <[EMAIL PROTECTED]> wrote:
ok, i got most of it.
last question: can the template have a way to loop on a list? if not, then how
do you suggest i templatize the messages, so their formatting is kept in the js
file?
thanx,
ittay
Ittay Dror wrote:
>
>
> Eelco Hillenius wrote:
>> Or take a look at what's in wicket.extensions.util.resource and look
>> at the Slider component in YUI for an example. I think it's cleaner
>> like that (keep the javascript in seperate files and run some variable
>> substitution over it).
>
> what do you mean by 'variable substitution'? how can i do that?
>
>>
>> Eelco
>>
>> On 5/9/06, Ittay Dror <[EMAIL PROTECTED]> wrote:
>>> hi,
>>>
>>> i have a feedback based on javascript. basically, i want to populate
>>> a javascript function's body with all messages, so it will show them
>>> one by one.
>>>
>>> the final result will be like:
>>> function showFeedback() {
>>> var message;
>>> message += "first feedback\n";
>>> message += "second feedback\n";
>>>
>>> alert(message);
>>> }
>>>
>>> theoretically, in wicket, create a panel with something like:
>>> function showFeedback() {
>>> var message;
>>> <span wicket:id="feedback">
>>> message += "<span wicket:id="message"></span>
>>> </span>
>>> alert(message);
>>> }
>>>
>>> but, will the parser handle this? will the 'span' tags be replaced? i
>>> thing that at least the 'message' span will not, since it uses Label,
>>> which replaces the body, not the tag.
>>>
>>> how can i do this?
>>>
>>> --
>>> ===================================
>>> Ittay Dror
>>> Chief architect, openQRM TL,
>>> R&D, Qlusters Inc.
>>> [EMAIL PROTECTED]
>>> +972-3-6081994 Fax: +972-3-6081841
>>>
>>> http://www.openQRM.org
>>> - Keeps your Data-Center Up and Running
>>>
>>>
>>> -------------------------------------------------------
>>> Using Tomcat but need to do more? Need to support web services,
>>> security?
>>> Get stuff done quickly with pre-integrated technology to make your
>>> job easier
>>> Download IBM WebSphere Application Server v.1.0.1 based on Apache
>>> Geronimo
>>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>> _______________________________________________
>>> Wicket-user mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>>
>>
>>
>> -------------------------------------------------------
>> Using Tomcat but need to do more? Need to support web services, security?
>> Get stuff done quickly with pre-integrated technology to make your job
>> easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache
>> Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642
>> _______________________________________________
>> Wicket-user mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>
>
>
--
===================================
Ittay Dror
Chief architect, openQRM TL,
R&D, Qlusters Inc.
[EMAIL PROTECTED]
+972-3-6081994 Fax: +972-3-6081841
http://www.openQRM.org
- Keeps your Data-Center Up and Running
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user