commands and value links
renggli at gmail.com
Fri Oct 8 11:38:36 MEST 2010
And in fact you don't need to use a value link for triggering a
command, a normal link with the command parameter is enough:
Note that in both cases this goes through the security system.
On 8 October 2010 11:36, Lukas Renggli <renggli at gmail.com> wrote:
> Actually this is already implemented, for example:
> Also works with all other value-links that list or return structures,
> e.g. children, references, parent, previous, random, siblings, find,
> On 8 October 2010 11:27, Norbert Hartl <norbert at hartl.name> wrote:
>> 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:
>> PRValueLink>>commandIn: aContext
>> <value: 'command' comment: 'Display command as link'>
>> (PRCommand withAllConcreteClasses
>> detect: [ :each | each label = (self parameterAt: 'label' ) ]
>> ifNone: [ ^ nil ])
>> ifNotNilDo: [ :commandClass |
>> ^ [ :html |
>> html anchor
>> goto: (aContext command: commandClass new);
>> with: commandClass label]].
>> ^ nil
>> I have the impression there might be a solution without using a block. Any ideas? Or is it ok the way it is?
>> Magritte, Pier and Related Tools ...
> Lukas Renggli
More information about the smallwiki