• Post Reply Bookmark Topic Watch Topic
  • New Topic

Form Selfsubmit in JSF  RSS feed

 
Venkata
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Is there a way to submit a form by it self in jsf aftre certain time?
The form has to invoke a backing bean method or needs to redirect the url to another url by it self.

I am trying to logout the application using an intermedaite page.intermediate page basically forwards the request to another url and if the user clicks the backbutton the javascript function aleays forwards the page using history.forward.

Can any body help in resolving this issue?

Thanks
Ven
 
Bob Good
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a timer in a javascript to click a hidden submit button after 2 seconds:

setTimeout('submitJob();', 2000)

function submitJob() {
document.getElementById('backgroundJobForm:btnHideSubmit').click();
}

The btnHideSubmit button can invoke a backing bean action in the usual manner:

action="#{backgroundJobBean.onSubmitButtonPress}"




Bob
[ January 11, 2008: Message edited by: Bob Good ]
 
Venkata
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Bob.

I tried this option.Here is my scenarion.

I am trying to logging out the user from webseal session from a link the application.If i directly use response.redirect and the url/pkmslogout it does the task. But if the user clicks back button they can see all the data which they browsed through. I don't want this functionality when theylogged out but ineed this when they are in the application.That iswhay i can not use cache expiry techniques in jspspage. I wanted to first send the intermediate page when they click the signout and the this page auto submits after few milliseconds and the action method will be called by java script function and the action does the rest of the thing to logout. But even though my action is executed my intermedaite page is not registered in the history so that when the user clicks the backbutton it directly goes to the previous page not the intermediate page.If the application goes there i can forse the browser to go forward.

Hope i explained enough to under stand my issue. If this is not clear pls le me know.

Thanks
Ven
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!