Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts 2 autocomplete onchange not working

 
sankar manoharan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 299
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

May be you can try this one.



Refer to the http://struts.apache.org/2.x/docs/autocompleter.html
 
sankar manoharan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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");

}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic