Posts Tagged ‘extjs’
Constraining ExtJs Floating Windows
There are plenty of examples of creating floating windows with ExtJs. However, they all allow the window to be dragged wherever the user chooses. ExtJs supports a ‘constrain’ property on the window. If you just set this to true, then the user cannot drag the window outside of the browser viewport.
However, what if you want to be fancier, and constrain it inside of some other container? It seems obvious, but finding the answer is difficult. People on the ExtJs forums have posted this question, but the responses are generally a step away from being the real answer.
The answer is the renderTo config property, which you should point to the body property of the container. The forum responses generally indicate this, but they fail to mention the body property. This is what works for panels, I haven’t looked at all the other containers. But I have a feeling the concept would still apply.
var myPanel = new Ext.Panel({
...
});
var testWin = new Ext.Window({
title: 'Test',
width: 300,
height: 300,
renderTo: myPanel.body,
constrain: true,
});
testWin.show();
ExtJs with JSF
I saw some people were finding this blog by doing a search for ExtJs with JSF.
I previously searched and found that someone had wrapped up ExtJs into a JSF library, however it appeared to be a dead project.
A coworker and I instead decided to use Apache Shale to expose methods in a managed bean, to return the JSON data that ExtJs wanted. At the time, we were only using the ExtJs Tree component. We needed to use the ExtJs Tree instead of the one from RichFaces because of a certain requirement that could not be fulfilled with RichFaces.
Grails + ExtJs
Looking at the beginnings of a new webapp. I’m heavily leaning towards Grails+ExtJs, even though the ExtJs plugin has been discontinued because of the license change. Honestly, paying for developer licenses is not a big deal in the grand scheme of things. For widgets, dojo seems to be a runner-up, however it just doesn’t feel as polished, and I find the experience somewhat lacking. I wish jquery had a more mature & official widget set, because it would be my first choice.
In my previous project, we used JSF 1.2 + RichFaces. While I feel that combination can produce good results, it didn’t feel very agile. On a new JSF project going forward, I would recommend Seam; however it is not worth the effort to retrofit a large project.
James Lorenzen has a post about how to roll your own ExtJs plugin for grails, which I will probably give a shot.
With JSF, we were pushing markup down to the browser using ajax polling & rerendering of components. However, I want to start using RESTful services along with Comet. This should get interesting…