[jifty-devel] Dispatcher

Steve H s_t_e_v_e_h at hotmail.com
Thu Oct 25 00:58:26 EDT 2007


Further to my question (not yet responded to) from my prev post, is there anyone who could provide a code snippet or other insight as to how I would (presumably in the Dispatcher), invoke a different action or fragment that would update/target a different region.  My attempts to date have the output from calls from the Dispatcher to any other fragments, update the region associated with the original Dispatcher run/code block.  A use case might be: I have a region that can input some criteria (e.g. search or index); In it's run code-block, I would like to use it's data (e.g. from action response or get()) to then invoke a fragment that will target a DIFFERENT region.  That other region should also be able to independently function, e.g. next/prev from a pager, and/or submit/s to select and further process items of interest).  
...if not able to be done within the original Dispatcher code-block, can/how might it be able to construct and inject a separate Request (back into the Dispatcher) that could also specify the other region as the one to output to?


> From: s_t_e_v_e_h at hotmail.com
> To: jifty-devel at lists.jifty.org
> Subject: FW: Some help and/or pointers to doco: updating calling other region's/fragments from an action
> Date: Tue, 9 Oct 2007 11:38:08 +1000
>> From: s_t_e_v_e_h at hotmail.com
>> To: jifty-devel at lists.jifty.org
>> Subject: Some help and/or pointers to doco: updating calling other region's/fragments from an action
>> Date: Sun, 7 Oct 2007 23:19:35 +1000
>> I was unable to see from doco or example, how I would cause another region/fragment to update from a different region's action.
>> For example, I have a page that I've composed with various Regions. One of these can have search criteria entered, another can add entries, and another includes a table of data fetched/displayed via a collection and pager. I was wanting to have the pager fragment execute to repopulate it's region following input/submit of data into either the Search region or the Add region. Both the search and add have an Action defined. I'd anticipated using criteria entered in the Search, as args for the Collection used in the pager fragment.
>> The appropriate doco or examples have so far eluded me... along with any perhaps more Jifty'esq ways to do it.
> An update: Someone responded to me via the IRC. The penny that hadn't dropped for me was related to what is calling what/when/where... in that I was looking for how to call a fragment after processing an Action, when all along it was the fragment/s that had called the Action in the first place and thus execution would naturally return there after processing the action... so I just had to include a bit of trace/debug and look a bit closer at the call stack. All that said though, I needed to use info from args that were visible in the Action. It then became apparent that the same args were visible in the calling fragment that execution returned to... thing was though, I needed that info in a fragment that was called then from that fragment. After much poking and proding, it became apparent that I needed to declare the call to the fragment in which I need the info with a "default =>" clause and line it up with the args in the called fragment.
> ...so far, surviving the learning curve.
> SteveH
> _________________________________________________________________
> New music from the Rogue Traders - listen now!
> http://ninemsn.com.au/share/redir/adTrack.asp?mode=click&clientID=832&referral=hotmailtaglineOct07&URL=http://music.ninemsn.com.au/roguetraders

What are you waiting for? Join Lavalife FREE

More information about the jifty-devel mailing list