Board index JavaServer Faces General P:dialog updation issue

P:dialog updation issue

Components, Ajax Framework, Utilities and More.

Post 28 Sep 2011, 13:04

Posts: 4
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...

Post 28 Sep 2011, 15:27

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

Post 28 Sep 2011, 19:13

Posts: 4
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>

Post 28 Sep 2011, 19:38

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

Remember to update element INSIDE your dialog. Pseudo code :

<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.


Return to General

cron