Hey, i think i have found a bug.
TextItems, AreaItems, most form components trigger a clickevent when clicked on, so you can add a ClickHandler on the form to do stuff.
The new 13.1 ToggleItem doesn’t trigger those events. Would be great if it did.
Hey, i think i have found a bug.
TextItems, AreaItems, most form components trigger a clickevent when clicked on, so you can add a ClickHandler on the form to do stuff.
The new 13.1 ToggleItem doesn’t trigger those events. Would be great if it did.
We’ve fixed this for tomorrow’s builds, dated January 24 and later - you’ll be able to catch the click in the form’s click or itemChanged handlers.
Hey, thanks for quick response. Great stuff.
OK, so i just upgraded to February 6, and i have to say that I’m not noticing a difference.
If i click inside the square on a textbox, checkbox or other components i get the click, but if i click above the toggleitem i get nothing.
I add the clickhandler to the form. i.e.:
form.addClickHandler(clickEvent -> {
//doing stuff
});
EDIT: build number in the console: SmartClient Version: v13.1p_2025-02-05/Pro Deployment (built 2025-02-05)
We’re seeing this work as expected, in SmartClient and SmartGWT - in the specific build you mentioned, your Java code shows a popup dialog when you click anywhere on the ToggleItem, if you call SC.say().
form.addClickHandler(clickEvent -> {
SC.say("clicked");
});
You mentioned clicking “above” the item - do you mean actually above it, outside of the visual toggle? That also works for us. If you mean that you have given the actual toggle-child a short height and are clicking outside of the toggle but still inside of the item, please show your code for it.
Heyhey!
Here’s an example that, for me, behaves as i have explained. If you click on the text item, anywhere, the clickhandler triggers. On the toggleitem though, it only triggers if you don’t click exactly on top of the toggleitem itself - i.e. it works on the formitem header or the formitem area around the actual toggle.
EDIT: i also added a checkboxitem to illustrate the difference - you do get clicks on that one everywhere
public class LoadTheSuperCoolApp implements EntryPoint {
public void onModuleLoad() {
SystemConf.getInstance().clearLoadingWindows();
Layout main = new Layout();
main.setPadding(200);
main.setWidth100().setHeight100();
DynamicForm form = new DynamicForm();
TextItem name = new TextItem("name");
ToggleItem isSithLord = new ToggleItem("isSithLord");
name.setValue("Anakin");
isSithLord.setValue(false);
CheckboxItem hasACoolMask = new CheckboxItem("hasACoolMask");
hasACoolMask.setValue(true);
form.setFields(name, isSithLord, hasACoolMask);
form.setCanEdit(false);
main.addMember(form);
form.addClickHandler(event -> {
SC.say("ClicketyClick!");});
main.draw();
}
}
As a speculation - is it because i call setCanEdit(false) and you don’t? Just a guess.
EDIT: i also added a checkboxitem to illustrate that it works even though the form is not editable.
Yes - if you set a textItem to disabled, it won’t fire the form’s click-event either.
Out of interest, why are you catching widget clicks in the form?
Following up - you’re actually correct here, in that canEdit: false (as opposed to being disabled) does not behave correctly for ToggleItem. We’ll take a look and get back to you.
We have a slightly different edit/save/cancel flow than you have in your examples. We use canedit to put forms in “edit mode” for users. Drop me an email if you’re interested in checking out out app. I’m sure you would find tons of issues ![]()
Heyhey, any update here?
SmartClient v13.1p_2026-11-01/Enterprise Deployment
Hi, canEdit:false still does not work for ToggleItem:
isc.DynamicForm.create({
fields: [
{name: "toggle", title: "ToggleItem",
editorType: "ToggleItem", canEdit: false}
]
});
hi Claudio, mathias - thanks for the followups.
It turns out, this was fixed in 15.0 and 14.1 last year, and the mechanism was ported to 13.1, but the port was incomplete.
It’s been corrected for tomorrow’s builds, dated November 8 and later.
SmartClient Version: v13.1p_2026-11-08/AllModules Development Only (built 2026-11-08)
Now it’s working, thank you very much
Heh, i had given up on you ever fixing this over a year ago
Now i can ditch my custom component.