Tuesday, August 5, 2014

Pass bean properties to JavaScript function


In the JavaScript function call include bean properties in quotes

for example:

<h:form>
  <h:commandButton type="button" value="JavaScript Call" onclick="printInfo('#{person.firstName}', '#{person.lastName}')"/>
</h:form>

The JavaScript function for this is shown in the following code:

<script type="text/javascript">
  function printInfo(name, lastName) {
    alert("Name: " + name + " " + lastName);
  }
</script>

14 comments:

  1. What will happen if property has quoute?

    ReplyDelete
  2. This did not work for me. The alert says: undefined
    Can you make the project available?

    ReplyDelete
  3. Nicely written. it helped. Thank toy

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Nice Article. We are authorised support partner in Quickbooks Payroll. If you required any help for Quickbooks Payroll Support Phone Number 1-800-986-4607 if you are Expand your business to a new hike, with progressive approach. Seeking for the best accounting software? Then, get quickbooks installed in your system. The software proves to be more profitable to the business

    ReplyDelete
  6. The ability to change the basic properties, https://www.resumeperk.com/blog/page/3/ can incredibly dramatically change the final result because it is not yet fully defined.

    ReplyDelete

  7. QuickBooks Support +1-877-651-8034 QuickBooks is considered as the best accounting software which has the ability to integrate with other sorts of programs. This software is offering a lot of time in the matter of managing any type of complex business accounting process in less time. Quickbooks Billing Support Number Simply put, you can easily rely on its high productivity and automating accounting software. If you are one of those who are running their own business and using this QuickBooks accounting software, Quickbooks Enterprise Support Number you should know QuickBooks Technical Support Phone Number is available 24*7 or even on public holidays. When you will dial QuickBooks Technical Support Number, our technicians will coordinate you to discuss your problems and resolve them in lesser time. Quickbooks Error Support NumberWhen you will dial QuickBooks Technical Support Number to consult your problems, you will be able to get valuable and reliable solutions to your problems. Our team knows how to fix any sort of technical problem; be it complex or not. If you are dealing with some sorts of problems while using this QuickBooks accounting software, you are free to dial Quickbooks Online Support NumberQuickBooks Technical Support Phone Number which is mentioned on our website. This will be more convenient for you to reach easily at our QuickBooks Technical Support channel. It will definitely help you in answering your questions which are puzzling in your mind. QuickBooks Support +1-877-651-8034





    ReplyDelete
  8. This is a good idea to contact to technical support channel in order to figure out what is what. The shared example is clear enough!

    ReplyDelete
  9. We have a panel of QuickBooks Proadvisor Support Phone Number experts who can help you to solve your QuickBooks related issues. The solutions we deliver will take only few seconds of you. We have the availability 365 days a year and 24 hours a day!

    ReplyDelete
  10. HVAC & Plumbing Services
    Air Star Heating guarantees reliability and quality for all equipment and services.

    Air Star Heating specialists always try to deliver the most excellent quality of services to our customers at an affordable price. It is understood that every client has different needs and different problems. We try to accomplish the needs of every client according to their requests. We are having considerable experience in this field. Our specialists understand very well how things work. It doesn’t matter in which field of industry you are looking for services.
    Plumbing & HVAC Services in San Diego. Call now (858) 900-9977 ✓Licensed & Insured ✓Certified Experts ✓Same Day Appointment ✓Original Parts Only ✓Warranty On Every Job.
    Visit:- https://airstarheating.com

    ReplyDelete
  11. I enjoyed your blog. Thanks for sharing such an informative post. We are also providing the best services click on below links to visit our website.

    Oracle Fusion HCM Training
    Workday Training
    Okta Training
    Palo Alto Training
    Adobe Analytics Training

    ReplyDelete
  12. Making Money - Work/Tennis: The Ultimate Guide
    The way you would expect https://octcasino.com/ from betting on the tennis matches of tennis หารายได้เสริม is to bet on the player you like 출장샵 most. But you also https://sol.edu.kg/ need a gri-go.com different

    ReplyDelete
  13. Thank you for sharing this useful information, I will regularly follow your blog.

    ReplyDelete