Last Call: Critical Echo3 Bugs

tliebeck's picture

Echo3/Extras Beta2 and EchoStudio Beta1 land this week (Tuesday) with any luck. Would greatly appreciate any critical bugs being reported.

I'm looking only for show-stopping bugs and minor issues that are straightforward and inexcusable not to correct.

Perhaps I have one...

I did download the echogo of today builds, and it seems that there is a problem in deregistration of event listeners on the client side.

When the application is closing the (modal) login dialog I receive a JS error in firefox with this message: element is undefined

The script code (according to the JS console of FF3.03)

Core.Web.DOM.stopEventPropagation(e);
},
remove: function(element, eventType, eventTarget, capture) {
Core.Web.Event._lastId = null;
if (!element.__eventProcessorId) {
return;
}
var listenerMap = capture ? Core.Web.Event._capturingListenerMap 
: Core.Web.Event._bubblingListenerMap;
var listenerList = listenerMap.map[element.__eventProcessorId];
if (listenerList) {
listenerList.removeListener(eventType, eventTarget);
if (listenerList.isEmpty()) {
listenerMap.remove(element.__eventProcessorId);
}
if (!listenerList.hasListeners(eventType)) {
Core.Web.DOM.removeEventListener(element, eventType, Core.Web.Event._processEvent, false);
}
}
},
removeAll: function(element) {
Core.Web.Event._lastId = null;
if (!element.__eventProcessorId) {
return;
}
Core.Web.Event._removeAllImpl(element, Core.Web.Event._capturingListenerMap);
Core.Web.Event._removeAllImpl(element, Core.Web.Event._bubblingListenerMap);
},
_removeAllImpl: function(element, listenerMap) {
var listenerList = listenerMap.map[element.__eventProcessorId];
if (!listenerList) {
return;
}
var types = listenerList.getListenerTypes();
for (var i = 0; i < types.length; ++i) {
Core.Web.DOM.removeEventListener(element, types[i], Core.Web.Event._processEvent, false); 
}
listenerMap.remove(element.__eventProcessorId);
},
toString: function() {
return "Capturing: " + Core.Web.Event._capturingListenerMap + "\n"
+ "Bubbling: " + Core.Web.Event._bubblingListenerMap;
}
};

The error occurs in the line

if (!element.__eventProcessorId) {

direct after the removeAll: function

Then pressing F5 shows the new screen correctly and the application works as expected.

The same happens with IE 7

The same happens with IE 7 under Vista.

The error message is:

__eventProcessorId is not a object or is null

tliebeck's picture

Could you try this in Opera

Could you try this in Opera and post the full JS stack trace? (Opera is the only browser that gives stack traces.) I'm curious to see what's calling removeAll with null. If you can't grab Opera, would appreciate knowing components are being modified and/or removed when the crash occurs. Thanks!

Edit...wait don't bother doing this, think I know exactly what is causing this.

tliebeck's picture

Does the windowpane have a

Does the windowpane have a border with one or more sides set to 0 width/height?

If so, SVN 1380 (jars attached) will cure it.

Problem solved!

Yes,

it did occur with the windowpane with no border.

The attached SVN 1380 version solved the problem.

I will anyway install Opera so I can provide stacktraces in the future

Thanks.

tliebeck's picture

Good deal, and thanks for

Good deal, and thanks for reporting, exactly the type of stuff I'm looking for here!

Tod, I'm not sure if my

Tod,

I'm not sure if my previous message was not answered because it was accidentally overlooked or because I highlighted something that has an obvious solution (which I didn't work out, and hence I am a complete dope), but anyway here is the link to it : http://echo.nextapp.com/site/node/5479 .
It has to do with ContentPane's in ScrollPane's not working as documented. When I say setVerticalScoll(new Extent(100)), it does nothing, but when I say setVerticalScroll(new Extent(-1)), it does.

Raju Karia

tliebeck's picture

Thanks, this should now be

Thanks, this should now be fixed in SVN 1381.

It works

Suddenly, all my scrolling test apps came to life ! Thanks a lot.

RK

mjablonski's picture

[SOLVED] Problem with global styles

(I did find the problem in my code, see Update 2 below... shame on me...)

Hi,

I have encountered a problem with global styles which leads to a messed view, but I'm not able to extract a simple test case (I'll try again tomorrow):

http://bugs.nextapp.com/mantis/view.php?id=28

Description of the problem:

- I'm using a StyleSheet like the following (just an example definition for one component to illustrate, doesn't show the problem):

