0

動的テーブルを作成し、動的 ​​textInputs も作成しました。

以下の XML:

    <af:forEach items="#{myRowController.myList}" var = "myItem">

        <af:column  headerText="#{myItem}" width="104" attributeChangeListener="#{test.column_attributeChangeListener}">
                  <af:inputText value="" id="tt01"/>
        </af:column>

    </af:forEach>

 </af:table>

問題は次のとおりです。

作成されたinputTextは同じIDを持ち、入力した値はテーブルinputTextを設定しません

テーブルに値を入力し、すべての値をテーブルに送信します。

4

1 に答える 1

0
<af:table value="#{viewScope.ScheduleActivityBean.rows}"
autoHeightRows="0" varStatus="rwst" var="row" rendered="true"
id="t1" width="100%">
<af:forEach items="#{viewScope.ScheduleActivityBean.columnNames}"
varStatus="colIndex" var="name">
<af:column align="left" headerText="#{name}" width="250px" id="col1"
rendered="#{colIndex.index eq 0}">
<af:inputText id="i7" readOnly="true"
contentStyle="width:170px;font-weight:bold;color:rgb(49,49,49);"
value="#{row.activity}"/>
<af:column align="center" headerText="#{name}" width="120px"
id="co1_${rwst.index}" >
<af:inputText id="it27" readOnly="true"                       
value="#{row.scheduleName}"
/>

テーブル データは viewScope.ScheduleActivityBean.rows から取得されます 列名は viewScope.ScheduleActivityBean.columnNames から取得されます 入力テキスト値には、row.scheduleName および row.activity としての参照があります。ここで、row は ScheduleActivityBean.rows の要素またはオブジェクトです。 .

要件に対して同様のロジックを作成できます。

于 2013-06-07T08:32:20.393 に答える