You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Giovanni Azua Garcia (JIRA)" <ji...@apache.org> on 2007/12/05 15:37:35 UTC

[jira] Updated: (WW-2356) autocompleter widget fails to publish topic in some cases

     [ https://issues.apache.org/struts/browse/WW-2356?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Giovanni Azua Garcia updated WW-2356:
-------------------------------------

    Description: 
Given the JSP page below, autocompleter fails to publish the required topic "/changedHistoricBook0" in the following use case:

- User types a substring  
- The user clicks on the top suggested (bold) matching element.

In that case the notify does not happen. though, when the user clicks the second choice the topic is published correctly.

<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

<script type="text/javascript">
  dojo.event.topic.subscribe("/afterExchangeRateReloaded", function(data, request, widget)
  {
     //data : text returned from request
     //request: XMLHttpRequest object
     //widget: widget that published the topic
     widget.setSelectedKey("value");
  });  
</script>

<s:url var="exchangeRates" action="AjaxGetExchangeRates.action" />

<s:form id="formSimulation" action="%{targetAction}" method="post" theme="%{currentTheme}">
<sx:autocompleter tooltip="Provide the first Historic Book" forceValidOption="true" valueNotifyTopics="/changedHistoricBook0"  notifyTopics="/changedHistoricBook0" searchType="substring" label="Historic Book 1" cssStyle="width: 250px;" dropdownHeight="180"  name="historicBook0" list="historicBooks" listKey="id" listValue="name" />		
<!-- etc -->
<sx:autocompleter id="eurosPerListedUnit0" tooltip="Provide the Currency Rate 1" formId="formSimulation" showDownArrow="false" 
cssStyle="width: 250px;" href="%{#exchangeRates}" listenTopics="/changedHistoricBook0" label="Currency Rate 1" name="eurosPerListedUnit0" autoComplete="false" afterNotifyTopics="/afterExchangeRateReloaded" />
<s:submit value="%{buttonLabel}" align="center"/>
</s:form>

  was:
Given the JSP page below, autocompleter fails to publish the required topic "/changedHistoricBook0" in the following use case:

- User types a substring  
- The user clicks on the top suggested (bold) matching element.

In that case the notify does not happen. When the user clicks the second choice the topic is published correctly.

<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

<script type="text/javascript">
  dojo.event.topic.subscribe("/afterExchangeRateReloaded", function(data, request, widget)
  {
     //data : text returned from request
     //request: XMLHttpRequest object
     //widget: widget that published the topic
     widget.setSelectedKey("value");
  });  
</script>

<s:url var="exchangeRates" action="AjaxGetExchangeRates.action" />

<s:form id="formSimulation" action="%{targetAction}" method="post" theme="%{currentTheme}">
<sx:autocompleter tooltip="Provide the first Historic Book" forceValidOption="true" valueNotifyTopics="/changedHistoricBook0"  notifyTopics="/changedHistoricBook0" searchType="substring" label="Historic Book 1" cssStyle="width: 250px;" dropdownHeight="180"  name="historicBook0" list="historicBooks" listKey="id" listValue="name" />		
<!-- etc -->
<sx:autocompleter id="eurosPerListedUnit0" tooltip="Provide the Currency Rate 1" formId="formSimulation" showDownArrow="false" 
cssStyle="width: 250px;" href="%{#exchangeRates}" listenTopics="/changedHistoricBook0" label="Currency Rate 1" name="eurosPerListedUnit0" autoComplete="false" afterNotifyTopics="/afterExchangeRateReloaded" />
<s:submit value="%{buttonLabel}" align="center"/>
</s:form>


> autocompleter widget fails to publish topic in some cases   
> ------------------------------------------------------------
>
>                 Key: WW-2356
>                 URL: https://issues.apache.org/struts/browse/WW-2356
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.x
>         Environment: Fedora 6, Tomcat 6.x, JDK 1.6.0_02, Firefox 1.5.x
>            Reporter: Giovanni Azua Garcia
>            Priority: Minor
>
> Given the JSP page below, autocompleter fails to publish the required topic "/changedHistoricBook0" in the following use case:
> - User types a substring  
> - The user clicks on the top suggested (bold) matching element.
> In that case the notify does not happen. though, when the user clicks the second choice the topic is published correctly.
> <%@ page contentType="text/html; charset=UTF-8"%>
> <%@ taglib prefix="s" uri="/struts-tags"%>
> <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
> <script type="text/javascript">
>   dojo.event.topic.subscribe("/afterExchangeRateReloaded", function(data, request, widget)
>   {
>      //data : text returned from request
>      //request: XMLHttpRequest object
>      //widget: widget that published the topic
>      widget.setSelectedKey("value");
>   });  
> </script>
> <s:url var="exchangeRates" action="AjaxGetExchangeRates.action" />
> <s:form id="formSimulation" action="%{targetAction}" method="post" theme="%{currentTheme}">
> <sx:autocompleter tooltip="Provide the first Historic Book" forceValidOption="true" valueNotifyTopics="/changedHistoricBook0"  notifyTopics="/changedHistoricBook0" searchType="substring" label="Historic Book 1" cssStyle="width: 250px;" dropdownHeight="180"  name="historicBook0" list="historicBooks" listKey="id" listValue="name" />		
> <!-- etc -->
> <sx:autocompleter id="eurosPerListedUnit0" tooltip="Provide the Currency Rate 1" formId="formSimulation" showDownArrow="false" 
> cssStyle="width: 250px;" href="%{#exchangeRates}" listenTopics="/changedHistoricBook0" label="Currency Rate 1" name="eurosPerListedUnit0" autoComplete="false" afterNotifyTopics="/afterExchangeRateReloaded" />
> <s:submit value="%{buttonLabel}" align="center"/>
> </s:form>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.