<p:ajax> Parent not an instance of ClientBehaviorHolder

UI Components for JSF
Post Reply
honyk
Posts: 150
Joined: 28 Sep 2010, 11:14

16 Apr 2011, 23:27

Hello Everyone,

I am updating one component value via JavaScript (id=latitudeRaw). This value changes the value of another property (GMapLatitudeNormalized) which is used also in the page (as the param of a text string). It is not updated automatically in the page so I am looking for a method how to refresh that component. I've tried p:ajax, but I am getting not very clear error message: /index.xhtml @157,56 <p:ajax> Parent not an instance of ClientBehaviorHolder: javax.faces.component.html.HtmlInputHidden@40d38976
Is there any fix for this?

JSF

Code: Select all

<h:outputFormat id="GMapLatitudeInfo" value="Original {0}">
   <f:param value="#{settings.GMapLatitudeRaw}" />
   <f:param value="#{settings.GMapLatitudeNormalized}" />
</h:outputFormat>
<h:inputHidden id="latitudeRaw" value="#{settings.GMapLatitudeRaw}">
   <p:ajax update="GMapLatitudeInfo"/>
</h:inputHidden>

<script type="text/javascript" language="javascript">
   function handlePointClick(event) {
       var latitudeRaw = Math.round(event.latLng.lat());
       document.getElementById('latitudeRaw').value = latitudeRaw;
   }
</script>
Bean

Code: Select all

public void setGMapLatitudeRaw(int GMapLatitudeRaw) {
   this.GMapLatitudeRaw = GMapLatitudeRaw;
   normalizeGMapLatitude();
}

private void normalizeGMapLatitude() {
   setGMapLatitudeNormalized(5 * (Math.round(GMapLatitudeRaw / 5)));
}
Regards,
Jan

Tomcat 6, Mojarra 2.0.4, PF 3.0M1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: flaxeyes and 27 guests