[html-formfu] custom ExtJS element

Alexander Hartmaier alexander.hartmaier at t-systems.at
Thu Jun 25 09:29:33 GMT 2009


Hi Mario!

Do we want to allow to overwrite the xtype?
I'm for a generic element that can be used for every Ext.ux.

Am Donnerstag, den 25.06.2009, 01:02 +0200 schrieb Mario Minati:
> Hello Alexander,
> 
> you can write
> return { xtype => "textfield", %{$super} };
> 
> This way you can overwrite the xtype.
> 
> If time permits I'll upload to svn.
> 
> Greets,
> 
> Mario
> 
> Am Mittwoch 24 Juni 2009 14:09:38 schrieb Alexander Hartmaier:
> > Am Montag, den 22.06.2009, 21:02 +0200 schrieb Moritz Onken:
> > > Hi Alex,
> > >
> > >
> > > did you try to just use a Text element?
> > >
> > >   - elements:
> > >       - type: Text
> > >         attrs:
> > >           xtype: itemselector
> >
> > I've already tried this before making a custom element class. It doesn't
> > work because the xtype is overwritten by the Text element in render by
> > return { %{$super}, xtype => "textfield" };
> >
> > Should we add a Element::Generic class for such cases?
> >
> > > This should do it. If you want to create a custom ExtJS element you
> > > have to create both a HTML::FormFu::Element::ExtJS::ItemSelector and a
> > > HTML::FormFu::ExtJS::Element::ItemSelector.
> > >
> > > The elements in the HTML::FormFu::ExtJS::Element namespace are not
> > > objects in the OO sense. They just provide a "render" method which is
> > > used by ::ExtJS to render a HTML::FormFu::Element.
> >
> > Which part of HTML::FormFu::ExtJS holds that magic?
> >
> > > cheers,
> > >
> > > moritz
> > >
> > > Am 22.06.2009 um 18:15 schrieb Alexander Hartmaier:
> > > > I'm trying to create an Element::ItemSelector
> > > > (http://extjs.com/deploy/ext-3.0-rc2/examples/multiselect/multiselect-d
> > > >emo.html ) in my Catalyst apps' namespace for many-to-many rels but keep
> > > > getting the error:
> > > >
> > > > "Can't locate object method "new" via package
> > > > "NAC::Web::NAC::HTML::FormFu::ExtJS::Element::ItemSelector"
> > > > at /usr/local/share/perl/5.8.8/HTML/FormFu/ObjectUtil.pm line 167.
> > > > at /usr/local/share/perl/5.8.8/HTML/FormFu.pm line 151"
> > > >
> > > > At the moment the class is just a copy of ExtJS::Element::Text:
> > > >
> > > > package NAC::Web::NAC::HTML::FormFu::ExtJS::Element::ItemSelector;
> > > >
> > > > use base "HTML::FormFu::ExtJS::Element::_Field";
> > > >
> > > > use strict;
> > > > use warnings;
> > > > use utf8;
> > > >
> > > > sub render {
> > > >    my $class = shift;
> > > >    my $self = shift;
> > > >    my $super = $class->SUPER::render($self);
> > > >    return { %{$super}, xtype => "itemselector" };
> > > > }
> > > >
> > > > 1;
> > > >
> > > > HTML::FormFu::ExtJS::Element::_Field doesn't have a base class and
> > > > also
> > > > has no new contructor.
> > > > The HTML::FormFu::Element classes all do have a new constructor, why
> > > > the
> > > > ExtJS not?
> > > >
> > > > What are I'm missing?
> > > >
> > > > --
> > > > BR Alex
> > > >
> > > >
> > > > *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
> > > >"*"*"* T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
> > > > Handelsgericht Wien, FN 79340b
> > > > *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
> > > >"*"*"* Notice: This e-mail contains information that is confidential and
> > > > may be privileged.
> > > > If you are not the intended recipient, please notify the sender and
> > > > then
> > > > delete this e-mail immediately.
> > > > *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
> > > >"*"*"*
> > > >
> > > > _______________________________________________
> > > > HTML-FormFu mailing list
> > > > HTML-FormFu at lists.scsys.co.uk
> > > > http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
> > >
> > > _______________________________________________
> > > HTML-FormFu mailing list
> > > HTML-FormFu at lists.scsys.co.uk
> > > http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
> 
> 
> 
> _______________________________________________
> HTML-FormFu mailing list
> HTML-FormFu at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
-- 
LG Alex




More information about the HTML-FormFu mailing list