public class StyleSheet extends MutableStyleSheet {
public static final String STANDARD = "standard";

private static final MutableStyle CHECKBOX = new MutableStyle();
static {
CHECKBOX.set(CheckBox.PROPERTY_ALIGNMENT, Alignment.ALIGN_TOP);
CHECKBOX.set(CheckBox.PROPERTY_TEXT_ALIGNMENT, Alignment.ALIGN_TOP);
CHECKBOX.set(CheckBox.PROPERTY_ROLLOVER_ENABLED, Boolean.TRUE);
CHECKBOX.set(CheckBox.PROPERTY_ROLLOVER_FOREGROUND, ROLLOVER_COLOR);
CHECKBOX.set(CheckBox.PROPERTY_DISABLED_FOREGROUND, DISABLED_FOREGROUND);
}

... definitions for other components ...

public StyleSheet() {
addStyle(CheckBox.class, STANDARD, CHECKBOX);
...
}
}

- I'm adding the StyleSheet to my ApplicationWindow at application start like the following:

public Window init() {
setStyleSheet(new StyleSheet());
...
}

- I'm using "wrapped" components which are setting the StyleName in the constructor:

public class CheckBox extends nextapp.echo.app.CheckBox {
public CheckBox(String text) {
super(text);
setStyleName(StyleSheet.STANDARD);
}
}

- This way my application works without problems.

- When I set STANDARD to "" (= empty style = enabling global style for all components) and remove the calls to setStyleName in my components, I'm ending up with a messed view under certain circumstances:

=> WindowPane holds a TabPane and each Tab holds a Grid with different Labels and InputFields (like TextField, CheckBox, etc.pp). The Grids are completely rebuilt (removeAll, adding components) when the WindowPane is "re-openend" (=made visible). After a TabSwitch and several "re-openings", the Grid gets messed up... it "looks" like the components of the Grid are added several times to the Grid. Please note: This doesn't happen when I use setStyleName(StyleSheet.STANDARD) in my components (even with STANDARD=""), so I don't think that this is a problem of my code.

I'm trying to come up with a simple test case, but no luck so far. The whole problem isn't critical to me (because running with setStyleName works fine), but I would bring up the problem, because something is wrong with global styles.

Cheers, Maik

-------------------------------------------------------

UPDATE 1: If I patch app/nextapp/echo/app/Component.java like the following, the problem is goes away.

Index: src/server-java/app/nextapp/echo/app/Component.java
===================================================================
--- src/server-java/app/nextapp/echo/app/Component.java (revision 1380)
+++ src/server-java/app/nextapp/echo/app/Component.java (working copy)
@@ -273,6 +273,7 @@
super();
flags = FLAG_ENABLED | FLAG_VISIBLE | FLAG_FOCUS_TRAVERSAL_PARTICIPANT;
localStyle = new MutableStyle();
+ styleName = "";
}

-------------------------------------------------------

UPDATE 2: Problem is solved now. I've made modifications to the Grid within the init()-method which isn't allowed by specs. It's an interesting fact that the whole application worked in the first place at all... so as a reminder (for me and maybe others):

Modifications to the component hierarchy are not allowed within #init().

/**
* Life-cycle method invoked when the <code>Component</code> is added
* to a registered hierarchy. Implementations should always invoke
* <code>super.init()</code>.
* Modifications to the component hierarchy are not allowed within this
* method.
*/
public void init() { }

mjablonski's picture

Missing var declaration in Serial.js

Just a minor one: There's a var-declaration missing in Serial.js.

Cheers, Maik

Index: src/client/echo/Serial.js
===================================================================
--- src/client/echo/Serial.js (revision 1380)
+++ src/client/echo/Serial.js (working copy)
@@ -435,7 +435,7 @@
var element = Core.Web.DOM.getChildElementByTagName(pElement, "b");
var border = {};

