commands and value links
norbert at hartl.name
Fri Oct 8 11:27:16 MEST 2010
I'm trying to create a value link that can display a single command inside a document. But I struggled to create a proper link for the command. This seems only possible if you have a pier context and renderer at the same time which is not really the case as long as you are staying inside PRValueLink.
The only solution I could come up with is the following:
<value: 'command' comment: 'Display command as link'>
detect: [ :each | each label = (self parameterAt: 'label' ) ]
ifNone: [ ^ nil ])
ifNotNilDo: [ :commandClass |
^ [ :html |
goto: (aContext command: commandClass new);
with: commandClass label]].
I have the impression there might be a solution without using a block. Any ideas? Or is it ok the way it is?
More information about the smallwiki