Have you checked the wiki page on the View Layer?
https://cwiki.apache.org/WICKET/view-layer.html

In your original e-mail you showed the following Wicket component tree:

[Panel let's call it TogglePanel.java]
  - propertyValue (let's call it ReadOnlyPanel.java)
    - label
    - label

And I believe you wanted to "override" it with the following Wicket
component tree:

[Panel]
  - propertyValue (let's call it EditGroupPanel.java)
    - adminGroupTabs
      - adminGroupTabLink
        - label
    - adminGroupView
      - value

Obviously this is *not* an override, but a full replacement.
A true override would preserve the same Wicket component tree but replace
the HTML (ie: presentation layer) and your Java class would extend from the
class that's overriding and call super with not too much other work to do.

You got lucky because your panel in this case has a root component id of
"propertyValue".

Thus all you would have to do is use the addOrReplace() inside the
TogglePanel.java and toggle the panel that will be added:
if(isReadOnly) {
  addOrReplace(new ReadOnlyPanel("propertyValue"));
} else {
  addOrReplace(new EditGroupPanel("propertyValue"));
}

For the JavaDoc on addOrReplace see:
http://wicket.apache.org/apidocs/1.5/org/apache/wicket/MarkupContainer.html#
addOrReplace(org.apache.wicket.Component...)

~ Thank you,
  Paul Bors

-----Original Message-----
From: ramlael [mailto:[email protected]] 
Sent: Thursday, August 30, 2012 5:10 AM
To: [email protected]
Subject: Re: override wicket mark up

Hi Martin,

Once I call super(model) in extended class, its expecting markup
(wicket:ids) should be in same order.

Please can you provide sample code, how the replace or replaceWith will
work.

Regards,
Rambabu



--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/override-wicket-mark-up-tp4651624
p4651640.html
Sent from the Users forum 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]

Reply via email to