Archive

Archive for the ‘javascript’ Category

ExtJS: Window Snippet

March 27th, 2008 rupert No comments

Just a quick example on creating floatable windows

Note that renderTo: ‘document.body’ would result in an error, use renderTo: document.body instead

Categories: ExtJS Tags: ,

Test Driven Development using Test.AnotherWay and mxUnit

March 20th, 2008 rupert Comments off

Time and time again, I have debugging bugs and redeveloping code which some I wrote but mostly done by others as well. Experience is still my best teacher in web development and I believe it would be a heavier burden later on if we continuously pursue rapid development without any testing at all.

You may have heard of writing test cases before diving into code which is well known as Test Driven Development. This methodology has been widely adapted in programming (Java thru JUnit, etc). Following Kent Beck’s Test Driven Development (TDD) we will follow this simple method:

  1. Write the test first
  2. Watch the test fail
  3. Write the component
  4. Watch the test pass

Read more…

Categories: javascript Tags:

Aptana Impressions

March 16th, 2008 rupert No comments

I recently downloaded Aptana Studio 1.1 Community Edition and have been using it mostly for my Javascript/ColdFusion development.

But one of the major problems I encountered was the startup. Sometimes, for some unknown reason, Aptana cannot start using the executable it provided during the install. However, I was able to weed that problem out by instead launching it from startup.jar. All of these is documented from Aptana’s JIRA ticket.

1. Downloaded and install Aptana

2. Watched Aptana TV Overview

3. Installed cfeclipse http://www.cfeclipse.org/update

4. Installed viPlugin http://satokar.com/ (Note that the viPlugin would not work with files = *.html)

5. Added the extjs2.0 code assist

Making GeoJSON outputs from PostGIS

February 23rd, 2008 rupert No comments

I have an internet/web application sitting on top of OpenLayers, ExtJS, ColdFusion and PostGreSQL/PostGIS. I can query the geometry from PostGIS thru ColdFusion without any problems. If you are in ColdFusion 7, then you need a postgresql driver installed, but I do suggest you use ColdFusion 8 as the driver is built-in.

To display the geometry, I typically use AsGML output from PostGIS and supply that path to OpenLayers. Although it works as expected, I need to invest in two (2) http calls to the server:

  • 1st Request: Call search.cfm and get the attributes (name, address, tel_no, etc…). Afterwards, display the results on an Ext.Window.
  • 2nd Request: Display the geometries on OpenLayers using GML.

Read more…

Categories: GeoJSON, javascript, postgis Tags: ,

ExtJS and OpenLayers

February 19th, 2008 rupert No comments

It seems that ExtJS and OpenLayers does not blend well together. One of the bug biters that hit me was the way ExtJS was handling arrays. It would be wise for OpenLayers to be agnostic of these frameworks.

for( var i in blocks ) should be transformed to for( var i = 0; i < blocks.length; i++)

I believe OpenLayers Ticket#1362 closely resembles this bug. Thanks to pgiraud for pointing me to the right direction.

Categories: ExtJS, javascript, openlayers Tags: ,