[richfaces-issues] [JBoss JIRA] Commented: (RF-4064) Problem with a4j:commandLink

Bob Corcoran (JIRA) jira-events at lists.jboss.org
Mon Aug 4 14:57:57 EDT 2008


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

Bob Corcoran commented on RF-4064:
----------------------------------

At the bottom of this message is the source for the entire page where the links are breaking when we set required="true" on an inputText and/or an inputTextarea. Sorry, it didn't format well when I copied it in.  I should add that whether I use an a4j command link or an html command link I see the same behavior.


Here is a summary of the input fields and the links that work and don't work:

These links break:
---------------------------------------------------------------------------------------------------------
<a4j:commandLink action="#{profileGroupBean.loadPersonalForums()}"> 
      <h:outputText value="Groups"/>
</a4j:commandLink>

<a4j:commandLink styleClass="link" rendered="#{profileGroupBean.privateView}" action="#{groupDetailsBean.setFilter   (groupDetailsBean.FILTER_NONE)}">
       <h:outputText value="#{groupDetailsBean.forum.forumMembers.size()} member(s)"/>
</a4j:commandLink>

<a4j:commandLink styleClass="add-link" action="#{groupDiscussionBean.setDiscussionId(discussion.id)}">
          <h:outputText value="#{discussion.topic}"/>
</a4j:commandLink>
---------------------------------------------------------------------------------------------------------------------------------------------------------


This link does not break
-----------------------------------------------------------------------------------------------------------------------------------------------------------
<a4j:commandLink id="authorLink" rendered="#{not empty discussion.rootMessage.creator.user.person}" 
					action="#{profileGroupBean.setForumMember(discussion.rootMessage.creator)}" 
							oncomplete="Richfaces.showModalPanel('authorViewPanel');" 
							reRender="authorAjaxPanel"
							title="Author">
							
							<h:graphicImage rendered="#{profileManager.hasImage(discussion.rootMessage.creator.user.personId)}"								
								height="16" styleClass="photo" alt="Photo" 
		                		url="servlet/imageServer?personId=#{discussion.rootMessage.creator.user.personId}&amp;height=16"></h:graphicImage>
		                		
		                	<h:graphicImage rendered="#{!profileManager.hasImage(discussion.rootMessage.creator.user.personId)}"
								height="16" styleClass="photo" alt="Photo" 
		                		url="http://espnfield/employees/Photo?employee_id=#{discussion.rootMessage.creator.user.personId}&amp;width=16&amp;height=16"></h:graphicImage>			                			                		
		                		
							<h:outputText value="&#160;#{discussion.rootMessage.creator.user.person.firstName} #{discussion.rootMessage.creator.user.person.lastName}" />																													
						</a4j:commandLink>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Here is one of  the input widgets

<h:inputText id="topic" size="70" maxlength="70" required="true" 
        value="#{groupDetailsBean.newTopic}" >
<f:validateLength maximum="70"></f:validateLength>						
</h:inputText>
---------------------------------------------------------------------------------------------------


The code for the entire xhtml page
------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!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:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xml:lang="en" lang="en">
	
<ui:composition>

