On 11/27/2011 03:40 PM, Em wrote:
Hi Andrea,
thanks for sharing your information!
My answers are in the content.
Am 27.11.2011 14:52, schrieb Andrea Del Bene:
I already saw this Wiki-page yesterday.
Well, the point is, that I want to include the markup *in* the markup
(i.e. output it in some panel inside of a script-tag so that JavaScript
is able to get the markup).
So *while* you are rendering, you want to know the schema Wicket is
rendering on to include it in some places before outputting.
you should have a look to method Component.renderHead(IHeaderResponse
response). If you override it you can write an arbitrary string to the
header section. For example you could do something like:
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.renderJavaScript(myUserView.getMarkup().toString(true),
"markupUser");
}
This will put the markup of myUserView inside a script tag with
id="markupUser".
Without the Wicket-specific tags? Sounds great!
Yes, you should be able to strip out Wicket tags. For example the
output for a simple form with 2 text field is:
<script type="text/javascript" id="markupJavaScript">
/*<![CDATA[*/
<form action="" wicket:id="form">
Name <input wicket:id="name"/>
Surname <input wicket:id="surname"/>
</form>
/*]]>*/
</script>
I saw that Velocity integration is possible with Wicket and as far as I
saw there are no problems or drawbacks with it - can you confirm that?
Have you seen this example
http://wicket.apache.org/learn/projects/velocity.html ? Maybe it could
help you.
I saw exactly this page but thought about whether there may be some
drawbacks (in terms of performance, security or something else) with
this approach.
Regards,
Em
Unfortunately I didn't have the chance to work with Velocity, so I can't
tell anything about possible drawbacks. But I think you won't find big
issues with it.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]