작동하지 내가 어떤 행을 선택하고 경우에, 나는 (primefaces 인스턴트 행 선택의 예에서와 같이 동일) 아약스 호출에 갈거야 여기에 데이터 테이블DataTable의 행 선택
<p:dataTable id="db"
value="#{notificationBox.notificationsList}"
var="notificationForm"
rows="15"
emptyMessage="${msgs.getMessage('table.empty.message')}"
paginator="true"
paginatorPosition="bottom"
rowKey="#{notificationForm}"
selection="#{notificationBox.notification}"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} (${notificationBox.notificationsList.size()} ${msgs.getMessage('table.records')})"
selectionMode="single"
tableStyle="height:430px">
//Rest of the code
있습니다. Ajax는 Datatable 안에 있습니다.
<p:ajax event="rowSelect" listener="#{notificationBox.onRowSelect}"
oncomplete="carDialog.show();" />
내 백업 빈 클래스는 - 내가 어떤 행을 선택하면, "통지"에 null오고있다
private List<NotificationForm> notificationsList;
public NotificationForm notification;
public void onRowSelect(SelectEvent event) {
LOGGER.info("Here. +"+notification);
}
//Setter and Getters.
문제가된다. 더 이상 처리 할 수 없습니다. 도와주세요. 다른 방법도 환영합니다.
편집 : -
내 관리 빈의 범위 -<managed-bean>
<managed-bean-name>notificationBox</managed-bean-name>
<managed-bean-class>com.comviva.workflow.ui.notification.NotificationBox</managed-bean-class>
<managed-bean-scope>view</managed-bean-scope>
<managed-property>
<property-name>notificationDao</property-name>
<value>#{notificationDaoService}</value>
</managed-property>
<managed-property>
<property-name>userInfoDao</property-name>
<value>#{userInfoDaoProxy}</value>
</managed-property>
</managed-bean>
관리 빈의 범위는 무엇입니까? –
당신의'rowKey'는 의심스럽게 이상합니다. PrimeFaces가 그것을 먹을 수 있습니까? 그것은 equals/hashcode가 구현되어 있습니까? 나는 그런 식으로 한번 시도한 적이 없지만, 여기서'# {entity.id}'를보기를 기대합니다. – BalusC
@LuiggiMendoza,보기 범위에 있습니다. 세부 사항을 업데이트했습니다. – theGamblerRises