lundi 11 février 2008

Seam ExtJS Extension, updated code

Being used in developpement stage of our current projet, my extension keeps to be updated.

Changes since first version :
- optimized code : the field definition of the records are only parsed once. It was parsed for every returned row in the last version
- added static Ext.data.BeanRecord.createFromBean(bean) function that creates a record directly from a bean (usefull for example in order to populate a form via form.loadRecord(beanRecord)).


Future version will include a proxy Store using a modified "PagingMemoryProxy" implementation in order to be able to define a store able to do local paging from a defined SeamRemotingStore. The proxy is already prototyped but needs to be package in some smart form of a store encapsulation at once the paging store and the proxied SeamRemotingStore. This kind of store can be VERY usefull in case of a SeamRemotingStore having 1000+ rows. The grid cannot handle so much data (moving, sorting, rendering in general veryyyy slow), so we needed to add a pager to it (without compromising the needed functionnality to have all rows loaded on client-side !).

Download complete file here.

12 commentaires:

Rene a dit…

Hi,

nice work, thank you. I found your blog last week and it help me a lot to get started with integrating extjs in my seam project. I got it working but have some issues. What do you thing would be the way to go for a proper exception handling as SeamRemoting does not handle server side exceptions (http://jira.jboss.org/jira/browse/JBSEAM-633)?

regards, René

CVX a dit…

Hi, I've done some work in that way. I've not included it in the store mecanism, but use it for simple Seam invocations.

I'll add an article about it shortly.

Sander a dit…

Hi,

Nice work on the remoting integration.

I have one question:
you've got one method: "f.prototype.get = function(name)"
which should be called when displaying the value in the grid. However this method is never called. I traced it back and this method is never invoked when rendering the grid. it just using:
c.renderer(r.data[c.name])
instead of r.get(...
(gridview.js l:507)

What version of ext are you using or why does it works with you. I'm using ext 2.0.1 and I need this method because I let seam return a map.

CVX a dit…

You're right, sander, I forgot I had to modify ExtJS's code in order to make this possible.

In fact, I just had to modify the ext-all-debug version, because i'm using JSBuilder to integrate my extjs extensions in a unique ext-all + seam-remoting javascript file.

You can do it like this or just call Ext.override() for the modified doRender() method.

I think I'm going to ask ExtJS team to make a modification to the relevant code.

Sander a dit…

I think asking the ext team is a better option otherwise you'd have to check for every new ext version if it still works

CVX a dit…

Hi, I have added a thread in the ExtJS 2.0 Bug forum. I'm in discution with the support team about that subject.

Sander a dit…

I've read your post on the ext forum, to bad they won't comply. An override it is....

I run into a problem with if a fieldvalue contains a & or a " character. However the problem only occurs in firefox.

Do you also have this problem, or could you test it ?

I think it is seam that is not escaping the characters or so and ff does not like it .. :(

CVX a dit…

Hi,

Perhaps you can use Ext.Format.htmlEncode(string) just before where your error shows off. I don't have time for now to test this (didn't face the problem until now) so it will take some days before un go back to this problem.

Sander a dit…

Oke thanks, that did the trick. I added it in the f.prototype.get function of the beanrecord.

Bartek a dit…

Hi,

I was wondering if you could put a complete example program for download. I've been trying to run your code and I'm getting a "call.callback is not a function" error on javascript side. What version of Seam are you using?

Thanks and regards,
Bartek

Anonyme a dit…

Hi,

Congratulations!That is a great ideia! Nice job!
So, I want to "acces properties of underlying objects" and I do not know how to do this because the Reader that this component uses does not use the "mapping" properties.
Could you help-me?

Thanks!

v3g4

Nel a dit…

Hi,
I'm very interested in your code ! But, the zip file doesn't seem to be accessible anymore. Is it possible to have it uploaded again ?

Thanks.