Take the 2-minute tour ×

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

public class MyComponent {

   private List<Item> myDataModel;

   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 property 'selectedItem' which is annotated DataModelSelection is null in modal panel....

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

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

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.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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

share|improve this answer
add comment

Your Answer


