[Seaside] _k parameter at the end of the path?

Paul DeBruicker pdebruic at gmail.com
Wed Oct 26 18:47:54 UTC 2011


On 11-10-26 11:02 AM, Lukas Renggli wrote:
> When #updateUrl: is called on your component tree _k (and if necessary
> _s) are already present. GROrderedMultiMap appends new values by
> default, but it would be easy to add a variation that prepends new
> query fields.
>
> Lukas
>

Thanks for the tip.  This does what I want:

WARequestFields>>#at:add:

	at: aKey put: aValue
	^self prepend: aKey and: aValue


WARequestFields>>#prepend:and:
	prepend: aKey and: aValue

	|newKeys newValues|
	size = keys size ifTrue: [ self grow ].
	newKeys:=Array new: (size:=size+1).
	newValues:=Array new: size.
	newKeys at: 1 put: aKey.
	newValues at: 1 put: aValue.
	1 to: (size-1) do:[:index |
		newKeys at: index+1 put: (keys at: index).
		newValues at: index+1 put: (values at: index)].
	keys:=newKeys.
	^values:=newValues.


Paul





More information about the seaside mailing list