You could also use fragments, this is how Wicket Web Beans handles
viewonly mode:

http://grepcode.com/file/[email protected]$wicketwebbeans@1...@net$sourceforge$wicketwebbeans$fields$inputfield.java

hth,

Daniel



J.D. Corbin wrote:
> 
> Yeah, I was aware of the Ajax Label Edit COntrol.  Not exactly what  
> I'm looking for, but looking at its implementation, I now know how I  
> can do it.
> 
> Thanks,
> J.D.
> On Sep 12, 2009, at 9:11 PM, Jeremy Thomerson wrote:
> 
>> This might help you:
>> http://www.google.com/search?q=wicket+editable+label
>>
>> Otherwise, you certainly can create small components that can work  
>> with read
>> or write mode to fit your needs.
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>> On Sat, Sep 12, 2009 at 10:06 PM, J.D. Corbin  
>> <[email protected]> wrote:
>>
>>> Hello,
>>>
>>> I would like to create a single page markup that I share for  
>>> editing and
>>> read-only views.
>>>
>>> For example, when in read-only mode I might display a label and in  
>>> edit
>>> mode a TextField.
>>>
>>> I know I can use a textfield and set the enabled behavior to false,  
>>> but the
>>> visual display isn't very appealing in that case and don't want to  
>>> decorate
>>> it using css.  Typically the value I display in read-only mode for  
>>> the field
>>> is a bit different than the edited value in edit mode.
>>>
>>> I was hoping I could define a SPAN tag in my markup and then either  
>>> render
>>> a label or textfield depending upon the mode I was in, either read- 
>>> only or
>>> edit.   Unfortunately this doesn't work because a TextField has to be
>>> rendered using an INPUT tag.
>>>
>>> One thing I thought about was defining two fields, one for the edit  
>>> field
>>> and one for the read-only field and then control their visibility  
>>> depending
>>> upon the mode I was in, but that isn't very elegant.
>>>
>>> My main goal is to avoid having to create separate markup for the  
>>> editor
>>> and read-only view.
>>>
>>> Any suggestions?
>>>
>>> J.D.
>>>
>>>
> 

-- 
View this message in context: 
http://www.nabble.com/Dual-Use-wicket%3Aid-tp25420184p25423250.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]

Reply via email to