struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sajidbigler <>
Subject Ajax functinality works but how to pass parameter to the request ?
Date Wed, 04 Mar 2009 09:33:09 GMT

Hi Friends,

I tried to check whether the user is available or not by using ajax
funtionality as shown below

In action i get parameter "id" but not "username" and i want a event to be
fired onblur to a testfield and using the textfield data i want to check
availability if the user does't exists in database then i want him to go to
next field to do entry and if the user exists in database then i need to
restrict him by asking him to select another username by clearing the
textfield.please help me to accomplish this

<script type="text/javascript">
   dojo.event.topic.subscribe("/after", function(data, request, widget){
      alert('inside a topic event. after request');
      //data : text returned from request
      //request: XMLHttpRequest object
      //widget: widget that published the topic

<s:url var="ajaxTest" includeParams="all"  value="/AjaxTest.action">
<s:param name="id" value="%{'22'}" />
 <s:param name="username" value="%{username}" />

<sx:bind id="ex4" href="%{#ajaxTest}" sources="username" targets="username"
events="onblur" afterNotifyTopics="/after" />

<s:textfield label="User Name" name="username" required="true"
requiredposition="left" id="username" />

public class AjaxTestForUserNameAvailability   extends ActionSupport{
	    private String username;
	   private boolean exist;
	    public String execute(){
	        return SUCCESS;

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message