fry:ajax sometimes works ONLY with disableOnRequest=false

29 views
Skip to first unread message

claudi...@gmail.com

unread,
Apr 12, 2009, 7:14:10 PM4/12/09
to j4fry
Hi all,

currently I'm adding some new pages to an existing webapp.

The older part of this webapp runs successfully with j4fry ajax
solution... but when I started creating the new pages, I discovered
(after some hours) that the fry:ajax tag only works when I set
disableOnRequest to false. The "old" pages work fine as usual...
The problem is that the action is correctly called, the rerendered
components are also correctly updated - but the html code is not
modified! You can see it as well on the tab component: tabs are
"disabled" but not "enabled" anymore.

The setup of the project is exactly the same, apart from some
differences in the template: i used fry:panel (movable) and fry:onload
for the first time and i used ui:include to enhance code overview.
Another change is that I have put the <head> and <body> html tags
inside the <f:view> component, which is necessary for the new
functionality.

Concerning frameworks, i use

MyFaces 1.2
Tomahawk 1.8
I plan to use some MyFaces Sandbox Components, but currently its not
in use, i only added the library.
J4Fry 1.2_7
Facelets

Anyway, its not a big problem for me to modify the disableOnRequest
attribute, because i use an overlay during each request... despite
that it would be interesting what could cause this strange behaviour.

Thanks in advance for some interesting thoughts :)
Greets,
Claudia

Ganesh

unread,
Apr 13, 2009, 4:18:53 AM4/13/09
to j4...@googlegroups.com
Hi Claudia,

Nice to hear from you!

Have tested FF as well as IE? Does the browser (IE or FF) show any errors?
Have you tried setting alarmThreshold to WARNING?

Best Regards,
Ganesh

claudi...@gmail.com schrieb:

claudi...@gmail.com

unread,
Apr 13, 2009, 12:39:31 PM4/13/09
to j4fry
Hi Ganesh,

same to you.. and happy easter, though it's nearly over :)

I've just tested the recommended settings with the latest versions of
Opera, FF, Safari (Windows) and IE7.

Surprisingly, setting disableOnRequest=true works with IE7.
Opera, FF, and Safari show the behaviour I described above - but no
errormessages.
With disableOnRequest=false it works in all browsers...

Best wishes,
Claudia

Ganesh

unread,
Apr 14, 2009, 1:49:33 PM4/14/09
to j4...@googlegroups.com
Hi Claudia,

I gave you the wrong alarmThreshold - please try setting it to "ERROR"
and test again. Do your old pages contain disableOnRequest? Can you
please provide a short example so I can run a test on my machine?

Best Regards,
Ganesh

claudi...@gmail.com schrieb:

Claudia

unread,
Apr 14, 2009, 3:12:49 PM4/14/09
to j4fry
Hi Ganesh,

it's driving me crazy.... i finally found out what caused the bug:

<t:panelTabbedPane serverSideTabSwitch="false" />

Setting the tabswitch to clientside ( = false ) causes the described
behaviour. When using serverside tabswitching ( = true ), all works
fine, but of course I do not want a full page reload...

**************************

Other question: do you know a HTML Editor that works fine with J4Fry
Ajax? Tomahawks Editor is awful (and extensionsfilter does not load
resources properly with PPR), another Editor I tried is FCK Faces
(http://fck-faces.sourceforge.net/) which looks very good, but on
fry:ajax requests the backing bean does not receive the updated value!
FCK Editor (http://java.fckeditor.net) itself does provide JSF
integration, but unfortunately no facelets support - at least i read
that, haven't tried yet.

Regards, Claudia

Ganesh

unread,
Apr 14, 2009, 3:56:34 PM4/14/09
to j4...@googlegroups.com
Hi,

Yes, t:panelTabbedPane is sometimes hard to use. I've been lately
experimenting with dojo and I've build some declarative facelets tags.
You can check them out here:
http://www.j4fry.org/JSFExamples/faces/dojoFacelets/index.xhtml . The
tabs work nicely with Ajax and it's all in dojo style. The advantage of
the JSF tag over a pure Javascript solution is the the value binding
that shoots the selected tab's id into a JavaBean property.

Your page would need to use the dojo scripts. I think, dojo a great
Javascript library. They also have a Javascript Editor
(http://dojocampus.org/explorer/#Dijit , click "Editor"), but I haven't
integrated it with Facelets yet. It would be great it you would take the
time to add a facelets template dojo:editor to the dojoFacelets. It's
quite easy, you define an h:inputText and let dojo transform it to a
HTML editor with the value binding of the h:inputText. You can find the
existing templates within module DojoFacelets in the J4Fry CVS, the
cookbook (http://www.j4fry.org/cookbook.shtml) describes, how to connect
to it.

Please tell me if you feel like adding to the library. I would be glad
to help you getting into it.

Best Regards,
Ganesh

Claudia schrieb:

Claudia

unread,
Apr 15, 2009, 5:46:52 PM4/15/09
to j4fry
Hi Ganesh,
your Dojo Components look quite cool - I will play around with them
next weekend, I suppose... by the way - I also wanted to try the
fry:dialog tag, but could not find any description/taglib etc, and
theres no eclipse support for the tag.

Concerning Text Editor: the Dojo Editor does not provide all the
functionality I need - its very basic, and I need the editor for a
"cms-like" application. I finally found a really cool one, have a look
at http://tinymce.moxiecode.com/index.php. It transforms as much
components as you want (textareas, divs - all or specified by id) to
fully customizable editors (hides them and creates an iframe with the
editor) - I simply added a callback function, that saves the edited
text in the corresponding (hidden)<h:inputTextarea> and clicks a
hidden element for ajax submit - thats all, and it works really fine.

Anyway, if you think it's worth introducing me to the library, I'd
appreciate it very much - though i may not have time to take part
immediately -> lots of school stuff coming, and a tricky project ...
but as soon as I have enough spare time, I'd love to do something that
does not vanish in the universe of my pc after I finished it ;)

Regards, Claudia


On 14 Apr., 21:56, Ganesh <gan...@j4fry.org> wrote:
> Hi,
>
> Yes, t:panelTabbedPane is sometimes hard to use. I've been lately
> experimenting with dojo and I've build some declarative facelets tags.
> You can check them out here:http://www.j4fry.org/JSFExamples/faces/dojoFacelets/index.xhtml. The
> tabs work nicely with Ajax and it's all in dojo style. The advantage of
> the JSF tag over a pure Javascript solution is the the value binding
> that shoots the selected tab's id into a JavaBean property.
>
> Your page would need to use the dojo scripts. I think, dojo a great
> Javascript library. They also have a Javascript Editor
> (http://dojocampus.org/explorer/#Dijit, click "Editor"), but I haven't

Ganesh

unread,
Apr 16, 2009, 11:04:07 AM4/16/09
to j4...@googlegroups.com
Hi Claudia,

Sorry for the missing documentation on fry:dialog. In our latest application we switched to the dojo Dialog which proved very stable and handy.

There is an example of fry:dialog in the combos facelets example. It works like this:

                <fry:dialog name="Autosuggest">
                    <ui:define name="content">
                        <h:panelGroup>
                           <div style="background-color:white;width:300px;">
                            ...
                           </div>
                        </h:panelGroup>
                    </ui:define>
                </fry:dialog>

I haven't put documentation online because I'm not sure of the value of a JSF tag for a dialog any more. After all it's all Javascript without the need for any value binding.
Reply all
Reply to author
Forward
0 new messages