[html-formfu] custom ExtJS element

Mario Minati mario.minati at googlemail.com
Thu Jun 25 20:38:46 GMT 2009


Hi Alexander,

sorry I'm not on irc as my software doesn't work properly and time is very 
rare to fix it.

The overall direction of FF::ExtJS should be given from Moritz as he started 
this. 

With this out of the way I agree to create and document the behaviour for 
overwriting xtype for all elements.

The generic stuff could be started by rewriting the ExtJS code in a more OO 
way. I mean that we have a similar inheritence structure like in FF itself.
So we could create _Field and _Block base classes and inherit from them.

This way it would be easier to create a custom element.

One challenge I still see are the waya that everyone implements there ExtJS 
classes and the way of communication.
We send create the form definitions when starting up the App and they are all 
loaded in our index.html. Later on we only transport the data. So we are 
getting options for selects in a different way. Also the way we are creating 
editors for grids (base class for one of our repeatable elements) is very 
special and quite complex to tell.
What I wan't to say is, that the needs on the ExtJS side affects very much our 
expectations against the FF::ExtJS layer.

My conclusion is, that we need as much flexibility in FF::ExtJS as possible to 
attract users.

More docs would be a good idea, maybe a Cookbook. Help is apreciated. ;-)

I'm sure Carl will give you write access  to the svn, if you would like to 
contribute.

Greets,

Mario
 

Am Donnerstag 25 Juni 2009 17:32:06 schrieb Alexander Hartmaier:
> Discussing this on irc would be great.
> Are you on irc too, Mario?
>
> Maybe we should define the possibility to overwrite the xtype per
> Element and document the behaviour.
>
> The purpose of the Generic element would be for the use of ExtJS user
> extensions which don't have anything in common with any of the non-ExtJS
> FormFu elements.
>
> Also a guide how to write a custom ExtJS Element would be great so that
> others don't fail like I did.
>
> Am Donnerstag, den 25.06.2009, 16:40 +0200 schrieb Mario Minati:
> > Just one generic element won't probably be enough, because there are also
> > select type elements in ExtJS.
> >
> > When I think of the ux.DD... fields, then we would need more than just
> > these two generic fields.
> >
> > So overwriting the xype wouldn't be that bad and just let you decide
> > which way to go.
> >
> > Greets,
> >
> > Mario
> >
> > Am Donnerstag 25 Juni 2009 12:17:11 schrieb Moritz Onken:
> > > I prefer the Generic element as well.
> > > A text field should stay a text field, no matter what you supply as
> > > attributes.
> > >
> > > Patches welcome, or ask Carl to get a subversion commit bits (requires
> > > a google account).
> > >
> > > moritz
> > >
> > > Am 25.06.2009 um 11:29 schrieb Alexander Hartmaier:
> > > > 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/multise
> > > >>>>>lect -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
> > > >
> > > >
> > > > _______________________________________________
> > > > 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





More information about the HTML-FormFu mailing list