Community
Participate
Working Groups
My case is: I have a collapse/expand command for sections. The command is a toggler that closes or opens the section. When I click the command I would like to change the name and tooltip to say respectively "Expand" or "Collapse". I would like to change it inside the command callback.
Or maybe there is another way to do it Susan?
(In reply to comment #1) > Or maybe there is another way to do it Susan? There is a hack way, which is define both commands and rerender when you change state. For example see tasks.js. I was talking about adding the same thing for Libing with two way/inline compare and he said it was simple enough to have two commands since they did different things anyway.
We should also settle on terminology. I used View/Hide in the "Create new content" list in the navigator because we don't really use a twistie/tree presentation, such as in http://store.apple.com/us/configure/MC968LL/A?select=select&product=MC968LL%2FA So something like View/Hide seemed more appropriate. (I'm sure I've used the expand/collapse terminology before, just thought about it a little more yesterday.)
see also bug 366234. In that scenario you would put the hide and show case in the same command. You would still rerender the commands whenever the state changed, and the visibleWhen would hammer the command name/tooltip before it rendered.
Thanks. I'll try that. I though there is something that will render again just this one command. I was about to use renderCommands in #callback, but I thought it is wrong ;)
(In reply to comment #5) > Thanks. I'll try that. I though there is something that will render again just > this one command. I was about to use renderCommands in #callback, but I thought > it is wrong ;) Yup, it works.