Hello,
I'd like to create a component from scratch whose aim is to display values from multiple different queries.
to do that, I've created a new component class(extends Component), a new XML and jsp.
In the Jsp, I added a dropdown to select the query I want to execute and the datagrid to display the queries results.I tried to make the datagrid as generic as possible to handle data from multiple queries -> I created 1 celllist for the headers and 1 for the rows. in these celllists, I've added the celltemplates to match the different possible fields.
My problem is that as the queries are returning different fields, I do not know how to set this dynamically to the celllists(I've tried to call celllist.setFields("fieldA,FieldB") in the drop down change but an error occurs telling that I cannot call setFields at that moment). if I put all the fields of all the queries on the cellllist fields, I have warnings telling that the grid cannot bind to fields that are not returned by the query(as I've put fields comming from the other queries)
the good thing would be:
when I select a query from the drop down, I set the query in the datagrid data provier(already done)
AND set the celllist fields according to the selected query. doing that when I make a selection in the dropdown generates errors.
Any idea?
thanks,
Michael.