PDA

View Full Version : SuperTag


arno83
Jul 12th, 2007, 04:52 AM
Hi,

I want to create a SuperTag which include an inputTag and a LabelTag...

How can i do this ?

so when I code : <myPrefix:SuperTag path="path" label="mon label"/> it create into html code
<label>mon label<input type="text" value="1"/></label>

what class i need to extends AbstractHtmlInputElementTag ..?

for the moment, i have two class, MyInputTag which extends InputTag and MyLabelTag which extends LabelTag, and separately, these two class work

Thanks a lot

Arno

arno83
Jul 12th, 2007, 06:00 AM
Currently I did that :

public SuperTag extends MyInputTag
{

protected int writeTagContent(TagWriter tagWriter)
{
tagWriter.startTag("label");
tagWriter.writeAttribute("for","attribute")
tagWriter.endTag();
super.writeTagContent(tagWriter);
return 0;
}
}


this code work, but i loose all of label 's functionnality (setFor, setClass, etc...)

Someone have an idea ?

Thanks a lot
Arno