P:dialog updation issue

Components, Ajax Framework, Utilities and More.
Post Reply
jagadeesh
Posts: 4
Joined: 27 Sep 2011, 19:19

28 Sep 2011, 13:04

I am facing issue with p:dialog box

i am showing dialog box when ever on mouse over the graphic image and also i am calling f:ajax listener to call backing bean method

<h:graphicImage id="red" onmouseover="dialog.show();"
url="/images/icons/redIcon.png">
<f:ajax event="mouseover" execute="@this" update="overNameInfo" rendered="overNameInfo" listener="#{backingbean.setSelectedOverInfo}" />
<f:attribute name="insured" value="#{insured}" />
</h:graphicImage>

"overNameInfo " is the id of dialog box..

but it is showing dialog popup but it is not updating the dialog box..

but i required to update the dialog box values
please help me on this issue...

t_tobi
Posts: 27
Joined: 15 Aug 2011, 14:50

28 Sep 2011, 15:27

f:ajax has no attribute rendered.
The attribute update is for primefaces components, for jsf2 components you must use render.

jagadeesh
Posts: 4
Joined: 27 Sep 2011, 19:19

28 Sep 2011, 19:13

Hi,
if i use render in f:ajax i am getting following exception

javax.faces.FacesException: <f:ajax> contains an unknown id 'overNameInfo' - cannot locate it in the context of the component red

<h:graphicImage id="red" onmouseover="dialog.show();"
url="/images/icons/redIcon.png">
<f:ajax event="mouseover" execute="@this" update="overNameInfo" render="overNameInfo" listener="#{backingbean.setSelectedOverInfo}" />
<f:attribute name="insured" value="#{insured}" />
</h:graphicImage>

piogwi
Posts: 19
Joined: 29 Aug 2011, 08:31

28 Sep 2011, 19:38

You may be thinking about p:ajax instead of f:ajax

Remember to update element INSIDE your dialog. Pseudo code :

Code: Select all

<form>
  <dialog>
      <panel>
          Update this
      <panel>
  </dialog>
<form>
Scenario:
- user does an action (clicks a button for example)
- dialog.show() is fired
- request/response
- dialog is ubdated and is hidden as default again

Even if update happens before dialog.show(), updating component inside dialog is still a good idea - for me this works better.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 5 guests