on 07-19-2016 8:19 AM
Hi Krishna,
This scenario would have been easier if you're using sap.m.Table. But since you're using sap.ui.Table and on top of it, you're using 'sapUiCozy' style for the view which makes requirement little complex. Check-boxes are visible due to 'sapUiCozy', otherwise they aren't. And these check-boxes cannot be accessed through normal methods.
You might need to consider writing the logic on formatter of the column where you want to differentiate row selected or not.
Here is a sample which is created based on sapui5 mock data and bound to 'ProductCollection': JS Bin - Collaborative JavaScript Debugging
Model used:
https://sapui5.hana.ondemand.com/sdk/test-resources/sap/ui/demokit/explored/products.json
Condition: When the supplier is 'Technocom', the row remains selected.
Regards,
Sai.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can do that with expression binding.
Bind the 'selected' attribute of the checkbox control to an expression, like this:
selected="{= ${bonusType} === 'slow' }
Check here:
Expression Binding - User Interface Add-On for SAP NetWeaver - SAP Library
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, you have 3 checkboxes with 3 different expression bindings.
The data model must allow to present all 3 options for each data line.
Like this:
Checkbox 1:
selected="{= ${is_easy} === true }
Checkbox 2:
selected="{= ${is_medium} === true }
Checkbox 3:
selected="{= ${is_hard} === true }
Then you can have all possible combinations of those three.
Hi Krishna,
If I got you correctly - As the checkbox are in UI and there is no connection to DB while creating, you can't get which ones you selected while editing(if I am not wrong). The only way I can think of is, store the row indexs of selected boxs to somewhere while creating and then get them while editing and mark those indexs as checked...
Thanks and regards
Namita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you explain this -"On edit page, based on json value i need to check the checkboxes which are previously checked." more?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in create page.. i will select some checkboxes and the corresponding value wil be saved in DB.. in edit page i wil get values from DB and show checkboxes previously selected.. how wil i achieve this?? lets say.. points:[{"bonusType":"slow"},{"bonusType":"medium"}] is wat i get from DB then in UI i wil show slow and medium as checked and fast as unchecked
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.