Populate two fields with one value

2007-05-18 Thread Mansour
how to populate 2 fields in my action with one value ? for example I need to populate the first name and last name with one value for searching: s:form action=searchAccount method=post theme=xhtml h4 Search Account /h4 s:textfield label=id name=acc.id / s:textfield label=AccountName Contains

Re: Populate two fields with one value

2007-05-18 Thread Guillaume Carré
2007/5/18, Mansour [EMAIL PROTECTED]: how to populate 2 fields in my action with one value ? for example I need to populate the first name and last name with one value for searching: try this: s:form action=searchAccount method=post theme=xhtml h4 Search Account /h4 s:textfield label=id

Re: Populate two fields with one value

2007-05-18 Thread Mansour
I tried it. It's not working either. Guillaume Carré wrote: 2007/5/18, Mansour [EMAIL PROTECTED]: how to populate 2 fields in my action with one value ? for example I need to populate the first name and last name with one value for searching: try this: s:form action=searchAccount

Re: Populate two fields with one value

2007-05-18 Thread Dave Newton
--- Mansour [EMAIL PROTECTED] wrote: I tried it. It's not working either. What do you mean, populate two values in your action with one value? Under what circumstances would that population happen? Are you filling out a search form and attempting to search based on what was actually filled out

Re: Populate two fields with one value

2007-05-18 Thread Lance
Do you have the approptriate getters and setters? eg action.getAcc().setFirstName() action.getAcc().setLastName() Mansour wrote: I tried it. It's not working either. Guillaume Carré wrote: 2007/5/18, Mansour [EMAIL PROTECTED]: how to populate 2 fields in my action with one value ? for

Re: Populate two fields with one value

2007-05-18 Thread Ed Griebel
You should probably be doing this in your action class, not your JSP. If it should always be set to acc.firstName, then you could just hardcode a hidden field: input type=hidden value=${acc.firstName}/ On 5/18/07, Mansour [EMAIL PROTECTED] wrote: how to populate 2 fields in my action with one

Re: Populate two fields with one value

2007-05-18 Thread Mansour
Yes, I do have the correct setters for the Account object. Lance wrote: Do you have the approptriate getters and setters? eg action.getAcc().setFirstName() action.getAcc().setLastName() Mansour wrote: I tried it. It's not working either. Guillaume Carré wrote: 2007/5/18, Mansour [EMAIL

Re: Populate two fields with one value

2007-05-18 Thread Adam Ruggles
I have to ask... why don't you just set it in the action? public String execute() throws Exception { this.lastName = this.firstName; ... } Mansour wrote: Yes, I do have the correct setters for the Account object. Lance wrote: Do you have the approptriate getters and setters? eg

Re: Populate two fields with one value

2007-05-18 Thread Mansour
Yes, I am going to do this in my action. But out of curiosity, I would like to know how to do this. I tried what you did (in my original post) and didn't work. Ed Griebel wrote: You should probably be doing this in your action class, not your JSP. If it should always be set to acc.firstName,

Re: Populate two fields with one value

2007-05-18 Thread Laurie Harper
It didn't work because you're saying 'set this hidden field to the value the user hasn't entered yet': s:textfield label=... name=acc.firstName id=fn / s:hidden name=acc.lastName value=${fn} / In other words, what that says is 'set the value of the acc.lastName input to the value