[ 
https://jira.jboss.org/jira/browse/RF-7674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12481269#action_12481269
 ] 

Joey asdasd commented on RF-7674:
---------------------------------

I am not able to provide a detached example from my whole application showing 
just the problem, but I fixed my problem by removing the a4j:form element from 
the included page with the tree view.

You are correct - using IE8 Developer tools, there was indeed a nested form. 
Removing the a4j:form tag (as above) fixes the problem. The only thing I can't 
figure out is where the parent form was coming from. I did not see anywhere 
else in my jsp that had an h:form or a4j:form tag. Is there any conditions 
where a form tag is implicitly created, such as maybe in an a4j:include tag?

IE:

<a4j:include viewId="#{menuBean.navPage}" ajaxRendered="false" 
id="includedView">
            <a4j:status id="mainStatus" 
onstart="Richfaces.showModalPanel('ajaxLoadingModalBox',{width:450, top:200})"
                        
onstop="Richfaces.hideModalPanel('ajaxLoadingModalBox')" />
            <rich:modalPanel id="ajaxLoadingModalBox" minHeight="140" 
minWidth="450"
                             height="140" width="250" zindex="2000">
              <f:facet name="header">
                <h:outputText value="Your request is being 
processed"></h:outputText>
              </f:facet>
              <div style="margin:auto; text-align:center">
                <h:graphicImage value="/images/ajax-loading.gif" 
style="margin:auto" />
              </div>
            </rich:modalPanel>
          </a4j:include>

There are no jsf/richfaces form components in my included page (via 
menuBean.navPage), yet there is a form appearing in the DOM. 

> CLONE -problem with rich:tree in ie 7 with richfaces 3.3.0 and 3.3.1
> --------------------------------------------------------------------
>
>                 Key: RF-7674
>                 URL: https://jira.jboss.org/jira/browse/RF-7674
>             Project: RichFaces
>          Issue Type: Bug
>          Components: browser compatibility
>    Affects Versions: 3.3.0
>         Environment: Internet Explorer 7
>            Reporter: Joey asdasd
>            Assignee: Nick Belaevski
>
> Hi everybody,
> I'm creating a page with rich:tree component.
> The page is working perfectly with mozilla 3. In IE 7 the tree is show and I 
> can expand and colapse, but when I try to select any node I get an error 
> message of the script debbuger. The first node clicke is processed by the 
> nodeSelectionListener but then the tree don't works anymore.
> The error is indicated in line 10, the error is 'elements' is null or is not 
> an object.
> The debbuger shows a javascript and highlight the text: "var 
> field=form.elements[fields[i]]" in line 10.
> My code is: 
>                       <rich:tree id="treeModelo" style="width:200px" 
> value="#{modeloTreeBean.treeNode}" nodeFace="#{item.tipo}" 
>                                       var="item" switchType="ajax" 
> nodeSelectListener="#{modeloTreeBean.processSelection}" 
>                                       ajaxSubmitSelection="true" 
> ajaxKeys="#{null}" reRender="treeModelo">
>                       <rich:treeNode type="ap" 
> iconLeaf="/images/icons/document.png" icon="/images/icons/document.png" >
>                                       <h:outputText value="#{item.nome}" />
>                       </rich:treeNode>
>                       <rich:treeNode type="m" 
> iconLeaf="/images/icons/document.png" icon="/images/icons/document.png" >
>                                       <h:outputText value="#{item.nome}" />
>                       </rich:treeNode>
>                       <rich:treeNode type="p" 
> iconLeaf="/images/icons/document.png" icon="/images/icons/document.png" >
>                                       <h:outputText value="#{item.nome}" />
>                       </rich:treeNode>
>               </rich:tree>
> the complete code of the debbuger is:
> if(!window.A4J){window.A4J={};}
> if(!A4J.findForm){function 
> _JSFFormSubmit(linkId,formName,target,parameters){var form=(typeof 
> formName=='string'?document.getElementById(formName):formName);if(form){var 
> paramNames=[];var oldTarget=form.target;if(target){form.target=target;}
> if(parameters){for(var param in 
> parameters){paramNames.push(param);if(form.elements[param]){form.elements[param].value=parameters[param];}else{var
>  
> input=document.createElement("input");input.type="hidden";input.id=param;input.name=param;input.value=parameters[param];if(param==="javax.faces.portletbridge.STATE_ID"&&form.firstChild){form.insertBefore(input,form.firstChild);}else{form.appendChild(input);}}}}
> var 
> onsubmitResult;if(form.fireEvent){onsubmitResult=form.fireEvent("onsubmit");}else{var
>  event=document.createEvent("HTMLEvents");event.initEvent("submit",true,true)
> onsubmitResult=form.dispatchEvent(event);}
> if(onsubmitResult){form.submit();}
> _clearJSFFormParameters(formName,oldTarget,paramNames);}else{alert("Form 
> "+formName+" not found in document");}
> return false;};function _clearJSFFormParameters(formName,target,fields){var 
> form=(typeof 
> formName=='string'?document.getElementById(formName):formName);if(form){if(target){form.target=target;}else{form.target='';}
> if(fields){for(var i=0;i<fields.length;i++){var 
> field=form.elements[fields[i]];if(field){var 
> pNode=field.parentNode;if(pNode){pNode.removeChild(field);}}}}}}
> function 
> clearFormHiddenParams(formName,target,fields){_clearJSFFormParameters(formName,target,fields);}
> A4J.findForm=function(element){var 
> parent=element;do{parent=parent.parentNode;}while(parent&&parent.nodeName.toLowerCase()!='form');if(!parent){parent={reset:function(){},submit:function(){}};}
> return parent;}
> A4J._formInput=null;A4J.setupForm=function(id){var element=(typeof 
> id=='string'?window.document.getElementById(id):id);var 
> name="click";if(element.addEventListener){element.addEventListener(name,A4J._observer,false);}else
>  if(element.attachEvent){element.attachEvent('on'+name,A4J._observer);}}
> A4J._observer=function(evt){var 
> src=evt.target||evt.srcElement;if(src&&src.nodeName.toUpperCase()=='INPUT'&&src.type.toUpperCase()=='SUBMIT'){A4J._formInput=src;}else{A4J._formInput=null;}}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
richfaces-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/richfaces-issues

Reply via email to