CLONE -Autocomplenter don't submit the attribute value to the url action when use valueNotifyTopics. ----------------------------------------------------------------------------------------------------
Key: WW-2690 URL: https://issues.apache.org/struts/browse/WW-2690 Project: Struts 2 Issue Type: Bug Components: Plugin - Dojo Tags Affects Versions: 2.1.0, 2.1.1, 2.1.2 Environment: Windows Server 2003, JDK1.5.0.11, Tomcat5.5.25, IE 7 & Firefox2 Reporter: Wilson M Penha Jr. Fix For: 2.1.3 I got three days running on this issue, and now I could identify what happens and when, but I could not say why? I'm doing one app with Struts2.1.x, Spring2.5.x, Hibernate3. I've been trying to run a autocompleter with valueNotifyTopics to another component such as <s:div and/or <s:autocompleter. See my code: .jsp <form id="formEditar"> <s:textfield theme="simple" id="id" name="proposta.id" cssStyle="display:none"/> <sx:autocompleter id="condicaoPagamentoId" name="proposta.condicaoPagamento.id" list="condicaoPagamentoList" keyName="proposta.condicaoPagamento.id" listKey="id" listValue="descricao" valueNotifyTopics="/condicaodepagamento" forceValidOption="true" /> <s:url var="getParcelas" namespace="/proposta" action="gerarParcelas"> </s:url> <sx:div id="divParcelas" href="%{#getParcelas}" listenTopics="/condicaodepagamento" formId="formEditar" autoStart="true"> </sx:div> </form> struts.xml <package name="proposta" extends="struts2" namespace="/proposta"> <action name="gerarParcelas" class="propostaAction" method="gerarParcelas"> <interceptor-ref name="defaultStack"> <param name="validation.excludeMethods">gerarParcelas</param> </interceptor-ref> <result>/WEB-INF/jsp/proposta/parcelas.jsp</result> </action> </package> Behave 1 at IE7: When I open my jsp it isn't sending the value for "proposta.condicaoPagamento.id" to my action, it appears as null, causing an error. Behave 2 at IE7: I changed the "proposta.id" attribute to be set with <input type="hidden"...> instead <s:textfield...>, so when I open my jsp I got another exception before it reach the action, is was: java.lang.NumberFormatException: For input string: "[Ljava.lang.String;@1d1cd0d" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Long.parseLong(Unknown Source) at java.lang.Long.parseLong(Unknown Source) ..... ognl.MethodFailedException: Method "setId" failed for object [EMAIL PROTECTED] [java.lang.NoSuchMethodException: setId([Ljava.lang.String;)] .... expr: proposta.condicaoPagamento.id val: [Ljava.lang.String;@1d1cd0d context: [EMAIL PROTECTED] root:[EMAIL PROTECTED], [EMAIL PROTECTED] value: [Ljava.lang.String;@1d1cd0d 2008-06-07 12:29:30,234 ERROR (com.opensymphony.xwork2.interceptor.ParametersInterceptor:24) - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'proposta.condicaoPagamento.id' on 'class scoweb.app.action.PropostaAction: Error setting expression 'proposta.condicaoPagamento.id' with value '[Ljava.lang.String;@1d1cd0d' 2008-06-07 12:29:30,515 ERROR (org.apache.struts2.dispatcher.Dispatcher:28) - Could not find action or result No result defined for action scoweb.app.action.PropostaAction and result input at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:357) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:259) ............. The attribute type for Id is set to Long private Long Id; setId(Long id)... Long getId()... Behave 3 at Firefox: For both cases it's show the same as Behave 2 does. I tried to change the attributes from the autocompleter to do like the showcase example, see what happens: .jsp <s:textfield theme="simple" id="id" name="proposta.id" cssStyle="display:none"/> <sx:autocompleter name="select" list="{'fruits','colors'}" value="colors" valueNotifyTopics="/condicaodepagamento" forceValidOption="true" /> <s:url var="getParcelas" namespace="/proposta" action="gerarParcelas"> </s:url> <sx:div id="divParcelas" href="%{#getParcelas}" listenTopics="/condicaodepagamento" formId="formEditar" autoStart="true"> </sx:div> Behave 1 at IE7 The attribute "select" appears as null into the action Behave 2 at IE7: I changed the "proposta.id" attribute to be set with <input type="hidden"...> instead <s:textfield...>, so when I open my jsp the "select" attribute was right populated. Behave 3 at Firefox2. In both cases the attribute "select" was filled by the action. Now I'm stuck on that and asking for help for you guys. NOTE: If just use a <s:select...> component instead <s:autocompleter...> to select the "proposta.condicaoPagamento.id" and ignoring the <s:div...> thing, it just work as should. Thanks and regards, Wilson M. Penha Jr. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.