I was thinking more that I would just extend standard TextArea and TextField
components but override onComponentTag to replace whatever tagName was
supplied by the HTML monkey. So Wicket would continue doing its good stuff
but I wouldn't need two different HTML fragments or placeholder elements...

Do you think onComponentTag is a safe extension point for this? ListChoice
and PasswordTextBox onComponentTag are final :( 

Thanks

Sam


igor.vaynberg wrote:
> 
> its not that simple
> 
> input tag has no body <input/> why textarea does <textarea></textarea>
> also input stores its value in the value attr, textarea does it in its
> body....
> 
> that is why we have two separate components for this. you can of
> course write your own that handles both cases properly...
> 
> -igor
> 
> 
> On Jan 21, 2008 7:03 AM, Sam Hough <[EMAIL PROTECTED]> wrote:
>>
>>         @Override
>>         protected final void onComponentTag(final ComponentTag tag) {
>>             tag.setName("input");
>>             tag.put("type", "text");
>>
>>             super.onComponentTag(tag);
>>         }
>>
>> Seems to do what I want but is this a valid extension point? In
>> PasswordTextBox and ListChoice it is marked final...? I don't want to
>> stitch
>> my client up with something that is going to break with the next version
>> of
>> Wicket.  So although means extra dom elements on the browser and more
>> component instances on the server am I better off wrapping the raw
>> components?
>>
>> Cheers
>>
>> Sam
>>
>>
>>
>> Sam Hough wrote:
>> >
>> > We want to switch an input field between "input type=text" and
>> "textarea"
>> > depending on how large the existing data is. Is there any way to do
>> this
>> > without needing a spurious placeholder element? ie We would rather not
>> > have a  "span wicket:id=textInput" but rather just get the "text" or
>> > "textarea" element in the final HTML .
>> >
>> > So anything I can do in onComponentTag etc to change the tag name in
>> the
>> > HTML file?
>> >
>> > Cheers
>> >
>> > Sam
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Override-tag-name-in-html-fragment--tp14995403p14999180.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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Override-tag-name-in-html-fragment--tp14995403p15014978.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