- value = element.getAttribute("t");
+ var value = element.getAttribute("t");
if (value) {
border.top = value;
value = element.getAttribute("r");

mjablonski's picture

Trailing comma in Sync.List.js

There's a trailing comma in Sync.List.js which may cause problems for some JavaScript-engines.

Cheers, Maik

Index: src/client/echo/Sync.List.js
===================================================================
--- src/client/echo/Sync.List.js (revision 1380)
+++ src/client/echo/Sync.List.js (working copy)
@@ -13,7 +13,7 @@
$abstract: true,

$virtual: {
- listBox: false,
+ listBox: false
},

_hasRenderedSelectedItems: false,

mjablonski's picture

Missing var declaration in RemoteClient.js

Index: src/server-java/webcontainer/nextapp/echo/webcontainer/resource/RemoteClient.js
===================================================================
--- src/server-java/webcontainer/nextapp/echo/webcontainer/resource/RemoteClient.js (revision 1380)
+++ src/server-java/webcontainer/nextapp/echo/webcontainer/resource/RemoteClient.js (working copy)
@@ -1027,7 +1027,7 @@
if (!translator) {
throw new Error("Translator not available for property type: " + propertyType);
}
- propertyValue = translator.toProperty(this._client, propertyElement);
+ var propertyValue = translator.toProperty(this._client, propertyElement);
if (!this._referenceMap) {
this._referenceMap = {};
}

tliebeck's picture

Thanks, these three are

Thanks, these three are fixed in 1382.

BTW, are you running a lint-er to find these, or just stumbling upon them?

I'm somewhat unhappy with JSLint.com as it hits a lot of stuff that is valid, e.g., evaluating (x==null) suggests instead using x===null for strict equality. But I don't want strict equality, and I don't want to simply evaluate x as true or false, where 0 or an empty string would evaluate to false. I really want to know if x is either undefined or has been specifically set to null...and I don't see an option to set this.

tliebeck's picture

Update...actually just

Update...actually just downloaded JSLint and removed the check for "== null / != null", and it's working pretty well. It's still snagging a few annoying things, e.g. it gets angry at this code:

    newInstance: function(typeName, renderId) {
        var typeConstructor = this._typeToConstructorMap[typeName];
        if (!typeConstructor) {
            throw new Error("Type not registered with ComponentFactory: " + typeName);
        }
        var component = new typeConstructor();
        component.renderId = renderId;
        return component;
    },

For not having an uppercase letter as first char of the constructor "typeConstructor"...and also gets annoyed at the use of new Array(length).

Generally happy with it at the moment though.

mjablonski's picture

Hi Tod, I'm using the

Hi Tod,

I'm using the Spket-JavaScript-Editor as Eclipse-Plugin (free for non-commercial, http://spket.com/). It does a pretty good job when working with JavaScript.

Cheers, Maik

Opera bugs critical ?

Hello,

after installing Opera I did some tests with the current svn release and noticed some problems.
Should these also be "critical" ? (We and our clients don't use Opera)

A few problems:

- Menubar (with toplevel icons?) is not rendered at all
- Tabpane don't work
- Under some conditions in modal windowpanes the text is selected (Of labels, buttons etc.), might be Tabpane problem related

André

tliebeck's picture

9.5x/9.6 bugs have been

9.5x/9.6 bugs have been reported to Opera (they are in the browser, not in Echo):

http://my.opera.com/community/forums/topic.dml?id=250572

Resizing your browser will cure most of them. 9.27 works great.

The selection stuff is due to us focusing the DIV...they render a focus effect with a blue border and all text selected. The blue border is fine, but the text selection looks like hell in my opinion. Uncertain if this can be turned off, but if it can (e.g. via meta tag) we need to so.

Have spent a good two days mucking with the CSS measuring/resizing bugs trying to work around them, to no avail. So far no comment from devs, hoping they're just working on it and getting them into the next build.

Edit...btw...sorry if the tone of this response seems rude...have been all kinds of not happy about the Opera issue :D

tliebeck's picture

I'm going to hold another

I'm going to hold another day (until Wednesday) on Beta2.

I do have a new Echo3 CSJS demo up at http://demo.nextapp.com/echo3csjs. This one features dynamic module loading, so it's roughly half the size it used to be for startup. Would appreciate any testing/bug reporting in it as well. It's running on the latest Echo3/Extras/CoreJS as well. The demo source is available from the download page, and/or from SVN @ https://svn.nextapp.com/svn/echo3demo

I did take some time today to JSLint the entire platform. Had to tweak the JSLint script to avoid checking for == null, as we have a legitimate use for that and it appears quite a bit.

Please feel free to continue reporting any last-minute critical bugs as well, and thanks again for all the issues mentioned and solved so far.

tliebeck's picture

And...

And holding one more. I just need a bit more time to do some final tests on EchoStudio, and want to put one more app against the latest Echo/Extras SVN and test the heck out of it. Really appreciate any testing in the next 18 hours or so on the latest SVN though.

Today I did make a few improvements with the testing phase for this beta...
- We're holding steady state with memory tests in IE6,7, and FF3. Additionally have checked the whole framework for client-side event listener leaks, and we're now good there as well (ColorSelect had one though).
- ColorSelect crosshairs now line up perfectly (tweaked measuring algorithm to include CSS borders...browsers certainly have some very odd behavior here).
- Fixed a couple issues that I saw when playing with the app while the "ghost" test is running.

Tod, I'm encountering a

Tod, I'm encountering a problem in the field with IllegalArgumentException in RemoteClient, I saw that you fixed the exception construction in SVN 1294. Could you include the faulting URL variable in the exception? I hope to reproduce the situation, but I don't have high hopes.

Thanks,

Niels

tliebeck's picture

Thanks, SVN 1426 has it.

Thanks, SVN 1426 has it.