具有ace数据表的selectonemenu - 值丢失

时间:2012-10-07 12:33:56

标签: java jsf datatable icefaces icefaces-3

也许有人可以帮助我?

我有一个ace:datatable,其中一列在内联编辑模式下使用“selectonemenu”。

<ace:column id="bundesland" headerText="Bundesland">
    <ace:cellEditor>
        <f:facet name="output">

            <h:outputText id="bundeslandCell1" value="Baden-Württemberg" rendered="#{current.bundesland == 1}"/>  
            <h:outputText id="bundeslandCell2" value="Bayern" rendered="#{current.bundesland == 2}"/>  
            <h:outputText id="bundeslandCell3" value="Hamburg" rendered="#{current.bundesland == 3}"/>  
            <h:outputText id="bundeslandCell4" value="Nordrhein-Westfalen" rendered="#{current.bundesland == 4}"/>  
            <h:outputText id="bundeslandCell5" value="Sachsen" rendered="#{current.bundesland == 5}"/>

        </f:facet>
        <f:facet name="input">

            <h:selectOneMenu id="bundeslandInput" value="#{current.bundesland}">
                <f:selectItem itemLabel="Baden-Württemberg" itemValue="1" />
                <f:selectItem itemLabel="Bayern" itemValue="2" />
                <f:selectItem itemLabel="Hamburg" itemValue="3" />    
                <f:selectItem itemLabel="Nordrhein-Westfalen" itemValue="4" />    
                <f:selectItem itemLabel="Sachsen" itemValue="5" />                                  
            </h:selectOneMenu>

        </f:facet>
    </ace:cellEditor>   
</ace:column> 

将数据表分配给bean的List,该bean引用其他bean ...

问题是如果我提交数据表的形式,字段“bundesland”会丢失数据。

例如:

  • 使用动作侦听器
  • 添加新行
  • 内联编辑非持久性新行
  • 执行保存

一切都很好!

现在我要插入一个新行。我再做同样的步骤。下一次,执行“保存”,单击命令按钮清除整个数据表中的“bundesland”列(带有持久性)。

问题不在于命令按钮背后的操作。如果CommandButton没有actionListener,那么列将被清除..

到目前为止......

为什么Icefaces会清除每行中的“bundesland”列,只有当我使用selectonemenu?

在“内联编辑”中使用 - 模式仍然没有问题。

感谢您的帮助!

0 个答案:

没有答案