Hello
on button click I should do the following:
1) show a "masking" canvas
2) show a canvas
3) bringToFront a button that opened this canvas.
I noticed that if a button is inside layout, button.bringToFront() or button.setZIndex(10000000000) has no influence.
Instead, I must invoke these methods on button's parent (and if a button is wrapped in 5 levels of parents, i should invoke getParent.getParent... 5 times).
How can I solve this?
thank you
on button click I should do the following:
1) show a "masking" canvas
2) show a canvas
3) bringToFront a button that opened this canvas.
I noticed that if a button is inside layout, button.bringToFront() or button.setZIndex(10000000000) has no influence.
Instead, I must invoke these methods on button's parent (and if a button is wrapped in 5 levels of parents, i should invoke getParent.getParent... 5 times).
Code:
private HLayout bottomLayout = new HLayout();
bottomLayout.addMember(new MyButton());
bottomLayout.show();
public class MyButton extends Button {
public MyButton(String name){
super(name);
setWidth(50);
addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Canvas mask = new Canvas();
mask.setWidth100();
mask.setHeight100();
mask.setBackgroundColor("#333333");
mask.setOpacity(60);
mask.setZIndex(10);
mask.bringToFront();
mask.show();
Label t = new Label();
t.setContents("label");
t.setBackgroundColor("red");
t.bringToFront();
t.show();
setBackgroundColor("blue");
getParentElement().bringToFront();
}
});
How can I solve this?
thank you
Comment