I still have difficulties to bring backing beans, logic and jscript together. What I figured out is, that we have actionListener or listener on the one hand (this enables us to start a method or an event in the dialog's logic or a backing bean), and on the other hand we have jscript events like onclick, oncomplete or onTabShow.

So here is my first question: Are these assumptions correct?

And here is my second question: When I want an event, method or a backing bean in the logic to be executed when a javascript-event is fired how can I do that?

asked 19.11.2013 at 11:31

Nikel%20Weis's gravatar image

Nikel Weis
(suspended)
accept rate: 57%


You can add a <p:ajax> call on your element. With this you have a possibility to listen some events from the "parent" element.

In Primfaces are no onclick, onblur event to fire a logic or backingbean. These are HTML attribute names to call normal javascript functions.

But with primfaces they just called blur, click. You find an example in the user guide from primefaces (Ajax Behavior Events).

For example the selectOneMenu:

<p:selectOneMenu var="lang" value="#{data.language}">
    <f:selectItem itemValue="de" itemLabel="de"/>                    
    <f:selectItem itemValue="fr" itemLabel="fr"/>
    <p:ajax event="change" listener="#{logic.changeLanguage}"/>
</p:selectOneMenu>

I hope this will help you

link

answered 19.11.2013 at 14:45

Raphael%20B%C3%BCrgin's gravatar image

Raphael Bürgin
(suspended)
accept rate: 55%

edited 19.11.2013 at 14:51

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×58
×6

Asked: 19.11.2013 at 11:31

Seen: 2,660 times

Last updated: 19.11.2013 at 14:51