Question

I have implemented AJAX in jsf 1.2 by using ajax4jsf-1.0-6.JAR in my project. There is a requirement that I have to show a datatable inside a "div" on click of a button on the same page.

I am calling a method on click of a a4j:commandButton which is setting those values which will be rendered in "div" element and in onComplete attribute I am calling a javascript function which displays "div".

But the problem is that values are not being displayed. I checked the console and found that values are being printed by logger.

One more thing if I refresh the page by clicking on any button , after that values are being displayed. so I think there is problem with "UPDATE MODEL VALUES".

I am unable to post the code. But think you will get idea what i am talking about.

help me , thanks in advance.....

Was it helpful?

Solution

The is page not render after click on button.

To get out of this problem you include a4j:support component in between the a4j:commandButton component. Mention the event, reRender attributes. Write the form id value in reRender attribute.

<a4j:commandButton>
    <a4j:support event="onclick, oncomplete" reRender="yourFormId" oncomplete="yourDivFun();"></a4j:support>
</a4j:commandButton>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top