struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manuel Correa" <>
Subject RE: get properties action for theme ajax
Date Wed, 08 Aug 2007 20:16:09 GMT
Ok, I found, targets property in the submit button.

Manuel Correa.

-----Original Message-----
From: Manuel Correa [] 
Sent: Wednesday, August 08, 2007 4:04 PM
To: Struts Users Mailing List
Subject: get properties action for theme ajax

How I get the properties (variable result) when the for is submit with
Ajax theme, look:




<s:div theme="ajax" id="success"

        loadingText="Loading information..." 

        errorText="Unable to contact server"








<s:form action="Person_save" id="person"  >

<s:textfield name="person.firstName" id="person.firstName"
label="FirstName"  />

<s:textfield name="person.lastName" id="person.lastName"
label="LastName"  />

<s:textfield name="person.age" id="person.age" label="age"  />   

<s:submit theme="ajax" notifyTopics=/save,/refresh"    />



The Person_save is a action that return success or error and set one var
names "msg" when some message to the user, I want to show that message,
if I don't use the Ajax Theme, everything is fine. 


public String save(){





            msg = "The data was save in DB";

            return Action.SUCCESS;

            }catch(Exception e){

                  msg = "Error saving Data!!";

                  return Action.ERROR;





Manuel Correa.


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

View raw message