I need to execute a JSF managed bean action method using ajax during HTML DOM load event, similar to jQuery's $(document).ready(function() { $.ajax(...) }). I can only use the JavaScript generated by JSF in this project. Is there a way to do it...
Problem: Sometimes you will want to access a component from javascript with getElementById, but id's are generated dynamically in JSF, so you need a method of getting an objects id.  I answer below on how you can do this.    Original Question:...
As an extension of this question, I'm trying to insert Javascript to a <h:commandButton />'s onclick property as action is already rendering an ajax table.  What I want to do: Get the selected items in a list box and turn them into pa...
I'm preparing some variables in JavaScript (in my specific case, I'd like to get GPS location):  function getVars() {     // ...     var x = locationInfo.lng;      var y = locationInfo.lat; }   I'd like to send them to my managed bean v...
I've a PrimeFaces web application. When I manually add jQuery and plugins like below,  <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="js/oneby...
Sometimes, I need to render a JavaScript variable using EL in a JSF page.  E.g.  <script>var foo = '#{bean.foo}';</script>   or  <h:xxx ... onclick="foo('#{bean.foo}')" />   This fails with a JS syntax erro...
I would like to use in my project highcharts and jsf both. I have a managedbean, which has a list and it is initializing by a facade (it do a query in my database). If I'd like to pass the value of the list to highcharts, how can do this? if anyo...
While analyzing the performance of a JSF 2.1 + PrimeFaces 4.0 webapp with Google PageSpeed, it recommends among others to defer parsing of JavaScript files. On a test page with a <p:layout> and a form with <p:watermark> and <p:fileUplo...
I need to add programmatically JS and CSS resources to <h:head> of JSF page. It isn't clear how to achieve this. Could someone give a hint or a kickoff example?...
Here is something so simple  <p:commandLink value="Tom" onclick="document.getElementById('tom').focus()"/><br/> <input id="tom"/>   When u click on the Tom, the textbox get focus. Great, now try this...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.