[Html-widget] trying to get the type of an element
John Napiorkowski
jjn1056 at yahoo.com
Wed Nov 15 19:02:41 GMT 2006
[snipped]
>Does anyone
> know which package has the element method that gets
> called when an element object calls it's element
> method?
>
> --John
Okay, I answered my own question,
HTML::Widget::Element::NullContainer has a element
method as well. Thank you perl -d :)
I added this accessor for element which returns the
type you used when instantiating it. So:
my $w1 = HTML::Widget->new;
my $f1 = $w1->element('Fieldset', 'top');
my $e1 = $f1->element('Select', 'e1');
print $fi->element_type; ## Fieldset
print $e1->element_type; ## Select
This is just a easier way of doing a pattern match
against ref $f1 to get the type you used.
Attached is the test and the diffs for element,
nullcontainer and widget. Please let me know if it
meets the specification. Thanks!
--john
____________________________________________________________________________________
The all-new Yahoo! Mail beta
Fire up a more powerful email and get things done faster.
http://new.mail.yahoo.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: element_type_accessor.patch.gz
Type: application/x-gzip
Size: 945 bytes
Desc: 2642694824-element_type_accessor.patch.gz
Url : http://lists.scsys.co.uk/pipermail/html-widget/attachments/20061115/74c7b68f/element_type_accessor.patch.bin
More information about the Html-widget
mailing list