Ticket #203 (closed enhancement: fixed)

Opened 14 months ago

Last modified 13 months ago

Redirect command should support ${} syntax for args and persistArgs attributes

Reported by: peterfarrell Owned by: kurtwiersma
Priority: critical Milestone: Mach-II 1.8.0 alpha
Component: framework - core Version: 1.8.0 - Framework
Keywords: redirect command args expression evaluation Cc: mattwoodward, brianfitzgerald
Blocking: Blocked By:

Description (last modified by peterfarrell) (diff)

Redirect command should support ${} syntax with support for defaults for args, event, module, args and persistArgs attributes. This would be inline with how the new call-method command works.

Let's pretend there is an assessmentBattery CFC in an event arg named assessmentBattery and I need to the jobProfileId from that CFC on an redirect. This is not currently possible, but would be very helpful:

<redirect event="webAssess.jobProfiles.displayProfile" args="jobProfileId=${event.assessmentBattery.jobProfileId}:0" />

Attachments

Change History

Changed 14 months ago by kurtwiersma

Yes I think this is a great idea of another place to leverage the expression syntax. I would just have your example use ${event.assementBattery.jobProfileID:0} since I think we usually use the colon inside the {} to indicate defaults.

Changed 13 months ago by kurtwiersma

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

Closed as part of changeset 1341.

Changed 13 months ago by kurtwiersma

Now that I have completed this I am wondering if we should support expression syntax in the event attribute as well. That way you could have a listener fill in an event arg which could be the event name to redirect to. I realize that ticket #30 allows you do it programatically inside a listener (which is very nice) but I am always looking for ways to do less inside the listeners so I can see the whole flow of my app by looking at the xml file. Do guys have any other thoughts?

Changed 13 months ago by peterfarrell

I agree that event (actually, module and persistArgsIngore) should allow for the EL syntax.

Kurt, does this work as well?:

<redirect event="displayProfile" args="${event.assessmentBattery.id:0}" />

That the arg in the url would be id without explicitly defining the key for the value?

Also, I think we will need to expand <redirect> to work with routes now as well.

Changed 13 months ago by peterfarrell

  • status changed from closed to reopened
  • resolution fixed deleted

Kurt, see comment:7:ticket:30 for information on adding redirectRoute() method to the EventContext with a helper method redirectRoute() in the BaseComponent that calls the method in the EventContext.

Changed 13 months ago by peterfarrell

  • description modified (diff)
  • billable changed from 1 to 0

As discussed via IM, we should support nested args and persist-arg for redirect just like we do for call-method. Something like:

<redirect event="doSomething" persist="true">
  <arg name="id" value="${event.assessment.assessmentId}"/>
  <persist-arg name="someBean" value="${event.assessmentBean}"/>
</redirect>

Changed 13 months ago by kurtwiersma

[None] - Added support for expressions in the module, event, and url attributes of the RedirectCommand?. refs #203

Changed 13 months ago by kurtwiersma

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

[None] - Support for nested arg and persist-arg tags inside redirect. closes #203

Changed 13 months ago by kurtwiersma

[None] - Updated to include the new arg and persistArg tags in the config xml refs #203

Add/Change #203 (Redirect command should support ${} syntax for args and persistArgs attributes)

Author


E-mail address and user name can be saved in the Preferences.


Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.