2011-09-01 2 views
2

나는 inputTexts의 목록이 포함 된 데이터 테이블이 있습니다데이터 테이블, InputText]를 가치 절약

<h2> 
    Attributes 
</h2> 
<h:dataTable 
    value="#{detailModel.getAfterObjectAttributeSpecifications()}" 
    var="specification" 
    styleClass="waiFormTable" > 
    <h:column> 
     #{specification.name}: 
    </h:column> 
    <h:column> 
     <h:inputText id="attribute" value="#{detailModel.getAfterObjectAttribute(specification.name)}" disabled="#{detailModel.mode == detailModel.viewMode}"/> 
    </h:column> 
</h:dataTable> 

InputText]를의 값은 직접 빈 필드 아니다 (detailModel.getAfterObjectAttribute (사양. 이름)). 값을 변경하고 저장하려면 어떻게해야합니까?

어떤 도움 프란체스코

답변

1

당신은 할 수 없습니다 주셔서 감사합니다. 실제 부동산이거나 적어도 Map 값이어야합니다. 예 :

public Map<String, String> getAfterObjectAttributes() { 
    return afterObjectAttributes; 
} 

<h:dataTable 
    value="#{detailModel.afterObjectAttributeSpecifications}" 
    var="specification" 
    styleClass="waiFormTable" > 
    <h:column> 
     #{specification.name}: 
    </h:column> 
    <h:column> 
     <h:inputText id="attribute" value="#{detailModel.afterObjectAttributes[specification.name]}" disabled="#{detailModel.mode == detailModel.viewMode}"/> 
    </h:column> 
</h:dataTable>