How to open a dialog by passing an object as a parameter in the primefaces?

Asked

Viewed 2,589 times

0

Good night.

I’m having trouble opening a dialog by passing an object as parameter.

Someone knows how to fix this?

  • How far have you gotten? What do you already have? Pass parameter what it means? An example to better understand.

1 answer

1


You were very little detail in your question, but assuming you have a button and this button opens a dialog. To pass an object as a parameter, just do so:

<p:commandButton value="Abre Dialog"
                 onclick="PF('dialogWidget').show()"
                 update=":formDialog">
  <f:setPropertyActionListener target="#{nomeBean.objetoReceptor}" value="#{objetoASerPassado}" />
</p:commandButton>
  • I really gave you a few details, but you took it well. Initially I was trying to do this way, but was unaware of this <f:setPropertyActionListener>, then I started trying using Requestcontext’s openDialog() without success. But now with this example I got it. Thank you =)

Browser other questions tagged

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