Ok, I found, targets property in the submit button.
Thanks.

Manuel Correa.

-----Original Message-----
From: Manuel Correa [mailto:[EMAIL PROTECTED] 
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:

 

Form:

 

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

        loadingText="Loading information..." 

        errorText="Unable to contact server"

        href="${pageContext.request.contextPath}/success.jsp"

        listenTopics="/refresh" 

        > 

        

</s:div>

 

 

<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"    />

</s:form>

 

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(){

      try{

 

            personDAO.persist(person);

            System.out.println("person->"+person.getId());

            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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to