简体   繁体   中英

ajax not working properly in jsf 1.2

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

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM