PDA

View Full Version : [FIXED] (beta3) Mask doesn't have an appearance-enabled constructor



lefke123
28 Feb 2012, 6:28 AM
Like the title says, the Mask class does not have a constructor that takes a MaskAppearance as parameter.

private Mask() {
this.appearance = GWT.create(MaskDefaultAppearance.class);
}
And it always creates a MaskDefaultAppearance instead of using the MaskAppearance interface.
Also, your MaskDefaultAppearance doesn't seem to have a constructor that has a resources parameter, as most other appearances have:

public MaskDefaultAppearance() {
this.resources = GWT.create(MaskResources.class);
this.style = this.resources.css();
if (!injected) {
StyleInjector.inject(style.getText(), true);
injected = true;
}
}

Instead of using:

public MaskDefaultAppearance(MaskResources resources) {
this.resources = resources;
this.style = this.resources.css();
if (!injected) {
StyleInjector.inject(style.getText(), true);
injected = true;
}
}

The default Mask appearance isn't included in the Blue theme, but as inner class of Mask.

WesleyMoy
1 Mar 2012, 9:22 PM
We made the decision to make some appearances, like the one for Mask, to be internal to their implementations when it would seem unlikely that a theme author would care to create their own appearance. As a result, we simply bundled the default appearance in with the component itself. The reasoning continues that, if someone were sufficiently motivated to replace the appearance, they could still do so by using a replace-with rule.

That having been said, your other points do look like bugs. I've filed a ticket against the team to have them review Mask based on your comments, and I'll update this thread with any reasoning, guidance, or progress on fixes.

vokiel
6 Mar 2012, 12:24 PM
Well I just slapped my own MaskAppearance class to add some progress indicator in my views. Works pretty well with mask/unmask, so if that's not a valid use case, I'd like to know which approach is best for this.

I just like to blank/mask my views while data is being retrieved asynchronously on the server and show to the user something is happening.

darrellmeyer
18 Mar 2012, 8:21 PM
We have changed the code to this:


this.appearance = GWT.create(MaskAppearance.class);

You can now create a rule to choose a different impl.


<replace-with class="com.sencha.gxt.core.client.dom.Mask.MaskDefaultAppearance">
<when-type-is class="com.sencha.gxt.core.client.dom.Mask.MaskAppearance" />
</replace-with>

Change is in SVN.

WesleyMoy
28 Mar 2012, 2:27 PM
This shortcoming has been fixed in the Ext GWT 3.0 Release Candidate. Please upgrade your copy of Ext GWT and try your scenario 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 this bug.