Is it possible to have a Item (combobox) in a DataGrid which keeps track of the number of rows selected. The Datagrid has an extra column (combobox) that can be check by the user. I need to find a method to count the number of rows selected by the user by checking the combobox column. I can't use the api_datasource as this column is not a datasource column.
asked 29 May '13, 08:04
I see. In this case, you still need to hook the CheckBox to a Datasource Columns. No problems though, This is a common thing to do in Formspider. Here are the steps I followed:
1- Create a new application which points to the HR schema 2- Create a Datasource Definition based on the following Query:
3- Uncheck the Updateable Checkbox for the Checked_YN column in the Columns tab of the Datasource Definition Dialog. This is to ensure that the Checked_YN column is not included in the DML statements.
4- Update the mainPanel with the following XML code:
5- Create the action references in the XML above which points to the following PL/SQL procedure:
There are multiple ways to count the ticked CheckBoxes. I find the method above the most convenient. We simply get the SQL which returns the entire row set in the datasource and add a where clause to it to only count the ones we are interested in.
Hope this helps.
Kind Regards, Yalim
answered 29 May '13, 09:39
I am not sure if I understood the question 100% but is this what you meant?
I built a small sample application that has a Grid and a textBox which shows the number of selected rows in the Grid. I used the Departments table in Oracle supplied HR schema. Here are the steps I followed
4- Create the action references in the XML above which points to the following PL/SQL procedure
Run the app. Note that the number showed in the countIndicator textField increases and decreases depending on the number of rows you select in the Grid.
Is this what you had in mind?
Kind Regards, Yalim