In some cases, HTML elements still need to be used in JSF due to certain limitations.
But HTML component is lack of AJAX support.
Thus, the objective of this post is to show how to add AJAX event to a HTML element without writing any javascript.
this can be achieved with <a4j:jsFunction /> in Richfaces and <p:remoteCommand /> in Primefaces.
Steps:
1. Define the AJAX action to be invoked in xhtml.
(a) Richfaces
(b) Primefaces
2. invoke the AJAX action in HTML element.
Done!!
But HTML component is lack of AJAX support.
Thus, the objective of this post is to show how to add AJAX event to a HTML element without writing any javascript.
this can be achieved with <a4j:jsFunction /> in Richfaces and <p:remoteCommand /> in Primefaces.
Steps:
1. Define the AJAX action to be invoked in xhtml.
(a) Richfaces
<a4j:jsFunction
name="updateIndexWhenOnclick"
action="#{testBean.updateIndex}"
render="[component id to render]">
</a4j:jsFunction>
(b) Primefaces
<p:remoteCommand
name="updateIndexWhenOnclick"
action="#{testBean.updateIndex}"
update="[component id to update]">
</p:remoteCommand>
2. invoke the AJAX action in HTML element.
<input type="checkbox" onclick="updateIndexWhenOnclick();" />
Done!!
Excellent post, it will be definitely helpful for many people. Keep posting more like this.
ReplyDeleteBest ccna Training in Chennai
ccna Training in Chennai
ccna course in Chennai
Angular 7 Training in Chennai
AngularJS Training in Chennai
Ethical Hacking Training in Chennai
CCNA course in Ambattur
CCNA course in T Nagar
CCNA course in OMR
I am glad that I saw this post. It is informative blog for us and we need this type of blog thanks for share this blog, Keep posting such instructional blogs and I am looking forward for your future posts.
ReplyDeleteCyber Security Projects for Final Year
JavaScript Training in Chennai
Project Centers in Chennai
JavaScript Training in Chennai
Thank you very much for this useful article. I like it. write essays for money
ReplyDeleteI enjoy your writing style really enjoying this web site . website design company nyc
ReplyDeleteWow really glad i came across your internet site, i??ll be sure to visit back now i??ve bookmarked it??. web design new york
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteUsually I don’t read this kind of stuff, but this was really interesting! branding agency sf
ReplyDeleteYou got a very fantastic website, Glad I observed it through yahoo. design agency san francisco
ReplyDeleteIEEE Cloud computing DOamin is a general term for anything that involves delivering hosted services over the Internet. cloud computing projects The cloud projects for cse is a metaphor for a global network of remote servers which operates as a single ecosystem, commonly associated with the Internet. IEEE FInal Year Networking Projects for CSE Domains Networking Projects cloud computing is the delivery of computing projects services—including servers, storage, databases, networking projects, software, analytics, and intelligence
ReplyDeleteJavaScript Training in Chennai
JavaScript Training in Chennai
site promotion will always be a tedious job but you can outsource site promotion on some indian or pakistani guy- los angeles web agency
ReplyDeleteevery sales manager and store owner should have a training in sales management* la web design
ReplyDeletethe travel packages that i have seen on the internet are sometimes oversold, they are cheap yet the inclusions sucks` web design agency los angeles
ReplyDeleteVery informative post. Your current Website style is awesome as well! website design agency
ReplyDeleteAdding AJAX to web pages has never been easier for us than it is now. And I give you credit for making it easy. You are absolutely wise man. Dissertation Writing Service
ReplyDeleteI believe there is a issue with your blog post making use of Opera web browser. Roblox code
ReplyDelete