-
1. Re: Assigning different select options to InPlaceSelect comp
java4me Jan 28, 2009 7:21 AM (in response to java4me)To put it clear, I am giving one example. Here is the table I wanted to generate.
Region Countries Europe England{England,France,Germany} Asia Japan{China,Japan,India}
In the above table, we have two columns region and countries. Based on value in region, the options in countries must be popuplated.
I am using scrollable data table. Please let me know how I can provide different set of options for different rows. -
2. Re: Assigning different select options to InPlaceSelect comp
ststroppel Jan 28, 2009 7:46 AM (in response to java4me)You can use a4j:support with onchange event to realize this. The reRender attribute can refresh your second inplaceSelect.
More information about this here:
http://livedemo.exadel.com/richfaces-demo/richfaces/support.jsf?tab=selects&cid=979604 -
3. Re: Assigning different select options to InPlaceSelect comp
java4me Jan 28, 2009 8:17 AM (in response to java4me)Thanks for your thoughts, but I am not changing any value in region row. It is a data model getting created for scrollable data model. The region column is simply display column and countries column should be renderred with different set of values.
FYI, I am creating table columns using HtmlColumn. For this component we can add one child which is HtmlInplaceSelect.
Is it possible to have cell renderer which will be called by Richfaces before rendering each cell with row and columns as arguments? -
4. Re: Assigning different select options to InPlaceSelect comp
nbelaevski Jan 28, 2009 1:06 PM (in response to java4me)Hi,
I do not see any problem in binding in-place select components in the second column to the row variable. E.g. like this:<rich:dataTable var="item" ...> <rich:column> <rich:inplaceSelect> <f:selectItems value="#{item.selelctItems}" /> ...
-
5. Re: Assigning different select options to InPlaceSelect comp
java4me Jan 29, 2009 8:45 AM (in response to java4me)Thanks for your replies.
Hi nbelaevski
I am creating the datamodel and columnmodel for the table dynamically[java code] rather than a jsp. The number of columns, content depends upon DB entries.
Here is the code snippet of my jsp.<rich:scrollableDataTable binding="#{bean.searchHtmlScrollableDataTable}" id="searchTable" var="searchTableData" rowKeyVar="key" hideWhenScrolling="true" value="#{bean.dataList}"> </rich:scrollableDataTable>
I use list of object arrays to populate each row of the table.
So using the value of 'var' property of the table doesnt help in here as the var will be mapped to an object array and a method to populate the UIselectItems cannot be implemented.
Is there any other way around for it?
Also i will like to know if the renderer for the InPlaceEdit can be overriden for this? -
6. Re: Assigning different select options to InPlaceSelect comp
nbelaevski Jan 29, 2009 7:33 PM (in response to java4me)Not a problem, use the following expression:
<f:selectItems value="#{item[x].selelctItems}" />
where "x" is column index.
For the question on renderer: renderer is not the only object that needs correct information about values, component itself may need this also.
BTW, have you tried rich:columns?