Hi,
Thanks for your excellent support on this forum - this is truly amazing. I would like to ask for some help yet another time.
I want to lazy load a tab within an accordion and then add a list of buttons dynamically to this tab. However, I am not able to actually add the button to the tab. Below is the code I have so far. Note that the last operation is not allowed (null pointer exception).
Found out that I needed to declare the componentsFactory by @Inject. That solved the null pointer. But now I’m having this error:
ClassCastException: com.haulmont.cuba.web.gui.components.WebAccordion$Tab cannot be cast to com.haulmont.cuba.gui.components.Component$Container
There seems no way to add a button to a tab.
As a workaround (solution?), I am now adding a buttonpanel to the tab intially. However, I am not able to get access to this button panel as the tab (and its components) is not available before it is clicked and the tab interface does not provide access to the underlying buttonpanel.
But then the problem is that I cannot get the click event registered for the button. This can be done using the Vaadin native approach but such components cannot be added to the CUBA accordion component. So I’m stuck this way as well.
Hi Konstatin,
Thanks for your answer, have to try it out but it seems to be the solution for placing buttons in the accordion. I didn’t find the getComponentNN() anywhere so thanks for your help.
One thing remains a question to me. In what way can you set a method to invoke on click of the button that is dynamically added? I know how to do it with the native Vaadin button but that doesn’t mix with the Cuba components.