on 07-29-2014 8:29 AM
Hi All,
I have button where on click opens a dialog box which has 5 check boxes with text for each check box [generating dynamically using row repeater].
If one or all of the check box is checked, the check box with its text should get displayed in the view on closing the dialog box. I am able to display this, that is the checked ones.
But, after closing the dialog box if the user wants to unselect a check box that is not required for the next time, the check box that is unchecked should get removed from the view. How is this possible ?
Thanks,
Ravikiran
Can you share your code, especially the data binding for the checkboxes in both the dialog as well as the view
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robin,
Pleas find the below code,
var oDialogScope = new sap.ui.commons.Dialog({
width : "20%"
});
oDialogScope.setTitle("Add Scope of Work");
var oScopeButton = new sap.ui.commons.Button({
text : "OK",
});
var oRowRep = new sap.ui.commons.RowRepeater();
var oChkBox = new sap.ui.commons.CheckBox({
text : "{EventDropDown>label}",
checked : "{EventDropDown>checked}",
change : function(oEvent) {
var l1 = new sap.ui.commons.CheckBox({
editable : false
});
l1.setChecked(this.getChecked());
l1.setText(this.getText());
oScopeButton.attachPress(function() {
var cellM = new sap.ui.commons.layout.MatrixLayoutCell();
cellM.addContent(l1);
var oScopeRow = sap.ui.getCore().byId("SR1");
oScopeRow.addCell(cellM);
oDialogScope.close();
return;
});
}
});
oRowRep.bindRows("EventDropDown>/checked", oChkBox);
oDialogScope.addContent(oRowRep);
oDialogScope.addContent(oScopeButton);
oDialogScope.addStyleClass("DialogCss");
oDialogScope.open();
Regards,
Ravikiran
Looking at your code, it seems it already creates the views checkboxes in the checkbox checked event, which seems incorrect (should only happen when you click the OK button I guess?)
in your case, simplest would be to first remove everything in the cell, and then re-build the cell with the selected checkboxes
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.