Skip to main content

reRendering the DataTable

4 replies [Last post]
areznik
Offline
Joined: 2007-01-18

Hi, im new to jmaki and i have what seems to be a rather basic question.

I have a datatable thats implemented as follows:

with "webhelper.booktest" evaluating to a JSON string with some data. The first time the page is loaded everything works fine, the table loads with the desired initial data.

I then use a4j (Ajax4JSF http://labs.jboss.com/portal/jbossajax4jsf) to change the value of "booktest" to a different data string, but I cant find a way to rerender the datatable with the new data.

I have tried using A4J's reRender option, but the table comes up empty, I have also tried to just use JavaScript (after the bean property has been updated) to get the widget's instance and do init() on it again, but that yields pretty much the same result, no data.

Is there any way I can do this, perhaps with jMaki's tools (im not married to using a4j for this).

Thanks in advance.
- Alex

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jenniferb
Offline
Joined: 2004-04-02

I was having a similar problem. See my post here:

http://forums.java.net/jive/thread.jspa?threadID=24724&tstart=0

I was trying to use the render function available in the Etable's component.js, but I wasn't able to get it to work either, and noone has answered my question. :(

If you have any success with this, please post it on the forum. I'm sure others would like to know the answer too.

Jennifer

tazmaniac
Offline
Joined: 2007-03-19

hu... :-( :-(

Please !!!

is anyone of you able to tell me why it seems that my EL expression are not interpreted?

when I read the page source in the browser, I clearly read : value:'#{myInput}' instead, of course, of a dynamically generated JSON string. :-(

What am I forgetting, please?

I am using sun Sun Java System Application Server 9.1 Beta, NetBeans 5.5.1, Jmaki 8.3.2.

(Really Big) Thank you in advance!!

Alfred

PS: Jennifer: I figured out that I could not make working your tutorial about Dynamic Faces on IE 6. But it's nicely working on Firefox. Thx again for your work :-)

areznik
Offline
Joined: 2007-01-18

you would probably have better luck getting an answer in a thread of your own, but...

make sure you're putting the correct bean name like value="#{myBean.myValue}" and make sure that your bean is properly configured in faces-config.xml

also some fields do not take EL expressions

EDIT

from one of your other threads i saw your code,

I'm pretty sure you cant use EL inside a regular script tag.

One way i think you can hack around this is to have a hidden input component somewhere in your page like

then you can grab the value in your script:

jmaki.addWidget({widgetDir:'http://localhost:8080/xfpUserAdminWeb2/resources/dojo/table',value:{columns: {'fonction':'fonction', 'libelle':'libelle', 'indicateur': 'indicateur', 'typeInterne':'typeInterne', 'module':'module'},
rows:[b]document.getElementById("hiddenstuff").value[/b]},
script:'http://localhost:8080/testJmaki/resources/dojo/table/component.js',
uuid:'dojo_table2',name:'dojo.table'});

theres probably prettier ways to do it, but i'm tired and its time to go home =D

Message was edited by: areznik

tazmaniac
Offline
Joined: 2007-03-19

Thx a lot for your help

Alfred