| Summary: | [Control] Changing visibility state using client scripting fails | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Sebastian Habenicht <dev> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P2 | CC: | ivan, mknauer |
| Version: | 3.1 | ||
| Target Milestone: | 3.2 M3 | ||
| Hardware: | PC | ||
| OS: | Windows NT | ||
| Whiteboard: | sr312 | ||
This problem has been introduced in RAP 3.0M1 by preserving the common control properties on demand. It's too late to fix it for 3.1 release. We will address this issue in the first service release. This happens only if the property set by the client scripting is reset back in the same request. ... we should not use public setters in ControlOperationHandler. Fixed with change https://git.eclipse.org/r/#/c/81443/ (In reply to Ivan Furnadjiev from comment #4) > Fixed with change https://git.eclipse.org/r/#/c/81443/ Thanks for fixing it. Will this be part of the first 3.1 service release? (In reply to Sebastian Habenicht from comment #5) > (In reply to Ivan Furnadjiev from comment #4) > > Fixed with change https://git.eclipse.org/r/#/c/81443/ > > Thanks for fixing it. Will this be part of the first 3.1 service release? It's too late for SR1, but we will consider it for SR2. |
When a hidden control is made visible using client scripting, it cannot be hidden anymore from a server side listener (and the other way around): protected void createContents(final Composite parent) { // control to hide and show final Control control = new Composite(parent, SWT.BORDER); control.setVisible(false); // button final Button button = new Button(parent, SWT.NONE); button.setText("Hide"); // add client listener to show label on mouse enter String protocolId = WidgetUtil.getId(control); String scriptCode = "function handleEvent(event) { var widget = rap.getObject('" + protocolId + "'); widget.setVisible(true); }"; button.addListener(SWT.MouseEnter, new ClientListener(scriptCode)); // add listener to hide label on button selection button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { control.setVisible(false); // label.getParent().layout(); // ...not necessary, but doesn't // help anyway } }); } This code works with 3.0.2, but doesn't with 3.1.0-RC2 (issue can be reproduced since 3.1.0-M1). No problem when using a client listener for both actions (instead of server side listener). Tested in FF, Chrome and IE10.