Share

YUI Library

Tracker: Bugs

5 [#2236156] getButtonBy doesn't work with custom id's on btns - ID: 2117571
Last Update: Comment added ( gpuckett )

getButtonByValue(string) and getButtonById(string) do not work if a custom
id is specified for the buttons.

var toolbar = new YAHOO.widget.Toolbar("toolbar", {
buttons:[
{id:'button1',type:'push',label:'button1', value:'button1'},
{id:'button2',type:'push',label:'button2', value:'button2'}
]
});

// both return false
var button1 = toolbar.getButtonByValue('button1');
var button2 = toolbar.getButtonById('button2');


Gareth Davis ( gid79 ) - 2008-09-18 09:24

5

Closed

Fixed

george puckett

Editor

2.5.2

Public


Comments ( 4 )

Date: 2009-01-24 07:24
Sender: gpuckettProject Admin

The YUI project has been migrated from Source Forge to YUILibrary.com.
This ticket has been moved to the tracker on YUILibrary.com that
corresponds to the project it was filed against (YUI2, YUI3, Compressor,
etc.). All tickets not yet closed on Source Forge have been transferred
with their current state intact. The Source Forge instance of all tickets
is being marked as closed to avoid confusion. You can track the
status/progress of this ticket at http://yuilibrary.com/ using the same
ticket ID as it held in Source Forge.


Date: 2009-01-22 09:28
Sender: gpuckettProject Admin

This issue has been resolved. The fix will be included in the next YUI
update. A comment will be added to this bug to notify you when the release
is posted and the fix is available for your use.



Date: 2008-09-24 17:25
Sender: gpuckettProject Admin

This bug report is being forwarded to the author or current owner of the
affected component for additional investigation and response.


Date: 2008-09-18 09:50
Sender: marktucks

Index: editor-beta-debug.js
===================================================================
--- editor-beta-debug.js (revision 612)
+++ editor-beta-debug.js (working copy)
@@ -91,7 +91,8 @@
oConfig.element.className = 'yui-button yui-' +
oConfig.attributes.type + '-button';
oConfig.element.innerHTML = '<span class="first-child"><a
href="#">LABEL</a></span>';
oConfig.element.firstChild.firstChild.tabIndex = '-1';
- oConfig.attributes.id = Dom.generateId();
+ // Set the id to the supplied id, if there is one, else generate
it.
+ oConfig.attributes.id = (oConfig.attributes.id ||
Dom.generateId());

YAHOO.widget.ToolbarButton.superclass.constructor.call(this,
oConfig.element, oConfig.attributes);
};
Fix for editor-beta-*.js

The supplied id's were not being set, they were just automatically set to
generated ones. In the amended line, it sets the id to the one supplied, if
one was supplied, else sets it to a generated one. Now allows lookup on
custom id.


Attached File ( 1 )

Filename Description Download
getButtonByValueAndId.html YUI Test case Download

Changes ( 10 )

Field Old Value Date By
status_id Open 2009-01-24 07:24 gpuckett
close_date - 2009-01-24 07:24 gpuckett
allow_comments 1 2009-01-24 07:24 gpuckett
assigned_to davglass 2009-01-24 07:24 gpuckett
resolution_id None 2009-01-22 09:28 gpuckett
summary Toolbar.getButtonBy* doesn't work with custom id's on btns 2008-09-24 17:25 gpuckett
assigned_to nobody 2008-09-24 17:25 gpuckett
summary Toolbar.getButtonBy* don' work with custom id 2008-09-18 09:25 gid79
summary Toolbar.getButtonBy* don't work with custom id 2008-09-18 09:24 gid79
File Added 293835: getButtonByValueAndId.html 2008-09-18 09:24 gid79