dacat / sfapi

Automatically exported from code.google.com/p/sfapi
0 stars 0 forks source link

Extended UI components and containers fails due to limited Tools.getObjectType() #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
My have a subclass of TabNavigator with added functionality. Sfapi is able
to click TabNavigators through the ClickCommands.doFlexClick method, but it
only works for non-descended classes. This code fails for my descended
container:

  var objectType:String = Tools.getOjectType(child);
  ...
  if (objectType == ReferenceData.TABNAVIGATOR_DESCRIPTION)
  {
    return clickTabNav(child, args);
  }

because Tools.getObjectType only returns the specific type of the child. I
have created a patch for this, that also looks up the type hierarchy, to
try and determine type from inheritance. Like this:

  if (Tools.isA(child, ReferenceData.TABNAVIGATOR_DESCRIPTION))
  {
    return clickTabNav(child, args);
  }

If this patch is applied, I think it should be considered to be put out the
other places where Tools.getObjectType is used in the same way.

Original issue reported on code.google.com by per.ole...@gmail.com on 29 Mar 2010 at 12:19

Attachments:

GoogleCodeExporter commented 9 years ago
Oups. The previous patch had a bug. Forgot to test on the exact type as it did 
as the
only thing before, which result in it ONLY working for descended ones :-)

Here's a new patch that works for both descended and non-descended components 
and
containers.

Original comment by per.ole...@gmail.com on 29 Mar 2010 at 1:44

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by per.ole...@gmail.com on 31 Mar 2010 at 1:38