<div id="content">         				     
		  <a4j:outputPanel id="createNewTopicPanel" layout="block" styleClass="tab-content">   
          	<div id="cookie-crumb">
          	    <a4j:commandLink action="#{profileGroupBean.loadPersonalForums()}"> 
          	        <h:outputText value="Groups"/>
          	    </a4j:commandLink>
          	    <h:outputText value=" -> #{groupDetailsBean.forum.name}"/>
          	</div>      
          		<rich:dataTable styleClass="data" rowClasses="even,odd" columnClasses="left,no-value,no-value,no-value,no-value" id="discussionsTable" rows="10" value="#{groupDetailsBean.discussions}" var="discussion">	
					<f:facet name="caption">
						<h:outputText><span class="title">#{groupDetailsBean.forum.name}</span><span class="link">
						<a4j:commandLink styleClass="link" rendered="#{profileGroupBean.privateView}" action="#{groupDetailsBean.setFilter(groupDetailsBean.FILTER_NONE)}">
						    <h:outputText value="#{groupDetailsBean.forum.forumMembers.size()} member(s)"/>
						</a4j:commandLink>
						</span></h:outputText>
					</f:facet>				
					<rich:column>
						<f:facet name="header">
							<h:outputText value="Topic" />
						</f:facet>												
						<a4j:commandLink styleClass="add-link" action="#{groupDiscussionBean.setDiscussionId(discussion.id)}">
						     <h:outputText value="#{discussion.topic}"/>
						</a4j:commandLink>
						<br/>						
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="Author" />
						</f:facet>												
												
						<a4j:commandLink id="authorLink" rendered="#{not empty discussion.rootMessage.creator.user.person}" 
							action="#{profileGroupBean.setForumMember(discussion.rootMessage.creator)}" 
							oncomplete="Richfaces.showModalPanel('authorViewPanel');" 
							reRender="authorAjaxPanel"
							title="Author">
							
							<h:graphicImage rendered="#{profileManager.hasImage(discussion.rootMessage.creator.user.personId)}"								
								height="16" styleClass="photo" alt="Photo" 
		                		url="servlet/imageServer?personId=#{discussion.rootMessage.creator.user.personId}&amp;height=16"></h:graphicImage>
		                		
		                	<h:graphicImage rendered="#{!profileManager.hasImage(discussion.rootMessage.creator.user.personId)}"
								height="16" styleClass="photo" alt="Photo" 
		                		url="http://espnfield/employees/Photo?employee_id=#{discussion.rootMessage.creator.user.personId}&amp;width=16&amp;height=16"></h:graphicImage>			                			                		
		                		
							<h:outputText value="&#160;#{discussion.rootMessage.creator.user.person.firstName} #{discussion.rootMessage.creator.user.person.lastName}" />																													
						</a4j:commandLink>
						
        				<h:outputText value="&#8212;" rendered="#{empty discussion.rootMessage.creator.user.person}"/>								
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="Replies" />
						</f:facet>												
						<h:outputText value="#{discussion.replies}" rendered="#{not empty discussion.replies}"/>
        				<h:outputText value="0" rendered="#{empty discussion.replies}"/>						
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="Views" />
						</f:facet>												
						<h:outputText value="#{discussion.views}" rendered="#{not empty discussion.views}"/>
        				<h:outputText value="0" rendered="#{empty discussion.views}"/>						
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="Last Post" />								
						</f:facet>												
						<span class="date"><h:outputText value="#{discussion.lastPost.creationDateTime}"><s:convertDateTime pattern="MMM dd, yyyy hh:mm a" type="both" /></h:outputText></span>
						<h:outputText value="&#8212;" rendered="#{empty discussion.lastPost.creationDateTime}"/>
						<br />
																							
						<a4j:commandLink id="lastPostLink" rendered="#{not empty discussion.lastPost.creator.user.person}" 
							action="#{profileGroupBean.setForumMember(discussion.lastPost.creator)}" 
							oncomplete="Richfaces.showModalPanel('authorViewPanel');" 
							reRender="authorAjaxPanel"
							title="Last Post">														
		                		
		                	<h:graphicImage rendered="#{profileManager.hasImage(discussion.lastPost.creator.user.personId)}"
								height="16" styleClass="photo" alt="Photo" 
		                		url="servlet/imageServer?personId=#{discussion.lastPost.creator.user.personId}&amp;height=16"></h:graphicImage>
		                		
		                	<h:graphicImage rendered="#{!profileManager.hasImage(discussion.lastPost.creator.user.personId)}"
								height="16" styleClass="photo" alt="Photo" 
		                		url="http://espnfield/employees/Photo?employee_id=#{discussion.lastPost.creator.user.personId}&amp;width=16&amp;height=16"></h:graphicImage>	
		                		
							<h:outputText value="&#160;#{discussion.lastPost.creator.user.person.firstName} #{discussion.lastPost.creator.user.person.lastName}" />															
						</a4j:commandLink>	
													
					</rich:column>		
					<f:facet name="footer">
                		<rich:datascroller />
            		</f:facet>			
				</rich:dataTable>
          		
            <h4><span class="title">Create New Topic</span><span class="link"><a name="post">&nbsp;</a></span></h4>               
              	 <f:facet name="beforeInvalidField">				          						        
					  <s:span styleClass="error"><h:graphicImage width="16" height="16" url="images/error.png"/><s:message/></s:span>					        
				  </f:facet>					    
				  <div>
				      <h:messages globalOnly="true"/>
				  </div>
				  <s:validateAll>	
					<h:panelGrid columns="2">
						<h:outputLabel id="subject-label" for="topic" value="Topic:" />
						<s:decorate>
						<h:inputText id="topic" size="70" maxlength="70" required="true" 
							value="#{groupDetailsBean.newTopic}" >
							<f:validateLength maximum="70"></f:validateLength>						
						</h:inputText>	
	                    </s:decorate> 
						<h:outputLabel id="body-label" for="description"
							value="Message:" />
						<s:decorate>	
						<h:inputTextarea id="description" rows="15" cols="70" required="true"
							value="#{groupDetailsBean.newDescription}">
							<f:validateLength maximum="255"></f:validateLength>
						</h:inputTextarea>						
	                    </s:decorate>
						<a4j:commandButton styleClass="btn-primary" id="createTopic" reRender="createNewTopicPanel"
								value="Post" action="#{groupDetailsBean.createTopic()}" />
						
					</h:panelGrid>
					</s:validateAll>				
          </a4j:outputPanel>
         
</div>
             
</ui:composition>

</html>          

> Problem with a4j:commandLink 
> -----------------------------
>
>                 Key: RF-4064
>                 URL: https://jira.jboss.org/jira/browse/RF-4064
>             Project: RichFaces
>          Issue Type: Bug
>         Environment: Windows
>            Reporter: Bob Corcoran
>            Assignee: Tsikhon Kuprevich
>            Priority: Minor
>
> We have a page with a few a4j:commandLinks as well as an h:inputText and h:inputTextarea, among other markup. It works fine until we add the attribute required="true" to either the inputText or InputTextarea. When we add the required="true" to either the inputText or InputTextarea, one of the a4j:commandLinks's (further up on the page) breaks. It still renders fine, but the method on the backing bean (in this case a SEAM stateful bean) is not called, because the link does not fire. What's even more odd is that the remaining a4j:commandLinks on the page continue to work according to specs. These links are contained in separate rich:column tags.

-- 
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

        



More information about the richfaces-issues mailing list