Opened 13 years ago

Closed 12 years ago

Last modified 10 years ago

#1052 closed enhancement (wontfix)

proposing getWidget(id) method that would create a widget if it doesnt exists

Reported by: dusan Owned by: bill
Priority: high Milestone: 0.9
Component: Widgets Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

I am proposing helper method dojo.getWidget(id)

  • if widget already exists it would just return it
  • if it doesn't exists it would look for a node with given id and parse it into widget

dojo.getWidget(id){

var widget = dojo.widget.byId(id); if (widget) return widget; var xp = new dojo.xml.Parse(); return dojo.widget.getParser().createComponents(xp.parseElement(dojo.byId(id), null, true))[0];

}

It can be improved with createWidget() method after Ticket #1019 is resolved.

Change History (2)

comment:1 Changed 13 years ago by dylan

Component: CoreWidgets
Milestone: 0.40.5
Owner: changed from anonymous to bill
Version: 0.40.3

comment:2 Changed 12 years ago by bill

Resolution: wontfix
Status: newclosed

This is simple enough that users can just implement it themselves if they need it, and I haven't heard a lot of demand for it.

Note: See TracTickets for help on using tickets.