Hi All,
I’ve an Async table control with select row checkbox in one of the columns. and a button which needs to be enabled only if the user selects any of the checkboxes in the table.
I bound my async table to a ISelectableTableContentProvider and set the disabled property of the button to #{empty ..rowSelectedIds}
When the initial page loads, the button is disabled which is correct but after i select the checkbox in the table the button doesnt get enabled.
when i print the rowSelectedIds then i see the values selected.
Is this implementation correct, As i was expecting the button to be enabled once the user selects any of the checkboxes.
I’ve seen this implementation when customizing the temporary attachments provider on the remove button.
Is there something different in the implementation of attachments provider.
Thanks Eric for the code snippet.
I understand that it works with the below script, what i do not understand how does it work in Attachments Provider without a similar script.
How we can set buttonID dynamically.I think we need to set buttonID same as rowID.
I have tried to set it with rowID but getting error as “[POP.001.0002] A “javax.portlet.PortletException””
You want the button in the row that was just selected?
If, so the something like this should work inside the rowChangeListener fuction.
//get model for the row
var rowModel =CAF.model(rowId);
// Calculates the global id for the control in this row with the specified local id
var buttonId = rowModel.getControlId("localButtonIdHere")
//get the button model
var buttonModel = CAF.model(buttonId);
//disable it.
buttonModel.setDisabled(disabled);
Thanks Eric.
Using this Script I am able to retrieve individual Button-ID. However button is not getting disabled.
//buttonModel is returning as function event
var buttonModel = CAF.model(buttonId);
//output of buttonModel
function onclick(event){
;CAF.model(this).go();
}
//Button disabled is not working
buttonModel.setDisabled(disabled);