What is the relationship between the Primefaces ajax and the events

Asked

Viewed 442 times

4

Faced with certain problems during my developments I arose the following doubt for example.

When I use the tag ajax in the Primefaces, has the property event where we passed events, then I arose a certain question.

Once I had to find a way to click on checkbox select all, I used the event click and the function returned me an event via this function’s parameter.

Now working with datatable with the property of editing the data itself, I used events of the type rowEditInit and rowEditCancel, because the table created contains a button to edit the data and another to delete, and logic that I thought, if the person is editing, it would be good to block the delete button, of course this goes from thought to thought and this is not me discussion.

And then I tried to use the parameter passage in this function to enable and disable the button but could not find the event, so I wondered, these events are from Jquery, are of Primefaces?

Where are they documented? I saw in the manual rowEdit, rowEditInit and rowEditCancel but does not have what parameters to be worked.

I have this doubt and also a way for other forum colleagues to know because I think it can help.

1 answer

4

Your question is very pertinent, because the primefaces is a component framework that when rendered by JSF results in html, js and jquery in the client’s browser. So in practice events can be of the standard html component, Jquery or even added by the first faces themselves.

You can use any of these events along with the tag ajax, but it is always good practice to use only those listed in the component documentation.

In the case of events rowEdit, rowEditInit, rowEditCancel, they are Ajax Behavior Events provided by the first faces, the best place to find the list of events, parameters and methods of the Client Side API is in the official user guide of the first faces, at this address there are all versions: http://www.primefaces.org/documentation.html

The cited events receive as parameter of listner the class: org.primefaces.event.RowEditEvent

  • Thanks for the reply, I noticed something in this regard, but due to lack of experience I sought opinion of colleagues from the SO.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.