Wicket: How to create a re-usable footer component section? -
how create component (like footer section) , include on page?
i read stuff markup inheritance, doesnt sound right (how re-use footer section component in different pages when can inherit single page).
this 2nd day of using wicket , wicket-library.com has great examples, @ moment seems down when try view source.
thank you.
create basepage header, footer, menu etc. extend pages page. use this:
public class basepage extends webpage { public basepage() { add(new headerpanel("header"), new footerpanel("footer"), new menupanel ("menu" )); } }
with html:
<html xmlns:wicket> <body> <div wicket:id="header"> <div wicket:id="menu"> <wicket:child></wicket:child> <div wicket:id="footer"> </body> </html>
you need create headerpanel, footerpanel , menupanel.
your child page example:
public class mypage extends basepage { ...}
which has html:
<html xmlns:wicket> <body> <wicket:extend> </wicket:extend> </body> </html>
you can create no-menu basepage etc. components , html add child page placed between tags of basepage.
Comments
Post a Comment