我想存储包含更改日期的日期的GWT FlexTable行号。代码是:
//Add change handler for the task completion date.
dateCompletion.addValueChangeHandler(new ValueChangeHandler<java.util.Date>() {
public void onValueChange(ValueChangeEvent<java.util.Date> event) {
//TODO currentRow = flexAwardDescription.getRowIndex();
//Display all YM who have not completed this task.
AsyncCallback<List<YouthMember>> callback = new YMWithoutAwardHandler<List<YouthMember>>(CubBulkAward3View.this);
rpc.getYMWithoutAwardList(ymAwardDetails.getad_Id(), callback);
}
});
我找到了点击事件的答案;但是,不是为了改变事件。
答案 0 :(得分:0)
请在此处查看我的答案:Gwt getCellForEvent flexTable
没有明显的方法可以做到,你可以做的是
.getElement()
获取它的元素,然后使用getParent()
获取Cell,再使用getParent()
获取行元素。然后你可以得到它的索引,将它与循环中rowFormatter的行进行比较。
答案 1 :(得分:0)
我想到的工作是捕获click事件上的行号(因为必须先单击才能更改),然后在发生更改事件时使用此行号。
//Get the row number of the row selected to display the names below it.
flexAwardDescription.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
currentRow = flexAwardDescription.getCellForEvent(event).getRowIndex();
}
});
//Add change handler for the task completion date.
dateCompletion.addValueChangeHandler(new ValueChangeHandler<java.util.Date>() {
public void onValueChange(ValueChangeEvent<java.util.Date> event) {
//Check if this is the completion row
if (ymAwardDetails.getad_Description().matches("(.*)Completed:(.*)")) {
groupCompleted = "C";
}else{
groupCompleted = "S";
}
awardDescriptionID = ymAwardDetails.getad_Id();
//Display all YM who have not completed this task.
AsyncCallback<List<YouthMember>> callback = new YMWithoutAwardHandler<List<YouthMember>>(CubBulkAward3View.this);
rpc.getYMWithoutAwardList(ymAwardDetails.getad_Id(), accountId, callback);
}
});