jimb
New Member
Posts: 20
|
Post by jimb on Jan 24, 2015 12:04:45 GMT 1
Hello,
I have a structure where I'm using a Panel and a child component:
MyVerticalLayoutComponent |__MyPanel |__MyCustomReferencedComponent
I want to replace "MyCustomReferencedComponent" with another referenced component, e.g. MyCustomReferencedComponent2.
So, I drag the new component onto MyPanel and I get the following result which is good:
MyVerticalLayoutComponent
|__MyPanel
|__MyCustomReferencedComponent |__MyCustomReferencedComponent2
Now, if I right-click on "MyCustomReferencedComponent" and select "delete", I get the following exception:
java.lang.ClassCastException: com.vaadin.ui.Panel cannot be cast to com.vaadin.ui.ComponentContainer
at com.vd.ui.DesignerUI$2.remove(DesignerUI.java:359)
at com.vd.ui.DesignerUI$2.handleAction(DesignerUI.java:342)
at com.vaadin.ui.Tree.changeVariables(Tree.java:533)
at com.vaadin.server.communication.ServerRpcHandler.changeVariables(ServerRpcHandler.java:485)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:301)
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:180)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:93)
I thing that the deletion from a Panel component has this issue in general.
Any ideas?
Cheers
jim
|
|
|
Post by Admin on Jan 26, 2015 9:52:17 GMT 1
This is a bug! If you insert a second component (not referenced) to a Panel, then you normally end with the second only as a child because the Panel has setContent method, not addComponent... For some reason this is not the case with referenced components! I will probably correct it to have the same behaviour in both cases and add a confirmation popup when you try to replace the content of a Panel (to avoid loosing entire tree blocks).
|
|
jimb
New Member
Posts: 20
|
Post by jimb on Jan 26, 2015 11:41:37 GMT 1
Cheers!
|
|
jimb
New Member
Posts: 20
|
Post by jimb on Jan 26, 2015 11:50:38 GMT 1
Cheers mate!
|
|
|
Post by Admin on Jan 26, 2015 15:35:16 GMT 1
I corrected the wrong behaviour with referenced components; now each panel can always contain one component only.
|
|