I'm afraid that the append attribute isn't going work -- as noted, it will
add a name/value pair to the URL, and is also URL-encoding the hash. My
suggestion would be to use the event.forward() method in your controller
instead of a result, as the forward() method has an optional anchor argument
that you can use:

http://docs.model-glue.com/wiki/ReferenceMaterials/EventApi#ForwardeventName:stringappend:listpreserveState:booleananchor:stringaddToken:boolean

So something like this should do the trick:

<cfset arguments.event.forward( eventName="someevent", anchor="someanchor" )
/>

Also, if you want to maintain the auto-documenting nature of your MG XML
config, you can pass in the target of the redirect and the anchor name as
arguments like so:

<message name="redirectToAnchor">
      <argument name="redirectEvent" value="someevent" />
      <argument name="redirectAnchor" value="someanchor" />
</message>

And then in your message-listener function you can do:

<cfset var redirectEvent = arguments.event.getArgument( "redirectEvent" ) />
<cfset var redirectAnchor = arguments.event.getArgument( "redirectAnchor" )
/>

<cfset arguments.event.forward( eventName=redirectEvent,
anchor=redirectAnchor ) />

HTH,

--
Ezra


On Tue, Jan 4, 2011 at 7:28 AM, Sir Rawlins <
[email protected]> wrote:

> quite how 'happy new year' came out of my fingers as 'happy you new'
> is beyond me.... more coffee?
>
> On Jan 4, 3:26 pm, Sir Rawlins <[email protected]>
> wrote:
> > Haha ... Happy you new, you bastards! ;-)
> >
> > Thanks for the tip Dan. I've just given it a shot but it doesn't
> > appear to be playing ball, perhaps I'm missing something. I'm setting
> > the variable into the event like this:
> >
> > <cfset ARGUMENTS.event.setValue("Anchor", "##item_table") />
> >
> > However when it's appended to the URL it comes out like this:
> >
> > &Anchor=%23item_table
> >
> > Any ideas what might be causing it to format it in that manor?
> >
> > Thanks mate,
> >
> > Robert
> >
> > On Jan 4, 3:21 pm, Jim Priest <[email protected]> wrote:
> >
> >
> >
> >
> >
> >
> >
> > > FWIW - I just updated the docs with Dan's example.
> >
> > > Jim
> >
> > > On Tue, Jan 4, 2011 at 10:07 AM, Dan Wilson <[email protected]>
> wrote:
> > > > You can do this by adding a variable into the event, then using the
> append
> > > > attribute of the result. This will stick the value of the event
> variable in
> > > > the URL.
>
> --
> Model-Glue Sites:
> Home Page: http://www.model-glue.com
> Documentation: http://docs.model-glue.com
> Bug Tracker: http://bugs.model-glue.com
> Blog: http://www.model-glue.com/blog
>
> You received this message because you are subscribed to the Google
> Groups "model-glue" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<model-glue%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en
>

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to