Wrong render with ajax
diegocoronel Nov 21, 2007 3:20 PMHey, i got this situation, when my commandLink is rendered by ajax they are not correct, but when i render this same commandLink without ajax its correct, my codes:
this is da page that include my commandLink
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:fpf="http://www.fpf.br/jsf" xmlns:c="http://java.sun.com/jstl/core"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> #{br.fpf.components.masterDetail.MasterDetailController.addLista(detailList)} #{br.fpf.components.masterDetail.MasterDetailController.initObject(type)} <h:panelGrid columns="1" id="panelGrid" width="100%"> <a4j:region selfRendered="true" rendered="#{br.fpf.components.masterDetail.MasterDetailController.state == 0}"> <ui:include src="/components/fpf_masterDetail/fpf_gridMasterDetail.xhtml" /> </a4j:region> </h:panelGrid> <h:panelGrid columns="1" width="100%" id="panelUpdate"> <a4j:region selfRendered="true" rendered="#{br.fpf.components.masterDetail.MasterDetailController.state == 1}"> <ui:include src="/components/fpf_masterDetail/fpf_updateMasterDetail.xhtml" /> </a4j:region> </h:panelGrid> </ui:composition>
this is the page With my commandLink
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:rich="http://richfaces.org/rich" xmlns:fpf="http://www.fpf.br/jsf" xmlns:c="http://java.sun.com/jstl/core"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <ui:insert name="update_form"/> <h:panelGrid columns="2"> <a4j:commandLink reRender="panelGrid, panelUpdate" action="#{br.fpf.components.masterDetail.MasterDetailController.update()}"> <fpf:fpf_button labelButton="Update" id="b1321" /> </a4j:commandLink> <a4j:commandLink reRender="panelGrid, panelUpdate" action="#{br.fpf.components.masterDetail.MasterDetailController.cancelStateUpdate()}" immediate="true"> <fpf:fpf_button labelButton="Cancelar" id="b232132" /> </a4j:commandLink> </h:panelGrid> </ui:composition>
this is the page that will render my commandLink
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:rich="http://richfaces.org/rich" xmlns:fpf="http://www.fpf.br/jsf" xmlns:c="http://java.sun.com/jstl/core"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <fpf:fpf_grid dados="#{detailList}"> <ui:insert name="grid" /> <h:column> <a4j:commandLink reRender="panelGrid,panelUpdate" action="#{br.fpf.components.masterDetail.MasterDetailController.changeStateUpdate}"> Editar <f:setPropertyActionListener value="#{item}" target="#{br.fpf.components.masterDetail.MasterDetailController.detail}" /> </a4j:commandLink> </h:column> <h:column> Excluir </h:column> </fpf:fpf_grid> </ui:composition>
this is the code with ajax render, we can see that my link opens and close and the content isnt inside the link --> thats wrong
<a id="j_id12:j_id85" href="#" name="j_id12:j_id85" onclick="A4J.AJAX.Submit('j_id12:j_id80','j_id12',event,{'parameters':{'j_id12:j_id85':'j_id12:j_id85'} ,'actionUrl':'/components/test/fpf_masterDetail/masterDetail.seam'} );return false;"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="/components/components/fpf_button/css/fpf_button.css"> </link> <script language="JavaScript" type="text/javascript" src="/components/components/fpf_button/script/fpf_button.js"> </script> <table cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td id="leftCornerb1321" class="fundoEsq" width="7" valign="middle" onmouseover="goLite('labelButtonb1321','fpf_Buttonb1321','leftCornerb1321','rightCornerb1321')" onmouseout="goDim('labelButtonb1321','fpf_Buttonb1321','leftCornerb1321','rightCornerb1321')"/> <td id="fpf_Buttonb1321" class="fundoMeio" valign="middle" height="28" onmouseover="goLite('labelButtonb1321','fpf_Buttonb1321','leftCornerb1321','rightCornerb1321')" onmouseout="goDim('labelButtonb1321','fpf_Buttonb1321','leftCornerb1321','rightCornerb1321')"> <div id="labelButtonb1321" class="txtButton"> Update </div> </td> <td id="rightCornerb1321" class="fundoDir" width="7" valign="middle" onmouseover="goLite('labelButtonb1321','fpf_Buttonb1321','leftCornerb1321','rightCornerb1321')" onmouseout="goDim('labelButtonb1321','fpf_Buttonb1321','leftCornerb1321','rightCornerb1321')"/> </tr> </tbody> </table>
this is the code without ajax, i did a refresh in the page, we can see that my link open, my content is inside than my link close
<a id="j_id12:j_id34" href="#" name="j_id12:j_id34" onclick="A4J.AJAX.Submit('j_id12:j_id29','j_id12',event,{'parameters':{'j_id12:j_id34':'j_id12:j_id34'} ,'actionUrl':'/components/test/fpf_masterDetail/masterDetail.seam'} );return false;"> <head> </head> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td id="leftCornerb1321" class="fundoEsq" width="7" valign="middle" onmouseover="goLite('labelButtonb1321','fpf_Buttonb1321','leftCornerb1321','rightCornerb1321')" onmouseout="goDim('labelButtonb1321','fpf_Buttonb1321','leftCornerb1321','rightCornerb1321')"/> <td id="fpf_Buttonb1321" class="fundoMeio" valign="middle" height="28" onmouseover="goLite('labelButtonb1321','fpf_Buttonb1321','leftCornerb1321','rightCornerb1321')" onmouseout="goDim('labelButtonb1321','fpf_Buttonb1321','leftCornerb1321','rightCornerb1321')"> <div id="labelButtonb1321" class="txtButton"> Update </div> </td> <td id="rightCornerb1321" class="fundoDir" width="7" valign="middle" onmouseover="goLite('labelButtonb1321','fpf_Buttonb1321','leftCornerb1321','rightCornerb1321')" onmouseout="goDim('labelButtonb1321','fpf_Buttonb1321','leftCornerb1321','rightCornerb1321')"/> </tr> </table> </a>
So, is this a bug ? or i need to do something ?