value change event issue ( jsf not found ) message

UI Components for JSF
Post Reply
tonico
Posts: 51
Joined: 22 Aug 2010, 00:15

12 Sep 2010, 20:13

Primefaces 2.2 M1, Glassfish 3.1, Moharra 2.0.3


I have a series of input fields where I want to invoke a change listener. I use this becase the attribute valueChangeListener does not seem to work at all:

Code: Select all

        <h:inputText id="myfield1"  value="#{mybean.value1}" >
            <p:ajax  event="change" actionListener="#{navigationBean.valueChangeListener}" update="#{cc.attrs.id}" />
            <p:ajax event="change"  update="#{cc.attrs.id}" />
        </h:inputText>

When running the application, I can see on firebug the following javscript exception: jsf not found, which points to the following internal javascript:

Code: Select all

function onchange(event) {
     jsf.util.chain(this, event, "PrimeFaces.ajax.AjaxRequest('/op/faces/index.xhtml', formId:'form2',async:false,global:true,source:'form2:j_idt349:j_idt349',process:'form2:j_idt349:j_idt349',update:'form2:j_idt349',event:'change'});", "PrimeFaces.ajax.AjaxRequest('/op/faces/index.xhtml',{formId:'form2',async:false,global:true,source:'form2:j_idt349:j_idt349',process:'form2:j_idt349:j_idt349',update:'form2:j_idt349',event:'change'});");
}
Any idea why this is ending in exception ? What' sthe right approach for a value change listener ?

Thanks in advance
Last edited by tonico on 30 Jan 2011, 03:34, edited 1 time in total.
- Tonico
Primefaces 2.2.1 - Glassfish 3.1 - Mac OS X Lion

callahan
Posts: 768
Joined: 27 May 2010, 22:52

13 Sep 2010, 02:21

Hi,

I think you're reading the user's guide for 2.1, but using 2.2.M1. Since I've been here, the PrimeFaces user's guide has always been for the current stable version or release candidate, and not for snapshots or milestone versions. On the very first page of the current user's guide it says "Covers 1.1 and 2.1". This of course is easy to oversee!

p:ajax used to be a component, but with 2.2.M1 it's a client behavior, just like f:ajax. It no longer supports the actionListener attribute, but instead has a listener attribute which can be used to achieve what you want. The name was changed from actionListener to listener because p:ajax can be used with components that are EditableValueHolders or ActionSources (I hope).

See http://www.primefaces.org/showcase/ui/ajaxifyAction.jsf for an example.

On the other hand, your issue may have something to do with using the p:ajax behavior in composite components. I haven't seen an example of this yet.

tonico
Posts: 51
Joined: 22 Aug 2010, 00:15

13 Sep 2010, 15:25

thanks for the clarification.
- Tonico
Primefaces 2.2.1 - Glassfish 3.1 - Mac OS X Lion

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

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