• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to call the jsf action using javascript  RSS feed

 
anwar pasha
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When we brows the image it will call the javascript and call command button action automatically.

<t:inputFileUpload id="file" value="#{banner_backing.uploadFile}" onblur="return myFormSubmit();" />


<h:commandButton value="Upload" id="up" action="#{banner_backing.updateBannerCheckedUpload}" />



function myFormSubmit() {

var formAction = document.UploadForm.action;
document.UploadForm.submit();
}
 
Shasi Mitra
Ranch Hand
Posts: 101
Flex Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
using the click method of your command button..eg: document.getElementById('myCommandButton').click();
 
anwar pasha
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks shasi ,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!