jQuery in Action, 2nd edition*
The moose likes JSF and the fly likes “Permission Denied” error using rich:editor in Richfaces 3 in IE8 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "“Permission Denied” error using rich:editor in Richfaces 3 in IE8" Watch "“Permission Denied” error using rich:editor in Richfaces 3 in IE8" New topic
Author

“Permission Denied” error using rich:editor in Richfaces 3 in IE8

Boris Golman
Ranch Hand

Joined: Apr 24, 2008
Posts: 31
I have another one of these problems trying to get Richfaces 3.3 to work with jquery. I have an h:form that lists several items, each has a fixed HTML content and a radio button next to each of them (t:selectOneRadio). As the user selects a radio button of a certain item, the fixed HTML content gets replaced with rich:editor panel (thus, the HTML content becomes editable). Creating valueChangeListener and providing tag for the radio button took care of that. However, it works only three times, on the forth I get the following javascript error:

Permission denied
tiny_mce_src.js.jsf Line 978
Code: 0 Char: 47
URI: http://mydomain.com/myproject/a4j/g/3_3_3.Finalscripts/tiny_mce_src.js.jsf

Apart from that, I also have a jquery function, that I use, and I've noticed, that when I remove necessary jquery resources declarations, I can click radio buttons and switch from HTML to rich:editor without any problem, but, obviously, I cannot use my jquery function, which leads me to believe, that there could be some strange collision going on between Richfaces and jquery (wrong version, perhaps). Moreover, it happens only in IE8, everywhere else it works fine. Finally, notice that I'm using <a4j:support event="onclick" reRender="someForm"/> for my selectOneRadio, in order to get valueChangeListener to work (before that I had buttons that did the switching of HTML content and rich:editor, and everything worked then, along with jquery functions, but now that I want the same thing to happen from a click of a radio button or a check box, I'm getting "Permission Denied" error, mentioned above). Thus, it could also be ajax calls not working properly with jquery, however, I can't tell anymore, I'm a bit at a loss here. Here's the code I'm using, hope it'll help more or less:



Any help is appreciated. Right now I don't know even know what this error means. Thanks.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

RichFaces uses jQuery internally. The version that it employs in RichFaces 3 is very antiquated, so if you need features only available from newer versions of jQuery you have to be very careful.

There are also some patches that needed to be applied to Windows systems running IE8, although I believe that they're mostly related to opening pop-up windows.

There's a way to get a RichFaces-based webapp to download the uncompacted version of its javascript files that can help if you're brave enought to try and make sense of the actual failing Javascript code.


Customer surveys are for companies who didn't pay proper attention to begin with.
Boris Golman
Ranch Hand

Joined: Apr 24, 2008
Posts: 31
I guess, the last suggestion is the only thing for me to try, before giving up. I was, however, kinda thinking that "a4j:support" is also part of the issue, which also doesn't help: as far as I know, that's the only way to reload a page when you click on a radio button. What does "Permission Denied" error in Javascript usually mean? Or is it too general?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

Usually a "permission denied" message comes with some sort of hint as to what object is offending. By itself, the message is too broad to guess at.

If you want to make something happen server-side when you click a radio button in RichFaces 3, all that is necessary is to attach an a4j:support element to it, sensitize it to the "onclick" event and supply it with an AJAX action method to be called on the server. Add reRender items as needed. Beyond that, there's nothing else to do. No JSF listeners, no manual JavaScript or jQuery, nothing. Although actually setting ajaxSingle is common if you don't want the event held hostage to unrelated invalid data in the form.

For RichFaces 4 and generic JSF2, instead of using a4j:support, you'd use the JSF2 f:ajax element, but the basic operation will be the same. If you code a no-parameter AJAX listener method, even that works unchanged.
Boris Golman
Ranch Hand

Joined: Apr 24, 2008
Posts: 31
Well, <a4j:support> was definitely part of the reason for this "Permission Denied" error. I've found a workaround, a bit messy, but it should suffice for now. In my <a4j:support> tag I've added "action" attribute, thus the page now reloads every time I click the radio button, which should be fine (and there's no "Permission Denied" error message any more). Not as pretty as it would be with just actionListener, but still. Maybe once we'll upgrade RichFaces, we won't see this problem.
Boris Golman
Ranch Hand

Joined: Apr 24, 2008
Posts: 31
Well, <a4j:support> was definitely part of the reason for this "Permission Denied" error. I've found a workaround, a bit messy, but it should suffice for now. In my <a4j:support> tag I've added "action" attribute, thus the page now reloads every time I click the radio button, which should be fine (and there's no "Permission Denied" error message any more). Not as pretty as it would be with just actionListener, but still. Maybe once we'll upgrade RichFaces, we won't see this problem.
Boris Golman
Ranch Hand

Joined: Apr 24, 2008
Posts: 31
Well, a4j:support was definitely part of the reason for this "Permission Denied" error. I've found a workaround, a bit messy, but it should suffice for now. In my a4j:support tag I've added "action" attribute, thus the page now reloads every time I click the radio button, which should be fine (and there's no "Permission Denied" error message any more). Not as pretty as it would be with just actionListener, but still. Maybe once we'll upgrade RichFaces, we won't see this problem.
Boris Golman
Ranch Hand

Joined: Apr 24, 2008
Posts: 31
Apparently, this "Permission Denied" problem appears independently from jquery. Back to my code: I have a list of items, each represented by rich:editor component. I also have a4j:commandButton the user clicks. It should update the table and (for this simple example) display a new rich:editor component that has just been added. And it works perfectly in FireFox, but not in IE (I'm using IE8). In IE you click the a4j button once, the table gets updated and rerendered properly, the second time nothing happens and I get the same exact "Permission Denied" error. I have a nasty suspicion that it's an IE bug, possibly requiring for IE upgrade or RichFaces upgrade, or both. Is there at least some kind of a workaround to get this to work? Here's the code (I've simplified for this particular example):



It's clear that rich:editor doesn't work well with AJAX (at least in IE8, RichFaces 3, and JSF 1.2 combination), I was just hoping that there's some workaround to resolve this issue (or if it's even going to be fixed after the full upgrade).

Thanks again for all your help.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

Yes, IE8 has issues. That's the bad news. However, you can patch IE8. That's the good news. However, RichFaces 3 does not support IE10 at all, and per the RichFaces team, never will. You'd need to migrate the RichFaces 4 and JSF2. JSF2 isn't so bad, but the last time we saw such a horrendous migration path between different versions of the same platform as RichFaces 3 to RichFace 4 was when VB6 was supplanted by VB.net. It's a complete "in-your-face" to the time-honored Java traditions that legacy stuff will be supported for extended lengths of time as backwards-compatible features.

To get RichFaces3 to work properly with IE10, you have to include an HTML META element that downshifts the apparent version of IE to IE8 (maybe it's IE9, but I'd have to RTFM to be sure).

There should not, however, be an actual problem with the richText control and a4j AJAX. In fact, I'm pretty sure that richText itself does a certain amount of AJAX. Most RichFaces controls can.
Boris Golman
Ranch Hand

Joined: Apr 24, 2008
Posts: 31
I'm not quite worried about IE10, we should upgrade by then. IE8 is what we're currently aiming towards. I was just hoping that I can at least get rich:editor to work properly with a4j:commandButton. Or, at least, find some workaround to do so.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

If I were you, I'd be QUITE worried about IE10. My impression is that IE8 isn't much better regarded now than IE6. IE10 or 11 (is 11 out? can't remember) is the poison of choice. And Microsoft is very good at opening people's jaws in this respect.

In case I was confusing, I should make it clearer that IE8 may in fact be your problem. There's no architectural reason why a4j:commandButton and rich:richText cannot get along. And in fact, I've got an app that is loaded with such stuff.
Boris Golman
Ranch Hand

Joined: Apr 24, 2008
Posts: 31
And you're using IE10 (or anything that's not IE8) for your app?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

Boris Golman wrote:And you're using IE10 (or anything that's not IE8) for your app?


Since the product in question is a SAAS app, we have an unpredictable mix of clients. The administrators actually prefer Firefox or Chrome. The field users are I think typically IE9 or IE10.

Because of the restriction of RichFaces 3 to IE8 or earlier, I have the IE8 compatibility META tag on the site's web pages, but the difference here is that while we are downshifting to IE8's javascript and CSS idiosyncrasies, we aren't running the actual IE8 with IE8's native bugs. Which doesn't mean we're completely problem-free, since some users appear to have timing issues when downloading certain big chunks of javascript. But it does avoid some of the other issues.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: “Permission Denied” error using rich:editor in Richfaces 3 in IE8
 
Similar Threads
JSF View
Trying to refresh a dataTable on a JSP after data is updated but so far no luck
Problem regarding the ValueChangeEvent and the commandButton
How to insert <span> tag into rich:editor using jquery drag and drop?
RichFaces with TabPanel and selectOneMenu not change the tab