This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JSF and the fly likes Form at the bottom of the page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Form at the bottom of the page" Watch "Form at the bottom of the page" New topic
Author

Form at the bottom of the page

Zhomart Sadyakas
Greenhorn

Joined: Apr 13, 2011
Posts: 10
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

Joined: Apr 13, 2011
Posts: 10
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 ?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15629
    
  15

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Form at the bottom of the page
 
Similar Threads
form Name
Default value in dropdown list after submitting page
arabic characters strust + tomcat
View stored blob image in the UI using java
Is it possible to specify inline frame in action attribute (in html form tag)?