• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

IE problem with onchange - submit

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The following code does not call the event handler in IE. It works fine in mozilla-based browsers. Does the onchange call need more information to find the eventhandler in IE? Something like this.form.submit?

Any help is appreciated.

Ed

from the jsf page:

<h:selectOneMenu value="#{bdorder.delivyear}" onchange="submit()" valueChangeListener="#{bdorder.delivyearChanged}">
<f:selectItems value="#{bdcommon.years}"/>
</h:selectOneMenu>

from the backing bean - bdorder:

public void delivyearChanged(ValueChangeEvent event) {
String ryear = (String) event.getNewValue();
setDelivyear(ryear);
}

String delivyear;
/**
* @return Returns the delivyear.
*/
public String getDelivyear() {
return delivyear;
}
/**
* @param delivyear The delivyear to set.
*/
public void setDelivyear(String delivyear) {
this.delivyear = delivyear;
}


from backing bean - bdcommon

SelectItem[] years = {
new SelectItem("2004", "2004"),
new SelectItem("2005", "2005"),
new SelectItem("2006", "2006"),
new SelectItem("2007", "2007"),
new SelectItem("2008", "2008"),
new SelectItem("2009", "2009")
};
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try "document.form.submit()".
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried:
<h:selectOneMenu value="#{bdorder.delivyear}" onchange="submit()" valueChangeListener="#{bdorder.delivyearChanged}" immediate="true">
 
Ed Mahoney
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you both for the replies. Changing the eventhandler call to document.form.submit breaks firefox as well. However, this.form.submit works for firefox with IE still not calling the event handler.

And I should have been using immediate="true", but that has no effect on this problem. The html generated is the same in both cases.

When you change the menu in IE, IE does a page refresh but the values are set back to the original setting and the handler is not called. I'm convinced that this is a problem in the reference to the handler.

Thank you both for your attention.

Ed
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had the same problem except it wouldn't work in both browsers. I posted the problem here. What I found out, which I haven't test in Firefox yet is the solution I provided earlier, except I left one thing out. I used the form id so it was something like:

document.form1.submit()

I don't know why or if that would make a difference, but I just wanted to point that out.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just tested in both Firefox and IE. Works great in both.
reply
    Bookmark Topic Watch Topic
  • New Topic