UI5リンター(コード品質チェック機能)が検出したが自動修正できない、非推奨の`sap.ui.table.Table`行プロパティを修正します。 次のような場合に使用: - リンターが`no-deprecated-api`エラーを出力し、以下のいずれかのメッセージが含まれている - `visibleRowCountMode`、`visibleRowCount`、`rowHeight`、`fixedRowCount`、`fixedBottomRowCount`、`minAutoRowCount` 動作内容: JS(JavaScriptファイル)またはXML(マークアップファイル)内で、`sap.ui.table.Table`の行関連の非推奨プロパティを検出します。古いプロパティ構造を、新しい`rowMode`集約形式に変換し、`sap.ui.table.rowmodes.Fixed`、`Interactive`、または`Auto`を使って、平坦(ばらばら)なプロパティを組織化された構造に整理します。
Fix deprecated `sap.ui.table.Table` row properties that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs: - `no-deprecated-api` with messages about `visibleRowCountMode`, `visibleRowCount`, `rowHeight`, `fixedRowCount`, `fixedBottomRowCount`, or `minAutoRowCount` Trigger on: deprecated row-related properties on sap.ui.table.Table in JS or XML, modernization to rowMode aggregation. Converts deprecated flat properties to a structured `rowMode` aggregation using `sap.ui.table.rowmodes.Fixed`, `Interactive`, or `Auto`.
このスキルは、UI5 linter が検出するが自動修正できない sap.ui.table.Table の非推奨行関連プロパティを修正します。
モダナイゼーションでは、フラットなプロパティを構造化された rowMode aggregation に置き換えます。
重要: sap.ui.table.Table を sap.m.Table にモダナイズしないでください — 両者は同等ではありません。
| ルール ID | メッセージパターン |
|---|---|
no-deprecated-api |
Use of deprecated property 'visibleRowCountMode' of class 'sap.ui.table.Table' |
no-deprecated-api |
Use of deprecated property 'visibleRowCount' of class 'sap.ui.table.Table' |
no-deprecated-api |
Use of deprecated property 'rowHeight' of class 'sap.ui.table.Table' |
no-deprecated-api |
Use of deprecated property 'fixedRowCount' of class 'sap.ui.table.Table' |
no-deprecated-api |
Use of deprecated property 'fixedBottomRowCount' of class 'sap.ui.table.Table' |
no-deprecated-api |
Use of deprecated property 'minAutoRowCount' of class 'sap.ui.table.Table' |
Table 上の非推奨プロパティ |
RowMode 上の新プロパティ |
備考 |
|---|---|---|
visibleRowCountMode |
(RowMode クラスを決定) | "Fixed" → rowmodes:Fixed、"Interactive" → rowmodes:Interactive、"Auto" → rowmodes:Auto |
visibleRowCount |
rowCount |
Fixed モードと Interactive モードで使用 |
minAutoRowCount |
minRowCount |
Auto モードでのみ使用 |
rowHeight |
rowContentHeight |
名前変更 |
fixedRowCount |
fixedTopRowCount |
名前変更(Top が追加) |
fixedBottomRowCount |
fixedBottomRowCount |
変更なし |
旧 visibleRowCountMode の値に基づいて選択します:
"Fixed"(または未設定 — これがデフォルト)→ rowmodes:Fixed"Interactive" → rowmodes:Interactive"Auto" → rowmodes:AutoTable に設定されたプロパティが選択した RowMode クラスに存在しない場合
(例: Fixed モードのテーブルに minAutoRowCount が設定されている場合)、
動的な行モード切り替えが行われている可能性があります。
該当テーブルのモダナイゼーションを中止し、手動レビューが必要なものとしてフラグを立ててください。
ルートの <mvc:View> タグに以下を追加します:
xmlns:rowmodes="sap.ui.table.rowmodes"
修正前(Fixed モード):
<table:Table
rows="{/Products}"
visibleRowCountMode="Fixed"
visibleRowCount="5"
fixedRowCount="1"
fixedBottomRowCount="2"
rowHeight="30">
<table:columns>...</table:columns>
</table:Table>
修正後:
<table:Table
rows="{/Products}">
<table:rowMode>
<rowmodes:Fixed
rowCount="5"
fixedTopRowCount="1"
fixedBottomRowCount="2"
rowContentHeight="30"/>
</table:rowMode>
<table:columns>...</table:columns>
</table:Table>
修正前(Interactive モード):
<table:Table
rows="{/Products}"
visibleRowCountMode="Interactive"
visibleRowCount="10"
rowHeight="25">
修正後:
<table:Table
rows="{/Products}">
<table:rowMode>
<rowmodes:Interactive
rowCount="10"
rowContentHeight="25"/>
</table:rowMode>
修正前(Auto モード):
<table:Table
rows="{/Items}"
visibleRowCountMode="Auto"
minAutoRowCount="3">
修正後:
<table:Table
rows="{/Items}">
<table:rowMode>
<rowmodes:Auto minRowCount="3"/>
</table:rowMode>
sap.ui.define に適切なクラスを追加します:
"sap/ui/table/rowmodes/Fixed""sap/ui/table/rowmodes/Interactive""sap/ui/table/rowmodes/Auto"修正前:
sap.ui.define([
"sap/ui/table/Table"
], function(Table) {
var oTable = new Table({
visibleRowCountMode: "Interactive",
visibleRowCount: 10,
rowHeight: 25
});
});
修正後:
sap.ui.define([
"sap/ui/table/Table",
"sap/ui/table/rowmodes/Interactive"
], function(Table, InteractiveRowMode) {
var oTable = new Table({
rowMode: new InteractiveRowMode({
rowCount: 10,
rowContentHeight: 25
})
});
});
セッターベースのパターンも同様に対応します:
修正前:
oTable.setVisibleRowCountMode("Fixed");
oTable.setVisibleRowCount(8);
oTable.setFixedRowCount(2);
oTable.setRowHeight(40);
修正後:
// インポート: "sap/ui/table/rowmodes/Fixed"
oTable.setRowMode(new FixedRowMode({
rowCount: 8,
fixedTopRowCount: 2,
rowContentHeight: 40
}));
--details オプションを付けて linter を実行し、影響を受けるすべての Table インスタンスを特定するvisibleRowCountMode から RowMode クラスを判定する(デフォルト: "Fixed")xmlns:rowmodes="sap.ui.table.rowmodes" 名前空間を追加し、非推奨プロパティを削除して <rowMode> aggregation を追加するsetRowMode() 経由で設定する| モード | 使用可能なプロパティ |
|---|---|
Fixed |
rowCount、fixedTopRowCount、fixedBottomRowCount、rowContentHeight |
Interactive |
rowCount、rowContentHeight |
Auto |
minRowCount、fixedTopRowCount、fixedBottomRowCount、rowContentHeight |
visibleRowCountMode が設定されていない場合、デフォルトは "Fixed" だったため rowmodes:Fixed を使用する<table:rowMode> aggregation は <table:Table> 内に、<table:columns> と並べて配置するrowmodes: 名前空間プレフィックスを使用するsap.ui.table.Table に対する他の no-deprecated-api エラー(行モードに関連しない非推奨クラスやプロパティなど)には、fix-deprecated-controls を使用するnew sap.ui.table.Table())で instantiate されている場合、fix-js-globals が適切なモジュールインポートへの変換を処理するThis skill fixes deprecated row-related properties on sap.ui.table.Table that the UI5 linter detects but cannot auto-fix. The modernization replaces flat properties with a structured rowMode aggregation.
IMPORTANT: Do NOT modernize sap.ui.table.Table to sap.m.Table — they are not equivalent.
| Rule ID | Message Pattern |
|---|---|
no-deprecated-api |
Use of deprecated property 'visibleRowCountMode' of class 'sap.ui.table.Table' |
no-deprecated-api |
Use of deprecated property 'visibleRowCount' of class 'sap.ui.table.Table' |
no-deprecated-api |
Use of deprecated property 'rowHeight' of class 'sap.ui.table.Table' |
no-deprecated-api |
Use of deprecated property 'fixedRowCount' of class 'sap.ui.table.Table' |
no-deprecated-api |
Use of deprecated property 'fixedBottomRowCount' of class 'sap.ui.table.Table' |
no-deprecated-api |
Use of deprecated property 'minAutoRowCount' of class 'sap.ui.table.Table' |
Deprecated Property on Table |
New Property on RowMode |
Notes |
|---|---|---|
visibleRowCountMode |
(Determines RowMode class) | "Fixed" → rowmodes:Fixed, "Interactive" → rowmodes:Interactive, "Auto" → rowmodes:Auto |
visibleRowCount |
rowCount |
Used in Fixed and Interactive mode |
minAutoRowCount |
minRowCount |
Used only in Auto mode |
rowHeight |
rowContentHeight |
Name change |
fixedRowCount |
fixedTopRowCount |
Name change (Top added) |
fixedBottomRowCount |
fixedBottomRowCount |
No change |
Choose based on the old visibleRowCountMode value:
"Fixed" (or not set — this is the default) → rowmodes:Fixed"Interactive" → rowmodes:Interactive"Auto" → rowmodes:AutoIf a property set on the Table doesn't exist on the selected RowMode class (e.g., minAutoRowCount on a Fixed mode table), this indicates possible dynamic row mode switching. Abort modernization for that table and flag for manual review.
Add to the root <mvc:View> tag:
xmlns:rowmodes="sap.ui.table.rowmodes"
Before (Fixed mode):
<table:Table
rows="{/Products}"
visibleRowCountMode="Fixed"
visibleRowCount="5"
fixedRowCount="1"
fixedBottomRowCount="2"
rowHeight="30">
<table:columns>...</table:columns>
</table:Table>
After:
<table:Table
rows="{/Products}">
<table:rowMode>
<rowmodes:Fixed
rowCount="5"
fixedTopRowCount="1"
fixedBottomRowCount="2"
rowContentHeight="30"/>
</table:rowMode>
<table:columns>...</table:columns>
</table:Table>
Before (Interactive mode):
<table:Table
rows="{/Products}"
visibleRowCountMode="Interactive"
visibleRowCount="10"
rowHeight="25">
After:
<table:Table
rows="{/Products}">
<table:rowMode>
<rowmodes:Interactive
rowCount="10"
rowContentHeight="25"/>
</table:rowMode>
Before (Auto mode):
<table:Table
rows="{/Items}"
visibleRowCountMode="Auto"
minAutoRowCount="3">
After:
<table:Table
rows="{/Items}">
<table:rowMode>
<rowmodes:Auto minRowCount="3"/>
</table:rowMode>
Add the appropriate class to sap.ui.define:
"sap/ui/table/rowmodes/Fixed" for Fixed mode"sap/ui/table/rowmodes/Interactive" for Interactive mode"sap/ui/table/rowmodes/Auto" for Auto modeBefore:
sap.ui.define([
"sap/ui/table/Table"
], function(Table) {
var oTable = new Table({
visibleRowCountMode: "Interactive",
visibleRowCount: 10,
rowHeight: 25
});
});
After:
sap.ui.define([
"sap/ui/table/Table",
"sap/ui/table/rowmodes/Interactive"
], function(Table, InteractiveRowMode) {
var oTable = new Table({
rowMode: new InteractiveRowMode({
rowCount: 10,
rowContentHeight: 25
})
});
});
Also handle setter-based patterns:
Before:
oTable.setVisibleRowCountMode("Fixed");
oTable.setVisibleRowCount(8);
oTable.setFixedRowCount(2);
oTable.setRowHeight(40);
After:
// Import: "sap/ui/table/rowmodes/Fixed"
oTable.setRowMode(new FixedRowMode({
rowCount: 8,
fixedTopRowCount: 2,
rowContentHeight: 40
}));
visibleRowCountMode (default: "Fixed")xmlns:rowmodes="sap.ui.table.rowmodes" namespace, remove deprecated properties, add <rowMode> aggregationsetRowMode()| Mode | Available Properties |
|---|---|
Fixed |
rowCount, fixedTopRowCount, fixedBottomRowCount, rowContentHeight |
Interactive |
rowCount, rowContentHeight |
Auto |
minRowCount, fixedTopRowCount, fixedBottomRowCount, rowContentHeight |
visibleRowCountMode is not set, the default was "Fixed" — use rowmodes:Fixed<table:rowMode> aggregation goes inside <table:Table>, alongside <table:columns>rowmodes: namespace prefix for RowMode elementsno-deprecated-api errors on sap.ui.table.Table (e.g., deprecated classes, properties not related to row mode), use fix-deprecated-controlsnew sap.ui.table.Table()), fix-js-globals handles converting to proper module imports原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。