You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thomas Götz <to...@decoded.de> on 2012/11/28 10:06:53 UTC

View and edit panel

Hi there,

I'm currently implementing a panel that is used for viewing and editing of some entity. I wonder if there is an elegant solution for this.

The situation:
all my view/edit panels have a common abstract parent class (Panel), providing some general markup, i.e. I'm using <wicket:extend> in my concrete Panel implementation. Not every component is editable, only some. Currently I have a solution where I'm using a flag (isEditMode) and some if/else constructs to create either a label or e.g. a TextField. I keep the markup for the FormComponents as Fragments or separate Panels. Any more sophisticated ideas on how to implement this? ;-)

Cheers,
   -Tom



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: View and edit panel

Posted by Nick Pratt <nb...@gmail.com>.
You can set the Panel non-editable, and all those Form components will
become non-editable.


On Wed, Nov 28, 2012 at 4:06 AM, Thomas Götz <to...@decoded.de> wrote:

> Hi there,
>
> I'm currently implementing a panel that is used for viewing and editing of
> some entity. I wonder if there is an elegant solution for this.
>
> The situation:
> all my view/edit panels have a common abstract parent class (Panel),
> providing some general markup, i.e. I'm using <wicket:extend> in my
> concrete Panel implementation. Not every component is editable, only some.
> Currently I have a solution where I'm using a flag (isEditMode) and some
> if/else constructs to create either a label or e.g. a TextField. I keep the
> markup for the FormComponents as Fragments or separate Panels. Any more
> sophisticated ideas on how to implement this? ;-)
>
> Cheers,
>    -Tom
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

RE: View and edit panel

Posted by Michal Wegrzyn <mi...@onior.com>.
Hi Thomas,

Bean edit panel is useful in this sort of scenarios.

http://londonwicket.googlecode.com/files/LondonWicket-BeanEditor.pdf

It is quite old, maybe there is a newer/better option.

Best regards,
Michal Wegrzyn

> -----Original Message-----
> From: Thomas Götz [mailto:tom@decoded.de]
> Sent: Wednesday, November 28, 2012 10:07
> To: users@wicket.apache.org
> Subject: View and edit panel
> 
> Hi there,
> 
> I'm currently implementing a panel that is used for viewing and editing
> of some entity. I wonder if there is an elegant solution for this.
> 
> The situation:
> all my view/edit panels have a common abstract parent class (Panel),
> providing some general markup, i.e. I'm using <wicket:extend> in my
> concrete Panel implementation. Not every component is editable, only
> some. Currently I have a solution where I'm using a flag (isEditMode)
> and some if/else constructs to create either a label or e.g. a
> TextField. I keep the markup for the FormComponents as Fragments or
> separate Panels. Any more sophisticated ideas on how to implement this?
> ;-)
> 
> Cheers,
>    -Tom
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org