[richfaces-issues] [JBoss JIRA] Commented: (RF-4290) Suggestion Box bug: Revisit RF-923

Brendan Farragher (JIRA) jira-events at lists.jboss.org
Tue Aug 26 08:12:39 EDT 2008


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

Brendan Farragher commented on RF-4290:
---------------------------------------

Hi. Modal panel in my example *IS* within a single form (in fact, there is only one form in the entire application, so no form nesting is involved here). The modal panel functionality works just fine, and has nothing to do with the issue that I am raising, other than providing *context* for the bug. The SUGGESTION BOX BUG occurs when placing a textbox, with a suggestion box tag associated with it, *within* the modal panel tag. This causes erroneous behavior in the *suggestion box* tag functionality.

It is the same erroneous behavior that is explained in RF 923, within the context of the modal panel tag. Again, the suggestion box tag displays it's list on the modal panel without any problem after you begin typing in a term. But the modal panel tag wrapping the suggestion box is the context in which making a selection from the suggestion box drop down list produces a null value being passed to the target method for onselect.

> Suggestion Box bug: Revisit RF-923
> ----------------------------------
>
>                 Key: RF-4290
>                 URL: https://jira.jboss.org/jira/browse/RF-4290
>             Project: RichFaces
>          Issue Type: Bug
>    Affects Versions: 3.2.1
>         Environment: JBoss 4.2.2
>            Reporter: Brendan Farragher
>            Assignee: Nick Belaevski
>
> I have discovered the following suggestion box bug in a different context that has been reported as being fixed by JIRA RF-923:
> https://jira.jboss.org/jira/browse/RF-923;jsessionid=691170C187DCB362DD9AB95D05F61693
> The context is the following:
> I have a JSP include that contains a JSF subview and a RF modal panel tag. Within the modal panel tag, I have an HTML table. One of the table cells contains a textfield that has a RF suggestion box tag associated. The drop-down list is displayed after typing, but when a selection is made, the result variable (which is a Hibernate pojo) is not passed to the setter method that I have specified as the target on the f:setPropertyActionListener tag. Through logging messages, I see that the method is fired when a selection event occurs. The problem is that the variable is null, just as the behavior states in the RF-923 bug.
> In the example below, the setSuggestionBoxNameLookupResult method is passed a null value when the selection is made from the drop down list.
> Here is the JSP that is brought in as a subview to the main JSF JSP page via a JSP include tag:
> <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
> 	
> <f:subview id="nameModalWindowSubView">
> 		
>     <rich:modalPanel id="lookupModalPanel" width="500" height="250">
>         <f:facet name="header">
>             <h:outputText value="#{msgs.header}"/>
>         </f:facet>
>         
>         <table id="lookupGrid">
>         <tbody>
>         <tr>
>         	<td scope="row" class="cellInfo">
>         		<h:outputText value="#{msgs.findLabelText}"/>
>         	</td>
>         	
> 			<td scope="row" class="cellInfo">
> 					
> 				<a4j:region id="findNameRegion">
> 					
> 				<h:inputText id="findName" styleClass="LongInput" maxlength="30" value="#{bean.findName}"/>
> 					
> 				<%-- Suggestion box RichFaces tag for name. Performs name lookup and displays drop down list.	--%>
> 				<%-- When a selection is made, several fields are re-rendered with the selected values. 	--%>
> 				<%-- NOTE:	There is a bug in version 3.1.0 of RichFaces where the         		--%>
> 				<%--		setPropertyActionListener target method gets passed a null     		--%>
> 				<%--		parameter, instead of the selected DB pojo. An upgrade to version   	--%>
> 				<%--        3.2.1 was required to fix it. RichFaces 3.2 jars are present in the 	--%>
> 				<%--		WEB-INF/lib folder, to correct this problem				--%>
> 			
> 				<rich:suggestionbox
> 				   width="#{bean.suggestionBoxWidth}" 
> 				   height="#{bean.suggestionBoxHeight}"
> 			       id="nameSuggestBox"
> 			       styleClass="nameSuggestBox"
>             	   for="findName"
> 				   ajaxSingle="true"
>               	   suggestionAction="#{bean.autoComplete}" var="result"
>               	   fetchValue="#{result.field1}"
>               	   nothingLabel="#{msgs.suggestionBoxNoMatchText}">
>                 	<h:column>
>                     	<h:outputText value="#{result.field1}" />
>                		</h:column>
>                 	<h:column>
>                     	<h:outputText value="#{result.field2}" />
>                		</h:column>
>                 	<h:column>
>                     	<h:outputText value="#{result.field3}" style="font-style:italic"/>
>                		</h:column>
>                 	<h:column>
>                     	<h:outputText value="#{result.field3}" />
>                 	</h:column>
>                 
> 			<a4j:support event="onselect" timeout="#{bean.suggestionBoxSelectionEventAjaxTimeout}">
>   					<f:setPropertyActionListener value="#{result}" target="#{bean.suggestionBoxNameLookupResult}" />	
> 			</a4j:support>
> 					
> 			</rich:suggestionbox>
> 					
> 			</a4j:region>
> 		</td>
> 		<td>
> 		<button type="button" onClick="javascript:processNameLookup()">OK</button>
> 		</td>
> 		<td>
> 		<button type="button" onClick="javascript:closeNameLookupWindow()">Close</button>
> 		</td>
> 		</tr>
> 		</tbody>
> 		</table>
>         
>     </rich:modalPanel>
> 	<button type="button" onClick="javascript:showNameLookupWindow()">Name Lookup</button>
>     
> </f:subview> 

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