Archive for the ‘Flex’ Category

Flex Builder 3 plugin, Eclipse, OS X

Trying to install Flex Builder 3 with Eclipse Galileo on OS X … no dice.

As reported at http://furiouspurpose.blogspot.com/2009/06/flex-builder-3-on-eclipse-35-gallileo.html, after downloading the Eclipse bundle for PHP developers I could install FB3 on Galileo. However,

  • Compiler warnings then got displayed one at a time i.e. just displays first problem, had to fix and recompile to reveal the next one – not good for productivity
  • When I tried to install the Java Development Kit (from Europa Discovery site) in order to install Ant, the installation failed, saying that only one of JDK or the PHP tools could be installed. I need Ant tools, so that’s a showstopper.

I’ve now gone back to Ganymede which works – though I can’t say I’m delighted with performance on my new MacBookPro :-(

e4x expression tool and examples

I like Flex, but being a big fan of XSLT and XPath, E4X drives me mad – to me the notation is clunky and counter intuitive (compared to XPath), though I do concede that may be because of what I learned first.

I don’t find myself using non-trivial E4X expressions quite often enough for it all to become second nature … so I find this online e4x expression tool very useful.

While I’m making a note-to-self on the subject of e4x, I have just (re)established, that if you want to find a list of nodes which have at least one non-empty descendent of a certain type, the expression is of the form:

a.b.c.(d.e.(text().length()>0).length() > 0)

I’m not seeing a lot of lists of e4x examples out there, so I’ll try to remember to add further e4x examples as comments to this post – and please feel free to do the same!

kdw

Programmatically getting DataGrid to sort

I’ve just had a merry time getting a DataGrid to sort by a particular column (and show the apt arrow in the header) when it first renders i.e. as if the user had clicked the header.

Googling on the subject suggested (http://blog.flexexamples.com/2008/02/28/displaying-the-sort-arrow-in-a-flex-datagrid-control-without-having-to-click-a-column/) that defining dataProvider.sort then calling dataProvider.refresh() would have the desired effect – however for me it didn’t work: the arrow got displayed, but did not sort the column properly – until the user actually clicked the header, at which point it all came good (and continued to re-sort when items were added).

In the end I had to use a rather literal solution to the problem i.e. simulate the user clicking the header by dispatching a DataGridEvent.HEADER_RELEASE event:

    ...
    var eventOut:DataGridEvent = new DataGridEvent(DataGridEvent.HEADER_RELEASE, false, false, myColIndex);
    myGrid.dispatchEvent(eventOut);
    ...

Not ideal, but it worked – so posting here in case it helps anyone else.

kdw.

Search
Categories