#4031 closed defect (fixed)
TabContainer - Calling setLabel on controlButton of tab fails
Reported by: | guest | Owned by: | anonymous |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | General | Version: | 0.9 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Trying to set the tab's label from code fails due to the fact that containerNode is not defined for a dijit.layout._TabButton.
Adding the following code to test_TabContainer.html shows the error
dojo.addOnLoad(function(){ ... document.body.appendChild(p); dijit.byId("tab1").controlButton.setLabel("Updated Title"); });
The controlButton is a dijit.form.Button in the end and the setLabel function uses this.containerNode. So the quick answer is to add that as an additional dojoAttachPoint in the template string for the dijit.layout._TabButton.
Patch attached.
schallm
Attachments (1)
Change History (3)
Changed 13 years ago by
Attachment: | TabContainer.patch added |
---|
comment:1 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 13 years ago by
PS: note that the above technique is not recommended... changing the label will make the tab shorter or longer which (in exceptional cases) could change the tabs from taking up one row to two rows, or vice-versa, but the TabContainer? won't know to reformat itself.
(In [9997]) Fix setLabel() on a tab button (although eventually we should have a way to change the title of the actual pane and have the info reflected to all controllers maybe? Not sure. Changing label directly is not officially supported.) Fixes #4031.