Hello,
I have a subclass of SelectItem that uses a custom picklist with a filter editor enabled. I'm trying to focus the cursor on filter editor as soon as it's opened, so the user can click the SelectItem once and start typing. I'm having trouble capturing the point in time where the filter editor is drawn/initialized. I've tried adding DrawHandlers and InitHandlers to various objects, but I kept getting errors saying my picklist wasn't initialized. The code below doesn't throw any errors, but key startEditing() line never gets called.
I realize this is a roundabout way of searching in a dropdown, but the custom SelectItem class we wrote is (mostly) working the way we'd like, and is used a lot throughout our app. So I'm trying to avoid major changes to it.
Is there a handler I can add that will fire when the picklist's filter editor is initialized?
Thanks,
John Claxton
I have a subclass of SelectItem that uses a custom picklist with a filter editor enabled. I'm trying to focus the cursor on filter editor as soon as it's opened, so the user can click the SelectItem once and start typing. I'm having trouble capturing the point in time where the filter editor is drawn/initialized. I've tried adding DrawHandlers and InitHandlers to various objects, but I kept getting errors saying my picklist wasn't initialized. The code below doesn't throw any errors, but key startEditing() line never gets called.
I realize this is a roundabout way of searching in a dropdown, but the custom SelectItem class we wrote is (mostly) working the way we'd like, and is used a lot throughout our app. So I'm trying to avoid major changes to it.
Is there a handler I can add that will fire when the picklist's filter editor is initialized?
Code:
//In the constructor of my subclass of SelectItem final ListGrid pickList = new ListGrid(); pickList.setShowFilterEditor(true); ListGridField viewField = new ListGridField("view"); viewField.setFilterOperator(OperatorId.IREGEXP); viewField.setAllowFilterOperators(true); pickList.setAllowFilterExpressions(true); //I've also tried pickList.setInitHandler(); here. final TextItem searchBox = new TextItem(); searchBox.setInitHandler(new FormItemInitHandler() { @Override public void onInit(FormItem item) { pickList.getFilterEditor().startEditing(); } }); setPickListProperties(pickList);
John Claxton
Comment