File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Focus after partial submit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Focus after partial submit" Watch "Focus after partial submit" New topic

Focus after partial submit

jeff rusty
Ranch Hand

Joined: Nov 07, 2006
Posts: 109
Hi ,

I have a lengthy view page and at the bottom of the page i have a delete button which will delete any of the selected record on the page after deletion i am displaying a message but the focus is not going to the message instead it stays where the delete button is placed. so how to focus the message after deletion happens.

I am doing partial submit when clicking the delete button. I am using trinidad.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

"Focus" is short for "Input focus", and it applies to input controls, not output data.

However, if what you mean is "How do I ensure that the message text is displayed in the visible part of the window?" you should be able to wrap the message in an HTML anchor tag and direct the browser to "go to" the anchor tag.

The HTML anchor is the <a> tag. Although most famous for its "href" attribute, it also allows how to define a link target by name. You indicate the name as part of the URL by preceeding it with a "#". Like: "".

In the case of a partial page (AJAX) submit, you should be able to find a JavaScript method that will scroll the element into view.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Focus after partial submit
It's not a secret anymore!