Is it possible to access properties or methods of subcomponents contained in the standard cuba filter component?
E.g. I have the following request: when a user changes the show-rows dropdown (from 50 to 100 rows let’s assume) the table should refresh instantly, avoiding to press search button.
I tried to debug and I managed to view the components, eventually I saw the weblookupfield with the dropdown. But I failed when trying to access the subcomponent in the code. I hoped I could add a ValueChangedListener to it…
Any solution, if it’s not too complicated?
You solution may stop working if we do any minor modification in filter component internal structure. Your task can be solved in a different way. There is a demo project attached - take a look.
Override the MaxResultsFieldHelper bean. The new version will set an explicit id to the required combo box.
public class ExtMaxResultsFieldHelper extends MaxResultsFieldHelper {
@Override
public LookupField createMaxResultsLookupField() {
LookupField maxResultsLookupField = super.createMaxResultsLookupField();
CubaComboBox cubaComboBox = (CubaComboBox) WebComponentsHelper.unwrap(maxResultsLookupField);
cubaComboBox.setId("maxResultsLookupField");
return maxResultsLookupField;
}
}