Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Focus after partial submit

 
jeff rusty
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

thanks
jeff
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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: "http://www.javaranch.com".

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic