aspose file tools*
The moose likes Struts and the fly likes struts 2 autocomplete onchange not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts 2 autocomplete onchange not working" Watch "struts 2 autocomplete onchange not working" New topic
Author

struts 2 autocomplete onchange not working

sankar manoharan
Greenhorn

Joined: Dec 25, 2011
Posts: 10
Is there a way to add an onchange event to the s:autocompleter tag in struts? I need to call a javascript function when the selection changes.
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi,

May be you can try this one.



Refer to the http://struts.apache.org/2.x/docs/autocompleter.html
sankar manoharan
Greenhorn

Joined: Dec 25, 2011
Posts: 10
hi,

thanks for your reply..your code is not working for me.below is my sample code.how to achieve onchange in struts2 autocomplete tag.

onchange is not working
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<head>
<s:head theme="ajax" />
</head>

<s:label value="Select a group" />
<s:autocompleter theme="simple" id="tags" list="reporttablelistname" onchange="reporttable();" />
<script type="text/javascript">
function reporttable()
{
alert("hello");

}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts 2 autocomplete onchange not working