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
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
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
--- 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
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
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
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
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
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,
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
10 matches
Mail list logo