Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9897 closed defect (fixed)

Parser doesn't recognize parameters added after first widget instantiated

Reported by: bill Owned by: bill
Priority: high Milestone: 1.4
Component: Parser Version: 1.3.2
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

This is an edge case, but this doesn't work:

  1. the parser parses a page with a ContentPane, thus caching the list of possible parameters for ContentPane:
    ...
    <div dojoType=dijit.layout.ContentPane>
    ...
    
  1. after the parse, there's a dojo.require("dijit.layout.BorderContainer"), or TabContainer, etc, some class that adds new parameters to _Widget:
    dojo.extend(dijit._Widget, {
    	// region: [const] String
    	//		"top", "bottom", "leading", "trailing", "left", "right", "center".
    	//		See the BorderContainer description for details on this parameter.
    	region: '',
    ...
    });
    
  1. parser is called again, to parse another ContentPane (inside a BorderContainer) that passes the new parameters like region:
    <div dojoType=dijit.layout.ContentPane region=top>
    

The parser won't pick up the region parameter and thus the BorderContainer won't layout correctly.

I think this actually might be a common case for dojox.layout.ContentPane, when the href-loaded content does dojo.require() calls.

I'll check in a test case along with the fix.

Change History (3)

comment:1 Changed 10 years ago by bill

Description: modified (diff)

comment:2 Changed 10 years ago by bill

Resolution: fixed
Status: newclosed

(In [20112]) Widgets like BorderContainer? add properties to _Widget via dojo.extend(). If BorderContainer? is loaded after _Widget's parameter list has been cached, we need to refresh that cache (for _Widget and all widgets that extend _Widget).

Fixes #9897 !strict.

comment:3 Changed 10 years ago by bill

(In [20615]) Use anonymous dojo.declare() rather than dojo.extend(), because dojo.extend() makes the parser flush it's cache. (And this particular dojo.extend() happens each time a Slider is instantiated.) Refs #9897 !strict.

Note: See TracTickets for help on using tickets.