2011-04-07 46 views
0

我喜欢使用DataModelDataModelSelection我的管理组件中的注释。Seam中的DataModel和DataModelSelection问题

@Name("myComponent") 
@Scope(CONVERSATION) 
public class MyComponent { 

    @DataModel 
    private List<Item> myDataModel; 


    @DataModelSelection 
    @Out(required=false) 
    private Item selectedItem; 


    .... 

} 

让我们假设我想制作一个模式面板,我想在其中显示选定的项目数据。 可惜的是属性“将selectedItem”这是注释DataModelSelection是在模式面板空....

<rich:dataGrid value="#{myDataModel}" var="something"> 
    .... 
    <a4j:commandButton oncomplete="show my edit panel" ..../> 
    .... 
</rich:dataGrid> 

<rich:modalPanel> 
    .... 
    <h:inputText value="myComponent.selectedItem"/> 
</rich:modalPanel> 

是否有使用数据网格外的选定数据的任何可能的方式是什么?

另一件事是,我不能在的数据网格财产使用“myComponent.myDataModel”,只是myDataModel。在其他情况下,如果我想使用一些课程作为其他课程的基础,则可能会出现问题。

有什么建议吗?

在此先感谢。

回答

0

你必须使用EL语法;用<h:inputText value="#{selectedItem}"/>代替<h:inputText value="myComponent.selectedItem"/>