ReRendering only works on second click

4 views
Skip to first unread message

Gan...@j4fry.org

unread,
Feb 3, 2009, 2:55:14 AM2/3/09
to j4fry
This thread was moved from the old sourcefoge forum:

Hi again,

today I've noticed another strange thing... don't know whats wrong
this time :(

I tried to rerender the tree, and well, it works - but only on each
second click!
As I can see, the actionmethod is triggered, values updated ALWAYS.
Only rendering happens on second click...

@ganesh: you already know my application... if you want to try it,
simply replace the following in filebrowser.jspx:

REPLACE
<h:commandLink value="reload" action="#
{fileBrowserPageBean.refreshTree}"/>

WITH
<h:outputText value="reload">
<fry:ajax action="#{fileBrowserPageBean.refreshTree}" event="onclick"
reRender="imagetree"/>
</h:outputText>

REPLACE
<h:outputText value="root" />

WITH
<h:panelGroup>
<h:outputText value="root" />
<h:outputText value="#{fileBrowserPageBean.test}" />
</h:panelGroup>


and add the following to fileBrowserPageBean.java:
public int test;

public int getTest() {
this.test = Math.round((float)Math.random() * 100);
System.out.println("Test: " + test);
return test;
}

public void setTest(int test) {
this.test = test;
}


This is only an example... the same happens with each component
(t:outputText, t:dataList... ) i'd like to rerender.

I use <f:view locale="de..."> tags in my application (facelets) for
localisation - can that lead to the problem?

Thanks in advance,
Alina




RE: ReRendering only works on second click
By: ganesh (ganeshpuriProject Admin) - 2008-11-24 20:26
Hi Alinanila,
There is a bug in 1.2_05 that disables recognition of AJAX
requests when the action returns a value other than null. Usually to
do a roundtrip returning null is the best thing to do, because no
navigation rule is triggered and the existing component tree is
reused. Now you have 2 choices: Either you make your action refreshTree
() return null or you dowload 1.2_06 beta 4 where the bug is already
fixed: http://j4fry.cvs.sourceforge.net/*checkout*/j4fry/JSFComponents/j4fry-components-1.2_06.jar
Regards,
Ganesh

RE: ReRendering only works on second click
By: Alina Nila (alinanila) - 2008-11-24 21:06
Hi Ganesh,

thank you very much for your immediate response. Returning null
works perfectly for me!
You're great guys, I'm glad to have chosen the fry-framework -
could not have better support =)

Thanks, Alina
Reply all
Reply to author
Forward
0 new messages