Success! Looks like we've fixed this one. According to our records the fix was applied for
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.
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
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.
But the collapse call fails, apparently on account of the collapse button, which has not been initialized yet at that stage.
final FieldSet fieldSet = new FieldSet();
Was I wrong to expect this to be possible?
Caused by: java.lang.NullPointerException
On a side note, the API seems to provide several methods which serve the same purpose:
Thanks in advance for your assistance!
FieldSet has been updated with better JavaDocs.
- isCollapsed changed to isExpanded to match setExpanded
- setCollapsed removed
Calling expand before render now does not cause an exception. I am guessing that was the exception you mentioned in UiBinder. If this is not the case, please post another ticket with the details.
Changes are in SVN (rev 2340).
Is this related to the NullPointerException I reported in http://www.sencha.com/forum/showthre...nterException. ?
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.
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.
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.