Opened 13 years ago
Closed 10 years ago
#8631 closed defect (duplicate)
dojo.query does not like the = character
Reported by: | Matthias Sch. | Owned by: | dylan |
---|---|---|---|
Priority: | low | Milestone: | future |
Component: | Query | Version: | 1.2.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
i'm using zend framework and converted my existing dropdown-box to a filteringselect-dijit. i know that this is not the zf issue tracker, but it looks like a dojo-gug:
my form control: $start_newsfeed = $this->createElement('FilteringSelect?', 'start_newsfeed'); $start_newsfeed->setLabel('Startseite: Newsfeed') ->addMultiOption(, '(Standard)'); foreach (App_Core::getInstance()>getConfig('feeds')>feed->news->toArray() as $item) $start_newsfeed->addMultiOption($itemlink?, $itemname?);
this creates a list: <option value="http://www.diebauzeitung.at/extend/rss.php?id=47018&z=20" label="diebauzeitung.at" selected="selected">diebauzeitung.at</option> <option value="http://www.wirtschaftsblatt.at/rss/heute" label="WirtschaftsBlatt? Heute">WirtschaftsBlatt? Heute</option>
when i populate the field with the settings read from the db, there are 2 different results: if the value is "http://www.diebauzeitung.at/extend/rss.php?id=47018&z=20" then there is nothing selected... if the value is "http://www.wirtschaftsblatt.at/rss/heute" then the correct entry "WirtschaftsBlatt? Heute" is selected...
maybe it does not correctly handle the special chars (? & ; =) in the value?
Change History (10)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
var zendDijits = [{"id":"start_newsfeed","params":{"dojoType":"dijit.form.FilteringSelect?"}},{"id":"start_google","params":{"dojoType":"dijit.form.FilteringSelect?"}},{"id":"start_weather","params":{"dojoType":"dijit.form.FilteringSelect?"}},{"id":"save","params":{"label":"Speichern","dojoType":"dijit.form.Button"}},{"id":null,"params":{"dojoType":"dijit.form.Form"}}];
<select name="start_newsfeed" id="start_newsfeed">
<option value="http://www.diebauzeitung.at/extend/rss.php?id=47018&z=20" label="diebauzeitung.at" selected="selected">diebauzeitung.at</option> <option value="http://www.wirtschaftsblatt.at/rss/heute" label="WirtschaftsBlatt? Heute">WirtschaftsBlatt? Heute</option>
</select>
---
var zendDijits = [{"id":"start_newsfeed","params":{"dojoType":"dijit.form.FilteringSelect?"}},{"id":"start_google","params":{"dojoType":"dijit.form.FilteringSelect?"}},{"id":"start_weather","params":{"dojoType":"dijit.form.FilteringSelect?"}},{"id":"save","params":{"label":"Speichern","dojoType":"dijit.form.Button"}},{"id":null,"params":{"dojoType":"dijit.form.Form"}}];
<select name="start_newsfeed" id="start_newsfeed">
<option value="http://www.diebauzeitung.at/extend/rss.php?id=47018&z=20" label="diebauzeitung.at">diebauzeitung.at</option> <option value="http://www.wirtschaftsblatt.at/rss/heute" label="WirtschaftsBlatt? Heute" selected="selected">WirtschaftsBlatt? Heute</option>
</select>
comment:3 Changed 13 years ago by
Oh I see , I didn't realize you were talking about the value attribute of the option tag. Yeah, I assume like you said that it's choking on the special characters.
I assume the zendDijits parameter above is unneeded.
comment:4 Changed 13 years ago by
Milestone: | tbd → 1.4 |
---|
comment:5 Changed 13 years ago by
Component: | Dijit → Core |
---|---|
Owner: | set to alex |
Summary: | filteringselect/combobox: value not set correctly (special chars?) → dojo.query does not like the = character |
This appears to be a dojo.query bug. Consider the following snipit:
<select> <option value="=">=</option> <option value="=4">=4</option> <option value="4=">4=</option> <option value="4=4">4=4</option> </select> <input type=button onclick=alert(dojo.query("option[value='=']")[0]) value="query option with ="> <input type=button onclick=alert(dojo.query("option[value='=4']")[0]) value="query option with =4"> <input type=button onclick=alert(dojo.query("option[value='4=']")[0]) value="query option with 4="> <input type=button onclick=alert(dojo.query("option[value='4=4']")[0]) value="query option with 4=4">
dojo.query with = and 4= correctly return option nodes, but =4 and 4=4 incorrectly returns nothing on FF2, FF3, IE6, IE7, and Safari 3.
On Safari 4, all 4 tests correctly return an option element. I'm testing on the latest trunk = [17488].
comment:6 Changed 13 years ago by
Component: | Core → Query |
---|
comment:7 Changed 13 years ago by
With latest trunk code and FF 3.5, the tests doughays now pass. IE8 also works, but IE7 is still broken.
comment:8 Changed 13 years ago by
Milestone: | 1.4 → future |
---|
comment:10 Changed 10 years ago by
Priority: | high → low |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Duplicate of #7479.
Maybe. It's hard to tell without a test case (and I need a test case against plain dojo, not using zend). Can you attach a test case? You should be able to see what zend is generating (and sending to your browser) just by doing a view source.