【发布时间】:2016-12-13 22:24:29
【问题描述】:
我有一个显示某些数据的屏幕。我正在使用数据表选项来显示数据和行选择器来选择行。 如果我选择任何行,则会弹出一些选项,用户可以通过该选项操作数据(如编辑和删除),但我希望某些数据不可编辑。
我有一个屏幕,我在其中按月显示数据,例如,如果当前月份是 8 月,那么我的页面将显示前两个月的数据和接下来的 10 个月的数据。
现在我希望当前月份和前两个月的数据在通过行选择器选择行时不可编辑或禁用。 enter image description here
下面是我的视图页面和行选择器功能:
<i:dataTable id="ConfigurationOne"
headerClass="dataTableCommonHeader"
headerClasses="table_header"
columnClasses="stringColumn, stringColumn w80"
rowClasses="level2ColorStyle, level1ColorStyle"
value="#{configOneBean.monthsDateList}" var="row" cellpadding="0"
cellspacing="1" columnWidths="50px,100px" rows="25"
width="40%"
onrowmouseover="this.style.cursor='default';this.style.backgroundColor='#F1F1F1';"
onrowmouseout="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
>
<i:column>
<i:rowSelector value="#{row.selected}"
selectionListener="#{configOneBean.rowSelectMonthsListener}" />
<f:facet name="header">
<i:outputText value="#{resApp['config.type.code']}" />
</f:facet>
<i:panelGroup style="width:200px;overflow:hidden;">
<i:outputText value="#{row.NRPV_NRPA_CODE}" />
</i:panelGroup>
</i:column>
<i:column>
<f:facet name="header">
<i:outputText value="#{resApp['config.type.name']}" />
</f:facet>
<i:panelGroup style="width:200px;overflow:hidden;">
<i:outputText value="#{row.NRPV_CREATED_BY}" />
</i:panelGroup>
</i:column>
</i:dataTable>
public void rowSelectMonthsListener(RowSelectorEvent event) {
int selectRow = event.getRow();
initActionMap();
if (event.isSelected()) {
this.monthsDate = monthsDateList.get(selectRow);
getAllMonthsAndDate();
actionMap.put(WorkMode.EDIT_GROUP, true);
} else {
this.monthsDate = null;
workMode = WorkMode.EMPTY;
}
}
【问题讨论】:
标签: javascript spring jsf icefaces