Yeah, that approach cleans up a lot enforcing the DRY principle rocks:)
Sam Hough wrote:
Thanks Nino,
Went with your original suggestion but down a layer in our application so
got rid of lots of similar code for introspection based CRUD type stuff
etc...
So can happily just do:
horizontalPanel.add(new Button("Click me"));
horizontalPanel.add(new HTML("Some text"));
horizontalPanel.add(new Button("Another button"));
Did wonder about making them smart enough to realise if they were meant to
use their own HTML or parent HTML but that seemed like it could get very
nasty. Even the brochure type parts of the site are getting more CSS and
less HTML heavy so maybe they will move over to this new style. Presumably
can optimise out the Panel wrapper if it starts to hurt performance. Just
need bookmarking/history and end to "page expired" and will all be rosy ;)
Cheers
Sam
Johan Compagner wrote:
If you want default html for those things use panels. Make for all
those components a panel part that has its own markup (so do that
once)
Then reuse those components everywhere.
Not that you gain much in my eyes because you still need to have a
span that places the panel at the right place
On 1/7/08, Sam Hough <[EMAIL PROTECTED]> wrote:
Nino.Martinez wrote:
Using markup inheritance:
one super class with a corresponding html and a sub class with
corrosponding html, extending the super class to the special need. And
maybe a mounted page that redirects to the wanted sub based on
parameters.
Dear Nino,
Can you do this for components that don't extend
http://wicketstuff.org/wicket13doc/org/apache/wicket/markup/html/WebMarkupContainerWithAssociatedMarkup.html
?
So say have an AjaxFallbackButton that you can just add to a Repeater? So
can have all the goodness of large swathe of HTML managed by the HTML
monkey
but still let me, Java monkey, add components (without specific HTML)? I
can
only see how I would do that by wrapping the Button in a Panel but that
seems like a lot of overhead and the object I would be returning would
look
like a Panel not a Button....
Re: "Why not just use Echo" - could be that 80% of app is perfect fit for
Wicket but 20% would be nicer if just had default HTML for Button, Link,
TextField etc...?
Cheers
Sam
--
View this message in context:
http://www.nabble.com/Is-it-possible-to-use-wicket-without-having-any-html-page--tp14607438p14668784.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
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]
--
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]