Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1525 closed defect (fixed)

[Widget] Subwidget definitions not necessarily respecting CSS definitions.

Reported by: Tom Trenka Owned by: liucougar
Priority: high Milestone:
Component: Widgets Version: 0.3
Keywords: Cc: [email protected]
Blocked By: Blocking:


See ticket #1483; this ticket replaces that as a bug report.

Attachments (1)

test_1525.rar (3.9 KB) - added by [email protected] 15 years ago.
test file for ticket#1525

Download all attachments as: .zip

Change History (11)

comment:1 Changed 15 years ago by Tom Trenka

Cc: [email protected] added

comment:2 Changed 15 years ago by [email protected]

I have found 3 problems:

1.About the LayoutCotainer?,the code is

    <div dojoAttachPoint="subContainerWidget" dojoType="LayoutContainer"  style="width:100%;height:100%;border:1px solid red" layoutChildPriority="none">
	<div dojoAttachPoint="contentPane1" dojoType="ContentPane" layoutAlign="left" style="width:30%;height:100%;border:1px solid green">Pane 1</div>
	<div dojoAttachPoint="contentPane2" dojoType="ContentPane" layoutAlign="left" style="width:30%;height:100%;border:1px solid blue">Pane 2</div>			

The width and height value can set to the LayoutContainer?,but can not be set to the ContentPane?

2.About Event,the code is

    <div dojoAttachPoint="subContainerWidget">
	<div class="account">
	    <div dojoType="DropDownButton" menuId='saveMenu' dojoAttachPoint="account_type"><img src="../src/gearon/widget/template/mobile.png"/></div>
    <div dojoType="PopupMenu2" id="saveMenu" toggle="wipe">
	<div dojoType="MenuItem2" iconSrc="../src/gearon/widget/template/mobile-hidden.png" caption="Show it" onClick="dojo.debug('bb')"></div>	
	<div dojoType="MenuItem2" iconSrc="../src/gearon/widget/template/mobile.png" caption="Not to Show" onClick="dojo.debug('aaa')"></div>

I define two menuitems here,and each time i click on the first icon,its onclick method will get invoked. But for the second icon,it just does nothing. By the way,if i omit the toggle attribute of the popupmenu2, none of these two item's onclick method get invoked.

3.About Comment,the code look like this

<!-- some comment here -->
    <div dojoAttachPoint="subContainerWidget"></div>

If i have some comment code at the beginning of the template file,it seem that the template will not be interpret correctly.But it seem that this is not specified to sub widget definition,but will make problem to common template file.

comment:3 Changed 15 years ago by liucougar

Version: 0.40.3
  1. can you set a style on a standalone contentpane?
  1. as I said, you should not use onClick, use dojoAttachEvent instead (which is the official supported event attachment method)
  1. please file another bug on this (search first, maybe there is already one)

comment:4 Changed 15 years ago by [email protected]

1.I have try the whole template in a common html page,so i think i konw how to make stylesheet apply on a contentpane.

2.I have try both ways,and it has the same effect.Btw,the second item seen to response the mouse event one time,but no more than one time.

comment:5 Changed 15 years ago by liucougar

  1. please upload a test file for this (to be placed under dojo/tests/widget)
  1. please upload a js file (which I can place under dojo/src/widget) and a test file (which can be placed under dojo/tests/widget), I will look into this

Changed 15 years ago by [email protected]

Attachment: test_1525.rar added

test file for ticket#1525

comment:6 Changed 15 years ago by [email protected]

I have attach the test file,the account2_widget_test is for the problem 2.And the account3_widget_test is for the problem 1.

comment:7 Changed 15 years ago by [email protected]

The second problem has been solved.I change the toggle value of the popupmenu from wipe to fade then everything seen ok.But if the toggle value is explode or plain ,then the firefox will get an exception and exit,maybe this is a bug of popupmenu but not the widgetInTemplate

comment:8 Changed 15 years ago by liucougar

Resolution: fixed
Status: newclosed

(In [5911]) fixes #1525: Subwidget definitions not necessarily respecting CSS definitions.

The problem is not failure of respecting CSS. The real issue is that when the chidren widget are created, the top widget is not appended to the document dom tree, so its size is invalid and LayoutContainer? can not layout its children successfully. This patch moves the widgetsInTemplate support after this.domNode is appended to the dom tree.

In order to have this work correctly, dojo.widget.createWidget should be called with a third parameter to specify where to insert this widget in the dom tree. This is required if you use some widgets (like LayoutContainer?) relying on correct sizing when created.

comment:9 Changed 15 years ago by liucougar

about the second problem, please file another bug. Be sure to attach a test file (please submit as few files as possible, and do not use your own namespace when submit test cases)

another note is: try defining the popup in your main html and toggle=plain/explode, does that work?

comment:10 Changed 15 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.