Login Register

id

Elegant way of bypassing "Tried to register widget but that id is already registered" ?

I have a ContentPane which contains several dijit widgets (created declaratively: <div id="23" dojoType="dijit.Dialog"/> for instance), each with its own id. The content of the ContentPane is initially provided in ajax-fashion by setting the href property.

dojo anchor: get widget id and targets attributes inside subscribed topic?

I use dojo anchor widget.
It successfully gets response in json from server, but I have seral problems accessing widget, that published a topic.
Please, see my code:

dojo.event.topic.subscribe("/after", function(data, request, widget){
    alert('inside a topic event. after request');
    //data : text returned from request(the html)
    //request: XMLHttpRequest object
    //widget: widget that published the topic
});

Problems:
1. Can't change data value. If I just use inside dojo.event.topic.subscribe:

Get the id of current selected item in ComboBox

How can i get the selected item's id(not the displayed text value but the key) of a diji.form.ComboBox?
I searched in the web and this forum for about 1 days, but neither have the solution.
My data store for the ComboBox is as follows:
{identifier:"name",
items: [
{name:"China", label:"Ch"},
{name:"USA", label:"US"}
]}
and I want to get the label "Ch" or "US". However, when using the getValue(), i always get the "China" and "USA".

Syndicate content