This exception happens intermittently. I'll try to build a standalone example to reporiduce it but maybe this is a known issue.
It happens when I repeatedly add and remove the components to the parent component which has RowLayout set to it and calling Viewport.layout() after each such an iteration.
Obviously the exact logic is much more complex.
What prompts me to think that this is a bug is that if I replace the RowLayout with BorderLayout it works just fine.
java.lang.ClassCastException: com.extjs.gxt.ui.client.widget.layout.BorderLayout Data
at com.extjs.gxt.ui.client.widget.layout.RowLayout.la youtVertical(RowLayout.java:163)
at com.extjs.gxt.ui.client.widget.layout.RowLayout.on Layout(RowLayout.java:212)
at com.extjs.gxt.ui.client.widget.Layout.layout(Layou t.java:71)
at com.extjs.gxt.ui.client.widget.Layout$1.handleEven t(Layout.java:48) Secretarial & Typing Work From Home.::
How To Start A Secretarial Service Business And Get Legitimate Freelance Typing & Data Entry Work From Home.
http://welcomewlc.LEVADUELL.hop.clickbank.netHOME | High 75% Commission - Super High Converting Job Site!::
TradeTrend.com Offers An Amazing 75% Commission Or 35.25 Per $47 Sale. New Program Is Getting Super High Conversions. Employment Site Offering Jobs In Focus Groups, Data Entry, Mystery Shopping And More.
http://welcomewlc.TTREND.hop.clickbank.netHOME |
at com.extjs.gxt.ui.client.widget.Layout$1.handleEven t(Layout.java:1)
at com.extjs.gxt.ui.client.event.BaseObservable.fireE vent(BaseObservable.java:74)
at com.extjs.gxt.ui.client.widget.Component.fireEvent (Component.java:403)
at com.extjs.gxt.ui.client.widget.BoxComponent.setSiz e(BoxComponent.java:411)
at com.extjs.gxt.ui.client.widget.Layout.setSize(Layo ut.java:208)
at com.extjs.gxt.ui.client.widget.layout.RowLayout.la youtVertical(RowLayout.java:201)
I guess the situation in which this could happen (when reusing the container) is as follows:
- set the BorderLayout to the container
- add components
- call ViewPort.layout()
- do some work
- remove components with removeAll(). Tthis doesn't force components to be removed:
// from Container.java
public boolean removeAll() {
return removeAll(false);
}
- set the RowLayout to the container
- add components
- call ViewPort.layout()
- get the exception since there is (potentially) a component that has BorderLayoutData set on it.
Is this something that you could/will look in to or should I just avoid reuse of the container?
RowLayout expects RowData. It looks like the layout data is BorderLayoutData which is why the class cast exception occurs.
After the container has been rendered, this is true. You need to call layout().
Could you please explain? I need to call removeAll() followed by the layout() to force the removal, is this what you mean?
After a container is rendered, adding and removing children will not update the UI. The UI will be updated when container's layout is executed. Another approach is to call setLayoutOnChange(true) to have the container's layout execute any time there is a change to the children of the container.
I am not sure I understand you question. Containers can be reused, however, when changing layouts, the children must use the appropriate layout data.
remove components with removeAll(). Tthis doesn't force components to be removed:
After the container has been rendered, this is true. You need to call layout().
How much does getting a small tattoo on your hip/stomach hurt?
Do anyone else have an itchy anus? ?
|