Change input tag to span, what about value?
I'm overrideing onComponentTag for a textfield. I check if the field is enabled, if not I want to replace the input tag with a span tag. It's working nicely, except that I lose the value attatched to the input tag @Override protected void onComponentTag( ComponentTag tag ) { super.onComponentTag( tag ); if (!isEnabledInHierarchy()) { tag.setName( span ); tag.getXmlTag().setType( TagType.OPEN ); } } Anyone know how I can add this value between the open and close tag? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Change-input-tag-to-span-what-about-value-tp4417174p4417174.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Change input tag to span, what about value?
Had a look on onComponentTagBody, and got it to work by overrideing that method aswell =) Here is the solution, fro those wondering: @Override protected void onComponentTag( ComponentTag tag ) { super.onComponentTag( tag ); if (!isEnabledInHierarchy()) { tag.setName( span ); tag.getXmlTag().setType( TagType.OPEN ); } } @Override public void onComponentTagBody( MarkupStream markupStream, ComponentTag openTag ) { replaceComponentTagBody( markupStream, openTag, getDefaultModelObjectAsString() ); super.onComponentTagBody( markupStream, openTag ); } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Change-input-tag-to-span-what-about-value-tp4417174p4417196.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org