• 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

Form at the bottom of the page

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have form at the bottom of the page, I don't want user after pressing "Enter" scroll all the way down to the bottom to see errors/correct input. Is there way to specify somehow fragment in URL, like "#someFormId".
It's possible to specify it for a <h:link> with "fragment" attribute, but I couldn't find anything on form's, form's commandButtons or wherever.
Nobody has forms anywhere except top of the page?
 
Zhomart Sadyakas
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One more related thing, is:
Suppose we have some kind of "quick" form, which popups or at some corner of the page, if user fills in some data and press submit button, then whenever error raised he would be redirected to "dedicated" page for this form, with all the errors shown there.
Is it possible ?
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you could code a JavaScript onload() function that would jump to a designated anchor link on the page. Normally you would be putting important stuff at the top of the page, so the first time in, at least, you'd usually want to be at the top of the page.

If you use AJAX to process the form, the page can update in place, so the user can be scrolled anywhere without having the browser jump to the top of the page.

For a non-AJAX approach it probably is better to just put the form on its own page, at the top of the page.

Actual use of the HTML "#" anchor indicator in JSF doesn't work, because JSF uses it internally.

I do have some pop-up dialogs done with RichFaces, and since they use the JSF error message facility, when the popup goes away, the error is visible in the error display on the page that hosts the dialog box.

Having said all that, I should remark that one of the advantages of JSF is that it makes it easy to put error messages close to the input controls that have the errors in them, so scrolling and such over messages isn't really all that important.
reply
    Bookmark Topic Watch Topic
  • New Topic