Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define custom wicket tag

Tags:

wicket

I could not find a wicket tag like wicket:include? Can anyone suggest me anything? I want to include/inject raw source into html files? If there is no such utility, any suggestions to develop it?

update i am looking for sth like jsp:include. this inclusion is expected to be handled on the server side.

like image 832
mert inan Avatar asked May 17 '12 11:05

mert inan


2 Answers

To do this, you'll need to implement your own IComponentResolver.

This blog article shows an example somewhat resembling what you're after.

like image 56
Don Roby Avatar answered Jan 03 '23 14:01

Don Roby


Is it raw markup that you want to include, or Wicket content?

If it's raw markup, even a simple Label can do that for you. If you call setEscapeModelStrings( false), the string value of the model will be copied straight in the markup. (Watch out for potential XSS attacks though.)

"Including" Wicket markup is done via Panels (or occasionally Fragments)

Update: If you add more detail about the actual problem you need to solve, there's a good chance that we can find a more "wickety" solution, after all, JSP and Wicket are two different worlds and the mindset of one doesn't work very well in the other.

like image 44
biziclop Avatar answered Jan 03 '23 15:01

biziclop