-
1. Re: rich:tabPanel ajax switching
lmk Feb 23, 2010 5:09 AM (in response to alonzing)you cannot switch tabs if there exists a validation error, using client switchtype will allow switching tabs without server validation,
server switch type is similiar to ajax, but it's a http request not an ajax ones, ajax switchType is fatser.
-
2. Re: rich:tabPanel ajax switching
bkersten Feb 23, 2010 8:58 AM (in response to alonzing)1 of 1 people found this helpful1. You can at least prevent duplicate responses using <rich:tab ignoreDupResponses="true"/>. But IMHO JS errors should actually not occur even if the tab is clicked more than once. Or do they occur in your custom code?
3. You could add a "custom overlay" instead of a popup, e.g.
<div id="screenblocker" style="display:none; background-color:black; opacity:0.5; z-index:1000; position:absolute; top:0px; left:0px; width=100%; height=100%;" />
Should be hidden initially ( display:none ) and displayed during tab changes, e.g.
<rich:tab ontableave="$('screenblocker').show();" ontabenter="$('screenblocker').hide();" />
Thus, u dont need an additional form within the popup and messages could be displayed on the main page.
(Care that prototype script is loaded before. Code is untested, but should give the idea).
-
3. Re: rich:tabPanel ajax switching
alonzing Feb 25, 2010 6:43 AM (in response to bkersten)Thanks you!
Is there a way to prevent various JS errors which trown while toggling quickly between tabs?
The problem is that there when working with AJAX mode, some code regarding components which not exist anymore runs after the tabs changed. The errors are because the components are not partof the DOM of the page and all of them because of accessing null elements.
If I change tabs normally and not quickly, the JS errors don't happen.
Thanks.
-
4. Re: rich:tabPanel ajax switching
ilya_shaikovsky Feb 25, 2010 7:11 AM (in response to alonzing)But IMHO JS errors should actually not occur even if the tab is clicked more than once. Or do they occur in your custom code?
agree, please check where the errors risen using fireBug.
-
5. Re: rich:tabPanel ajax switching
alonzing Feb 25, 2010 9:05 AM (in response to ilya_shaikovsky)Thanks.
The erros didn't happen on mycustom code.
Please see on the attached files, some of the errors.
Need to mention that I have file upload component and spinner component.
This is the stacktrace: (goes from up to down)
The problem is that e is null
function(){for(var i=0;i<newscripts.length;i++){_this._evaluateScript(newscripts[i]);}
window.execScript(newscript);
new Richfaces.Spinner(
"problemEditorPanelForm:CVnumOfRepetitionPercent",{'min':'1','max':'500','delta':'5'} );
this.initialize.apply(this,arguments);
var edit=this._getDirectChildrenByTag(this.content,'INPUT')[0]
var allKids=e.childNodes
(Lsat row on this function):
function(e,tagName){var kids=new Array();var allKids=e.childNodes;for(var i=0;i<allKids.length;i++){if(allKids[i]&&allKids[i].tagName&&allKids[i].tagName.toUpperCase()==tagName.toUpperCase()){kids.push(allKids[i]);}}
-
bugs.jpg 71.9 KB
-