开发者

DataModel and DataModelSelection in Seam problem

开发者 https://www.devze.com 2023-02-22 15:37 出处:网络
I wolud like use DataModel and DataModelSelection annotations in my managing component. @Name(\"myComponent\")

I wolud like use DataModel and DataModelSelection annotations in my managing component.

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

   @DataModel
   private List<Item> myDataModel;


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


   ....

}

Lets assume that I want to make a modal panel in which I would like to show the selected item data. Unfortunatelly the prope开发者_StackOverflowrty 'selectedItem' which is annotated DataModelSelection is null in modal panel....

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

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

Is there any possible way to use the selected data outside the data grid?

Another thing is that I can not use the "myComponent.myDataModel" in the dataGrid value property, but simply myDataModel. In other cases it doesn't work fine what may be problematic if I would like to use some class for base to the other.

Any suggestions?

Thanks in advance.


you have to use EL syntax so; use <h:inputText value="#{selectedItem}"/> instead of <h:inputText value="myComponent.selectedItem"/>

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号