6 Mar 2012 7:53 PM #1
FieldSet has both setCollapsed() and setExpanded()
This is confusing.
Which one to use?
And for setExpanded() no corresponding isExpanded() getter.
Hm... and using setExpanded() cause NullPointerException, at least in UiBinder.
java.lang.NullPointerException at com.sencha.gxt.widget.core.client.form.FieldSet.expand(FieldSet.java:110) at com.sencha.gxt.widget.core.client.form.FieldSet.setExpanded(FieldSet.java:147) at com.mycompany.project.client.Composite_3_BinderImpl_designTime1331092409143.createAndBindUi(Composite_3_BinderImpl_designTime1331092409143.java:72) at com.mycompany.project.client.Composite_3_BinderImpl_designTime1331092409143.createAndBindUi(Composite_3_BinderImpl_designTime1331092409143.java:1)
On the other hand, using setCollapsed() in UiBinder does nothing - no exception, but no result too.Konstantin Scheglov
6 Mar 2012 8:34 PM #2
Thanks for pointing this out. I've filed a bug against the team to have them review the API.
At the moment, it seems as though the API is as follows:
- expand()/collapse(): Actually performs an expand/collapse.
- setExpanded(boolean): Convenience method, delegates directly to expand() or collapse().
- setCollapsed(boolean): Only sets the internal state of whether the panel is collapsed; does not actually do the expand or collapse. This method should probably not be public.
I've also filed a different, separate bug for expanded in UiBinder. I'll update this thread with any changes in either of these tickets.
Last edited by WesleyMoy; 6 Mar 2012 at 8:36 PM. Reason: BB formatting
11 Mar 2012 8:31 AM #3
Beta4: Trying to initialize a FieldSet as collapsed throws NullPointerException.
Dear Sencha Team,
I have tried to hide a part of a form using a collapsed FieldSet.
Code:final FieldSet fieldSet = new FieldSet(); fieldSet.setCollapsible(true); fieldSet.setCollapsed(true);
Code:Caused by: java.lang.NullPointerException at com.sencha.gxt.widget.core.client.form.FieldSet.collapse(FieldSet.java:98) at com.sencha.gxt.widget.core.client.form.FieldSet.setExpanded(FieldSet.java:149)
On a side note, the API seems to provide several methods which serve the same purpose:
Code:collapse() expand() setExpanded(boolean) setCollapsed(boolean)
13 Mar 2012 7:27 AM #4
FieldSet has been updated with better JavaDocs.
- isCollapsed changed to isExpanded to match setExpanded
- setCollapsed removed
Changes are in SVN (rev 2340).
14 Mar 2012 4:49 AM #5
15 Mar 2012 3:48 AM #6
danmartens, I've merged your thread into this one as it seems to represent the same issue. As expected then, I'm not able to reproduce the bug with the use case you described with SVN builds of Ext GWT 3. I'll update this thread once a release becomes available that includes this fix.
16 Mar 2012 1:28 AM #7
Thanks. For now, I have workaround in place: a scheduled command collapses the FieldSet at a later, safer time.
As soon as the new release hits the shelves, I'll revert to give it a spin.
28 Mar 2012 2:33 PM #8
These bugs have been fixed in the Ext GWT 3.0 Release Candidate. Please upgrade your copy of Ext GWT and try your test cases again. While we're confident that we've addressed this issue, please reply if you notice any continued problems after upgrading. Again, thanks for taking the time to report these bugs.