이 가능합니다.
1.You는
/**
* Returns the tabular data model from a datasource
*
* @author Christian Guedemann, Sven Hasselbach
* @param dsCurrent
* datasource to get the tdm from
* @param context
* current FacesContext instance
* @return
* TabularDataModel
*/
public static TabularDataModel getTDM(DataSource dsCurrent, FacesContext context) {
try {
if (dsCurrent instanceof ModelDataSource) {
ModelDataSource mds = (ModelDataSource) dsCurrent;
AbstractDataSource ads = (AbstractDataSource) mds;
ads.load(context);
DataModel tdm = mds.getDataModel();
if (tdm instanceof TabularDataModel) {
TabularDataModel tds = (TabularDataModel) tdm;
return tds;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
2.You이 가지고있는 테이블 데이터 모델을 액세스 할 수 헬퍼 클래스가 필요 : 나는 코드를 대신 직접보기에 액세스해야합니다 혜택, 그러나 여기에서 무엇 확실하지 않다 데이터 소스를 만들고이를 구성 요소에 추가하려면 fe 뷰 루트
DominoViewData dvd = new DominoViewData();
dvd.setViewName("YOUR VIEW NAME");
dvd.setComponent(FacesContext.getCurrentInstance().getViewRoot());
3. 이제 데이터 소스에 필터 옵션 또는 추가 옵션을 추가 할 수 있습니다. 이러한 :
dvd.setSortOrder("ascending");
dvd.setSortColumn("NAME OF COLUMN");
4.Then 액세스 데이터 소스의 TDM, 첫 번째 항목을 얻고 상위하는 ViewNavigator에 대한 핸들을
TabularDataModel tdm = getTDM(dvd, FacesContext.getCurrentInstance());
tdm.setDataControl(new UIDataEx());
Entry noiEntry = (Entry) tdm.getRowData();
ViewNavigator nav = null;
try {
nav = (ViewNavigator) noiEntry.getParent();
System.out.println("NAV COUNT: " + nav.getCount());
nav.recylce();
} catch (NotesException e) {
e.printStackTrace();
}
(OK, 당신은 지금 대신 ViewNavigator이 ViewEntryCollection의
뷰가 유효하지 않게되는 것에 대해 걱정할 필요가 없다는 이점이 있습니까? – jjtbsomhorst
Sven, 답변과 코드를 보내 주셔서 감사합니다. 실제로 View Data 객체에 대한 블로그 게시물을 통해 질문을하게되었습니다. :-) –