views:

20

answers:

1

I am using a JSF page in a portal environment. If I use a valueChangeListener, the method is not called in the backing bean unless I use onclick="submit()". This submits my page which I don't want. Same is the case with actionListner.

Also, if I use ajaxRefreshSubmit, my whole page is submitted rather than submitting the specified part on which the ajaxRefreshSubmit is used.

Why this behaviour? Is it because we are using it in a portal environment, or did we miss something in the configuration files?

+1  A: 

The valueChangeListener runs indeed only when you submit the form to the server. It's indeed one of the major JSF beginner's misconceptions to think that it runs at the client side. It's not part of HTML or JavaScript code which runs in the webbrowser. It's part of Java/JSF code which runs in webserver. So the client has to send a request from webbrowser to webserver somehow. Submitting the form is one of the ways.

For the remnant, I don't have anything to say about ajaxRefreshSubmit since that's specific to the IBM component library which I don't use (and also can't because it's not open source nor freely available). If you don't get more respons here at Stackoverflow, then your best bet may be posting the question at their own forum at developerworks. It's only not as active and high-quality as here.

BalusC
but i noticed one thing with value change listener here. first the construtor is called and then it goes in to the method. is this expected behaviour?
If it's a **request scoped** bean, yes. On the other hand, if your IBM component library offers ajax based components, those may be more useful to trigger *partial* submits. Only due to lack of documentation and not being freely available, I can't answer how to use them.
BalusC