Ticket #340 (closed enhancement: fixed)

Opened 17 years ago

Last modified 16 years ago

Bind URL and event.linkto(), SES

Reported by: mineer Owned by: cfgrok
Priority: low Milestone: 3.1 Maintenance Beta
Version: 3.1.185 Severity: normal
Keywords: SES bind url event.linkto() Cc:

Description

It is not possible to create a bind URL insing event.linkto() for compatiblity with SES.

Example:

<CFDIV id="juris" bind="url:#event.linkto('page.areainfo')#&areaid={areaid}" />

This works, but not if you have SES enabled.

In an attempt to make this compatible with SES I tried the following:

<CFSET event.setValue('areaid',{areaid}) /> <CFDIV id="juris" bind="url:#event.linkto('page.areainfo','areaid')"/>

However, this did not work.

There needs to be a way to create an SES compatible BIND URL.

Doug Hughes made the suggestion that we could "We could add a function like event.bindUrl() to create a bind url."

Change History

Changed 16 years ago by cfgrok

  • milestone changed from User Reported Issues (with full information) to 3.2

Changed 16 years ago by DanWilson

  • milestone changed from 3.2 to 3.1.x-next-patch

Changed 16 years ago by cfgrok

  • status changed from new to closed
  • resolution set to worksforme

I was able to get this to work using the following syntax:

<cfset event.setValue("areaid", "{areaid}") />
<cfset divLink = event.linkTo("page.areainfo", "areaid") />

<cfdiv id="juris" bind="url:#urlDecode(divLink)#" />

The key change is the use of the urlDecode() function, as the SesUrlManager will URL encode the curly braces in the "areaid" value, thus creating an invalid bind expression.

As the desired result does appear to be possible, I am going to go ahead and close this ticket.

Changed 16 years ago by DanWilson

so we *could* make a bindTo() method that just did a urlDecode? Seems easy enough...

Should we implement it anyways?

Changed 16 years ago by cfgrok

  • priority changed from normal to low
  • status changed from closed to reopened
  • version changed from 3.0.178 to 3.1.185
  • resolution worksforme deleted
  • type changed from defect to enhancement

Well, as you say, it certainly is trivial to add a urlDecode() wrapper around the linkTo() method, so if we think this has value, then sure, why not? I'll re-open the ticket and we can address it with the round of bug fixes for version 3.1.

By the way, I realized that this can also be done without adding the bind parameter as an event value:

<cfdiv id="juris" bind="url:#event.linkTo('page.areainfo')#/areaid/{areaid}" />

The only downside to this approach is that the SES URL syntax is hard-coded into the bind, so if one switches back to using the regular UrlManager it will break.

Changed 16 years ago by cfgrok

  • owner set to cfgrok
  • status changed from reopened to new

Changed 16 years ago by cfgrok

  • status changed from new to assigned

Changed 16 years ago by cfgrok

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in SVN commit 239: a new bindTo() method was added to the EventContext CFC to support automatic URL decoding of links generated by the system URL manager.

Note: See TracTickets for help on using tickets.