Hi, answers below.
Gustavo Hexsel wrote:
Hi folks,
I'm evaluating Wicket as a replacement for some of our web code. I've checked
out Spring and found out that besides the learning curve being very high for
anything but trivial tasks, it didn't save as much coding as I expected...
So I've realized that some things that frameworks don't show you in tutorials
are usually the hard ones. I've been trying to find out how to do some things
in Wicket, but couldn't find anywhere in the docs or examples (I wonder if I
looked in the right places)
- what's the preferred way of nesting web pages? Like adding a default menu, a
header, etc. Would you <@page import> it?
Nope, with Wicket you would use Borders, Panels and - a feature that is
currently worked on - markup inheritance. What you probably want here is
a Border. In the border you define you menu, header, etc, and insert
that in your pages (like /around/ your body). If you want something like
'import', you would normally use panels. There is a special component in
Wicket 1.1 (head only currently), Include, that works much like JSP
include. This is /not/ the default Wicket way though, it is only there
in case people want to include non-wicket resources, like static html
headers/ footers that are served from different locations. And finally
markup inheritance is meant to be the more powerfull and easier to use
cousin of Border.
I've attached a very sloppy image that will hopefully make clear how the
border works (probably giving a good look at the example will help you
more though ;))
- how do you provide per-field feedback? The feedback-panel component just
accumulates all fields in a single component.
Check out FormComponentFeedbackBorder. It is used in the library
example. You use that to put something before or after (like an asterix)
your field. Another thing you can do is build an AttributeModifier that
sets the class when there is a message of a certain kind for that
component. I used to have that, but I'm afraid that code is lost now.
The latter is my favorite btw, though I think the asterix is what you
see more on the web.
- is there a way of forcing a filter before all pages (for instance, to check
if a login is present in the session) without having to edit all pages? Or
should I use a filter as in the Servlet API?
For validation, you can just override Page.checkAccess (look for any
example that requires you to log in). Other 'interception' methods are
not meant for normal use (there are some, but they are meant for
implementing advanced components like ListView), but you probably won't
need them. If you think you do, could you give the details of how/ why
you would want that?
Thanks a lot!
[]s Gus
You're elcome!
Eelco
__________________________________________________________________________
UOL Fone: Fale com o Brasil e o Mundo com até 90% de economia.
http://www.uol.com.br/fone
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
