commandLink with nested rich panel broken after re-rendering
akovcic Jan 22, 2008 2:19 PMHi,
I have a following simple example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html 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:rich="http://richfaces.ajax4jsf.org/rich" xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Test</title> </head> <body> <rich:panel> <a4j:form> <h:inputText value="#{testBean.value}"></h:inputText> <br/> <a4j:commandLink reRender="linkPanel"> <h:outputText value="Submit" /> </a4j:commandLink> </a4j:form> </rich:panel> <rich:panel id="linkPanel"> <a4j:form> <a4j:commandLink action="#{testBean.clear}" reRender="outputText"> <rich:panel style="width: 50px; text-align: center;">Clear</rich:panel> </a4j:commandLink> <br/> <h:outputText id="outputText" value="Value is: #{testBean.value}" /> </a4j:form> </rich:panel> </body> </html>
import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Scope; @Name("testBean") @Scope(ScopeType.SESSION) public class TestBean { private String value = ""; public void clear(){ value = ""; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } }
When above page is loaded the 'Clear' link works ok.
After typing some text and clicking 'Submit' link, which re-render 'linkPanel', the 'Clear' link is broken.
When looking at generated HTML in the second case tag has no body:
<a id="j_id8:j_id9" href="#" name="j_id8:j_id9" onclick="A4J.AJAX.Submit('_viewRoot','j_id8',event,{'parameters':{'j_id8:j_id9':'j_id8:j_id9'} ,'actionUrl':'/bex/test.seam?javax.portlet.faces.DirectLink=true'} );return false;"/> <div id="j_id8:j_id10" class="dr-pnl rich-panel" style="width: 50px; text-align: center;"> <div id="j_id8:j_id10_body" class="dr-pnl-b rich-panel-body">Clear</div> </div>
Looks like nested rich:panel is rendered outside tag. After refreshing the page link (html) is ok.
Is this a bug or some restriction of commandLink?
Thanks