Bug on destroying jQuery UI’s selectable.

I encountered the following error message on my Firebug:

d(this).data(“draggable”) is undefined

[Break on this error] {start:function(){var a=d(“body”),b=d(…</div>’).css({width:this.offsetWidth+

I thought I did something wrong in my code. I spent few hours scratching my head. Finally I gave up and asked uncle Google.

I found a thread in jQuery bug tracker discussing about same error message but different issue. A bug ticket has been opened two years ago. It has been closed and reopened few times with slightly different cases reported. I tried few suggested solutions and work arounds from there. One of them worked well for my case. So, the work around I used was to add timeout for 1ms before destroying the jQuery UI’s draggable. Tada… it works! *What the…

Advertisements
Posted in Closed Issue | Tagged , , | Leave a comment

Tips and Tricks on jQuery

I have few draft posts. Hope I could complete and post it soon.

Anyway, check this out.

Good tips and tricks for jQuery beginner.

And the flyweight pattern also need to be considered when we code the javascript.

My first jQuery-powered web application is now having better performance after I applied the above pattern.

Fiuhh,,  I thought design patterns are not applicable for javascript. I was wrong.

Well, I never put deeper thought on that.

Posted in Best Practices, UI Development | Tagged , | Leave a comment

Grails functional testing with Spock & Geb

Finally I could make the Grails’ functional testing work with Geb and Spock plugin.

I follow the sample code from GitHub. But in the GebConfig, I change the default driver to Firefox, as it is the requirement of the project.

Update: Finally I could make it works, after several discussion with the plugin creator.

You can check the documentation here. After it prompts “command:_”, type in:

-Dserver.port=%DIFFERENT_PORT_NUMBER% all

 

The problem is I still couldn’t make use of the plugin. I don’t know if it’s a bug, or there’s something missing in my code. Meanwhile, I’ll use normal testing

grails test-app -functional

Posted in Closed Issue, Grails Development | Tagged , | Leave a comment

Install Jenkins CI

I’ll start from here and update this post later.

Update >> Installation is very straight forward.

I need to change the the port 8080 (my server use it for Oracle XE) to 8081. I change its config inside jenkins.xml. After that I install Grails and mercurial plugin.

Next is how to setup project here

Posted in Open Issue | Tagged | Leave a comment

Guava is the culprit

Today I play around with testing framework Geb and Spock.

I’ve just installed in my existing Grails project. Half way through, my colleague asks me to generate the war file of the project. Hell yeah, the development procedure here is still suck. We don’t have proper deployment process. I’m planning to use Hudson later on (if I still work in this company :p )

The “grails prod war” failed with the following error message:

java.lang.NoSuchMethodError:

com.google.common.collect.Multimaps.newArrayListMultimap()

Lcom/google/common/collect/ArrayListMultimap;

It must have something to do with my newly installed plugins.

After few hours searching for solution, here are the finding:

UI Performance Plugin uses SmartSprite. SmartSprite depends on google collections

Geb plugin is using Guava.

Note that google collections dev is discontinued and merged with Guava code. The instruction in google collection homepage is to just delete the google collections jar if the guava jar is already in class path.

But it’s not as simple as deleting the jar file. The problem is that current version of smartsSpites has not been updated to use Guava. I’m looking forward to their 3.0 version, which I don’t know when.

Meanwhile, I need to disable css sprite feature from UI Performance plugin.  Here is the work around: commented out line 118 of ResourceVersionHelper.

buildSprites stagingDir

Posted in Open Issue | Tagged , , , , | Leave a comment

Pushing code to FogBugz

To start reading is just not that easy for me. I ended up playing with Mercurial version control. 😀

I’ve TortoiseHg installed. I create my existing grails project as repository by simply right click the root folder select TortoiseHg menu there.

1.  TortoiseHg -> create repository here

2.  TortoiseHg -> add files

3. Hg commit.

Oh I forgot, the idea here is to integrate mercurial with my IDE (IntelliJ IDEA). 😛

Ok, next I install Hg4IDEA-luciad plugin. Since, Mercurial is officially supported on IntelliJ 10. I need to manually install the plugin here. Lucky the plugin is compatible with IntelliJ 9.0.3 (version that I have now).

To install is simply File -> Settings -> Plugins, find the plugins and install it, then restart the IDE.

Now I can push my code to FogBugz.

I’m preparing myself to be start up a software development business. Fortunately, FogBugz offers its bugs tracking product for free to student or poor start up developer like me.

After login, we go to Kiln tab and create repository first. Then FogBugz will provide URL to push the code there.

Then, from IntelliJ I just need to push the code. Version Control -> Mercurial -> Push Change Set. Specify the folder and the URL where you want to push the code. It will prompt user & password. And that’s it.

My IDEA is hang for a while. I just realized that I’m pushing 300MB files at once 😛 While waiting for the Mercurial push to complete, I wrote this post.

Posted in Bug Tracker, IDE, Version Control | Tagged , , | Leave a comment

Flex Designer

Here is my Flex development plan:

1. Create Grails application with Flex plugin (done)

2. Run flex plugin command to enable integration with Flash Builder (done)

3. Modify Flex files (MXML & AS) in Flash Builder.

First & second steps were done. I have downloaded Flash builder 4.5 to try it out and see how sophisticated the flex designer is. As a newbie in Flex, I might depends a lot on the designer.

Now I’m able to open the grails project as Flex project in Flash Builder. I open the mxml files, switch to designer tab and… Flash builder 4.5 designer is not compatible with Flex 4.0 SDK. Even worse, Adobe doesn’t allow to download older version of Flash Builder.

At this moment, I don’t think I want to spend the time upgrading Grails Flex plugin to support Flex 4.5. So, I guess Flash Builder 4.5 is out of option.

The other options is IntelliJ IDEA. Its latest version (10.5) has Flex design support. But I only have version 9 (have commercial license bought by my company). No, I don’t want to spent a single cent to buy or upgrade. I’m a poor developer 😦

I guess I will be Flex-ing without designer. Hehe. No problemo!

Next, I need to read about Flex and actionScript. Aarrghh.. I don’t like reading, man 😦

Posted in IDE, Open Issue | Tagged , , | Leave a comment