You have some options: Write one abstract panel with the complex markup and extend the read-only and editable panels from that class (wicket:child and wicket:extend).
Or, create a panel with the complex markup and create two separate panels to edit and read. Switch those panels from the ComplexMarkupPanel, depending on which one you want to see. Regards, Daan van Etten On Wed, 2009-12-02 at 10:06 +0100, Pieter Degraeuwe wrote: > I want to avoid this, since I wanted to reuse the (complex) markup... > Is there no way around this? > > On Wed, Dec 2, 2009 at 10:02 AM, Giambalvo, Christian < > christian.giamba...@excelsisnet.com> wrote: > > > Keep it simple and write 2 panels. > > > > > > -----Ursprüngliche Nachricht----- > > Von: Pieter Degraeuwe [mailto:pieter.degrae...@systemworks.be] > > Gesendet: Mittwoch, 2. Dezember 2009 09:55 > > An: users@wicket.apache.org > > Betreff: How to write markup if type of component is not known yet... > > > > Hi all, > > > > I want to write a panel which kan render in 2 modes: editable and > > read-only. > > In read-only mode all my components are just labels. In edit mode, are > > these > > labels replaced by input fields (e.g. Textfields, DropDowns, etc) > > > > The problem is now that I only want to write one markup (since all > > components are ordered in a quite complex hierarchy....) > > Wicket complains now that tag type must be input instead of span... > > > > Is there any way around this. (Or am I doing bad practices...) > > > > regards, > > > > Pieter > > > > > > -- > > Pieter Degraeuwe > > Systemworks bvba > > Belgiëlaan 61 > > 9070 Destelbergen > > GSM: +32 (0)485/68.60.85 > > Email: pieter.degrae...@systemworks.be > > visit us at http://www.systemworks.be > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org