简体   繁体   中英

On row select (in p:dataTable) call different java methods?

How to call different web services (different java methods) on row select in data table and update the page asynchronous through ajax using row select.

I have this scenario because that i have 5 tabs should be updated by getting data from 5 methods. While 1st listener have not given data its effecting all anther tabs. so i want to call them separately.

<p:ajax event="rowSelect" listener="#{userController.onFetchUsers}" 
        update=":userRightPaneForm :usersForm:usersList"/>

<p:ajax event="rowSelect" listener="#{userController.onFetchUserDetails}" 
        update=":userRightPaneForm :usersForm:usersList"/>

I have tried like this. But both onFetchUsers and onFetchUserDetails Method calling 2 times on row select event.

I am using Prime faces 3.4.2

How can i achieve it?

Any suggestions will be appreciated.

Its depends on the business scenario.

First of all one row select you can call java method which populate all tab the data and the in update give the ids of all five tabs sequentially.

Hope this work for you.

Or let me know exact scenario in terms of steps like tester and the problem.

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