我對我的方法有疑問。我正在使用JDeveloper 12c。我有一個名爲activeYear的方法,代碼如下:如何在列中只設置一個值
public void activeYear() {
this.getCurrentRow().setAttribute("Active", 1);
}
它基於複選框。在我的應用程序中,它的作用就像 - 我有一個使用此方法的按鈕。如果我按下它,我當前行將其複選框值「活動」更改爲選定。
問題是:我必須只有一行激活,當我立即按下按鈕時,其他每一行都必須被取消選中。我如何更改此代碼?或者我應該添加一個更多的方法嗎?
解決方案:
我的方法activeYear我添加方法叫去活,這代碼是在這裏:
public void deactive() {
RowSetIterator rowSetIterator = this.createRowSetIterator("New");
if (rowSetIterator != null) {
rowSetIterator.reset();
while (rowSetIterator.hasNext()) {
Row currentRow = rowSetIterator.next();
currentRow.setAttribute("Active", 0);
}
rowSetIterator.closeRowSetIterator();
}
}
問候, WK
將所有行設置爲'0',然後將currnt行設置爲'1' – maxx777
我忘了寫 - 我正在使用oracle jdeveloper12c。親愛的max777 - 你可以放任何代碼嗎?我真的很感激。 –