on change of refrence selector call the same MF in which you are executing your OQL statement and pass string parameter
now place a decision in MF and check condition like $yourEntityobject/selectedAttribute name !=empty if true execute another OQL Statement and Get data filtered by your selected attribute
else
retreive all data showing in datagrid (by default).
make sure datagrid refresh interval should be set.