Re: html:select onchange

2005-07-24 Thread Wendy Smoak

From: Tony Smith [EMAIL PROTECTED]


html:select name=myform property=myfield
onchange=location.href='mynewpage.do?para=XX'
...
/html:select



http://www.javascriptkit.com/jsref/select.shtml

onChange=location.href='mynewpage.do?para='+options[selectedIndex].value;

Keep in mind that this can be *very* annoying in terms of UI design.  The 
user doesn't get a chance to correct a mistake; he changes one thing and 
suddenly he's off on some other page.


--
Wendy Smoak 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: html:select onchange

2005-07-24 Thread Tony Smith
Thank you very much for your post. I agree with you
and some user were complaining about the effect your
mentioned. My situition is that I have two selects,
once the users update one, I need to populate the
other with correspondent options. If I do not go to
another page, what is the best way to do? WOuld you
please give me some hits? THanks, again.


--- Wendy Smoak [EMAIL PROTECTED] wrote:

 From: Tony Smith [EMAIL PROTECTED]
 
  html:select name=myform property=myfield
 
 onchange=location.href='mynewpage.do?para=XX'
  ...
  /html:select
 
 
 http://www.javascriptkit.com/jsref/select.shtml
 

onChange=location.href='mynewpage.do?para='+options[selectedIndex].value;
 
 Keep in mind that this can be *very* annoying in
 terms of UI design.  The 
 user doesn't get a chance to correct a mistake; he
 changes one thing and 
 suddenly he's off on some other page.
 
 -- 
 Wendy Smoak 
 
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 





Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: html:select onchange

2005-07-24 Thread Wendy Smoak

From: Tony Smith [EMAIL PROTECTED]

Thank you very much for your post. I agree with you
and some user were complaining about the effect your
mentioned. My situition is that I have two selects,
once the users update one, I need to populate the
other with correspondent options. If I do not go to
another page, what is the best way to do? WOuld you
please give me some hits? THanks, again.


Not long ago I would have said your two options were to submit the form and 
re-display it with the new contents in the second select list, or else put 
everything in the page and make the changes with client side scripting.


But now, there's AJAX, and you can replace individual parts of the page 
seemingly by magic.  Someone who actually knows how it works will have to 
comment, but you can take a look at Frank's Java Web Parts project for an 
example:  http://javawebparts.sourceforge.net/


I don't quite see how you'd ask the Struts framework to render just one 
html:select tag without letting it process the entire page so it would 
have the information from the enclosing html:form tag.


FWIW, my original suggestion can be reduced to:
  onChange='mynewpage.do?para='+value;

--
Wendy Smoak 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: html:select onchange question

2004-05-19 Thread Tom McCobb
I got it.  The form bean referred to in the stmtDetail.do (DetailForm)is a
different one than where the selMtr property lives (HeaderForm), and I just
had to loop through a mapping that took me through the HeaderForm first.

-Original Message-
From: Tom McCobb [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 19, 2004 6:59 PM
To: [EMAIL PROTECTED]
Subject: html:select onchange question


I have read most of the archived messsages on this subject, and I am still
left with questions.  Here is my basic problem:  When I change the value of
the SELECT by selecting a new option, I expect the new value to be set in
the form bean.  I then want to be able to retrieve the value from the form
bean to pass as a parameter to a method in another action class.  I am doing
this instead of request.getParameter('xxx') just as a matter of preference
to keep everything in the form beans.  Here is the code from the jsp:

html:form   action=stmtDetail.do?method=getStmtDetail
html:select name=HeaderForm property=selMtr 
onchange=submit()
   html:option value=0Current Costs/html:option
   html:optionsCollection name=HeaderForm property=stmts
   label=fullDate
   value=batchNo /
/html:select
/html:form

From the debug statements in my stmtDetail.do action class, where I call a
getSelMtr() on the appropriate form bean, no value is passed.  Apparently
the submit() just triggers the stmtDetail.do before the changed value gets
set in the HeaderForm???

So what is the solution?

T. McCobb


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]