Yes. In 1.1., it would be possible to define a common header in e.g. a
Border. For 1.0 however, if you don't want the header duplication, you
could insert a panel that serves as a common header. This is what the
example do by extending the WicketExamplePage, and inserting:
<body>
<span wicket:id="mainNavigation"/>
in each page.
Note however, that the more you use borders and panels - which in itself
is good as it avoids code duplication - the readable/ previewable your
pages will be. Though for previewability the <wicket:remove> tag and the
ability to put markup outside your <wicket:panel> and <wicket:border>
come in handy.
Eelco
Kruger Jan-Petter wrote:
Ok, so instead of the first html template I now got a "main page" like
this with a Border/body construct.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="stylesheet" type="text/css" href="style/app.css"
title="style" />
<title><span wicket:id="appTitle"/>App - Prototype
(v0.1)</title>
<script src="script/menuExpandable.js" type="text/javascript"
language="Javascript"></script>
<script src="script/option.js" type="text/javascript"
language="Javascript"></script>
<script type="text/javascript">
<!--
window.onload = function() {
initializeMenus();
}
//-->
</script>
</head>
<body>
<wicket:border>
<!-- Layout container starts -->
<div id="layoutBox">
<span wicket:id="headerBoxPanel"/>
<span wicket:id="welcomeBoxPanel"/>
<span wicket:id="menuBoxPanel"/>
<span wicket:id="loginBoxPanel"/>
<!-- MAIN: Put page contents inside the main div -->
<span wicket:id = "mainBorder">
<wicket:body/>
</span>
<!-- MAIN: container ends -->
</div>
<!-- Layout container ends -->
</wicket:border>
</body>
</html>
With my own subclass of wicket.markup.html.border.Border since I don't
want the box from BoxBorder.
This gives me individual pages like
<html xmlns:wicket="http://wicket.sourceforge.net/">
<head>
<link rel="stylesheet" type="text/css" href="style/app.css"
title="style" />
<title><span wicket:id="appTitle"/>App - Prototype
(v0.1)</title>
<script src="script/menuExpandable.js" type="text/javascript"
language="Javascript"></script>
<script src="script/option.js" type="text/javascript"
language="Javascript"></script>
<script type="text/javascript">
<!--
window.onload = function() {
initializeMenus();
}
//-->
</script>
</head>
<body>
<span wicket:id = "mainBorder">
<div id="main">
... Some content here .....
</div>
</span>
</body>
</html>
This leaves one more thing that I would like to remove from the
individual pages, the header part. I have to include the <head> things
in each page to get the stylesheet and java scripts right, even though
they are already included in the "Main" page. Is there any way to get
wicket to ignore <head> data in the individual pages , and use the
"main" page head data instead ? Or is this what you described as 1.1
functionality Juergen ?
Jan-Petter ::-Q
-----Original Message-----
From: Kruger Jan-Petter
Sent: 2. juni 2005 10:38
To: [email protected]
Subject: RE: [Wicket-user] Need suggestions for structuring pages in a
webapp
Ahh, missed that one in the samples. Seems to be what I'm looking for.
Thanks !
Jan-Petter ::-Q
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Eelco
Hillenius
Sent: 2. juni 2005 10:26
To: [email protected]
Subject: Re: [Wicket-user] Need suggestions for structuring pages in a
webapp
Use a wicket.markup.html.border.Border
(http://wicket.sourceforge.net/apidocs/wicket/markup/html/border/Border.
html)
to define common layout etc.
See the library and navomatic examples. That examples are simple, but
hopefully give you enough pointers to go on.
Please let us know when you still are not sure how to go on.
Eelco
Kruger Jan-Petter wrote:
I need some hints or pointers on some aspects of developing web
applications with wicket. I really hate those HelloWorld applications
that does nothing in the direction of giving any clues regarding
"real" applications. I usually end up with more questions than answers
after going through those apps.
Lets say I have a potential web application, 40-50 pages or so in
total. Readyly prototyped, layed out with CSS and ready to be put into
an application. I have been looking into how to structure this using
wicket. I have ended up with a page template like
<html>
<head>
<link rel="stylesheet" type="text/css" href="style/app.css"
title="style" />
<title><span wicket:id="appTitle"/>App - Prototype
(v0.1)</title> </head> <body>
<!-- Layout container starts -->
<div id="layoutBox">
<span wicket:id="headerBoxPanel"/>
<span wicket:id="welcomeBoxPanel"/>
<span wicket:id="menuBoxPanel"/>
<span wicket:id="loginBoxPanel"/>
<!-- MAIN: Put page contents inside the main div -->
<div id="main">
</div>
<!-- MAIN: container ends -->
</div>
<!-- Layout container ends -->
</body>
</html>
So, this template have to be copied 40-50 times, entering different
information in the main container for the different pages. Is there
any way with wicket to have one html template thats reused through out
pages in the application ? That way I could change the layout of the
application in just one place. Maybe I could go for using panels
instead of pages? That way I would put a wicket id in the main page
for the content, always loading the main page , but inserting
different panels for the different pages. Anyone have any experiences
yet, using wicket for more than HelloWorld applications that have any
thoughts on this ? What I'm looking for is maintainability in webapps
with more than a few pages.
Regards,
Jan-Petter ::-Q
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user