[Html-widget] trying to get the type of an element

John Napiorkowski jjn1056 at yahoo.com
Wed Nov 15 14:45:03 GMT 2006


--- Carl Franks <fireartist at gmail.com> wrote:

> On 14/11/06, John Napiorkowski <jjn1056 at yahoo.com>
> wrote:
> > Okay,
> >
> > This is probably not the smartest question, but
> I've
> > looked at the source and the docs and I can't
> figure
> > out how to get the type of an element.  I just
> can't
> > say:
> >
> > $element->type;
> >
> > or any other combination I can think of.  There
> must
> > be a way to do this.  Anyone know?
> 
> The only way to get that just now would be ref(
> $element )
> but that would give something like
> 'HTML::Widget::Element::Textfield'
> 
> You could use add a new method to H/W/Elements with
> mk_accessors()
> and then edit H/Widget::element() to store the type
> it receives, using
> that method after it's created the element.
> Unfortunately, both Block and Button already have a
> 'type' method, so
> it'll need to be a different name - I can't really
> think of anything
> else that's suitable, as 'type' would be most
> appropriate.
> 
> Carl

How about "form_tag" or "form_element" or
"tag|element_name"?

--john


> 
> _______________________________________________
> Html-widget mailing list
> Html-widget at lists.rawmode.org
>
http://lists.rawmode.org/cgi-bin/mailman/listinfo/html-widget
> 



 
____________________________________________________________________________________
The all-new Yahoo! Mail beta
Fire up a more powerful email and get things done faster. 
http://new.mail.yahoo.com




More information about the Html-widget mailing list