[jifty-devel] Re-use of PageRegions and Fragments

Steve H s_t_e_v_e_h at hotmail.com
Thu Nov 8 21:54:40 EST 2007

I was experiencing some unanticipated behaviour when I created multiple instances of a page region that referred to the same fragment.  
I have for example a table that lists order headers. In a row beneath the order header details, I create a page region whose associated fragment has code that, depending on it's arg values, will display a link like 'show items' or a nested table of the items and a link of 'hide items'.  (i.e there would be page region created for each order header listed).
In my proof of concept code/test, I had 2 order headers that dutifully display along with the 'show items' link in the region/fragment under them.  When clicking on the link for order header 1, the fragment then dutifully changes to show the items, along with the 'hide items' link.  Problem was though, that when I clicked the 'show items' beneath the 2nd order hearder, it again updated the fragment under the 1st order header... albeit displaying items belonging to the order header 2; the link under order header 2 remained as 'show items.  
In the main fragment that creates these n page regions beneath their respective order headers, I also tried specifying a unique name... to no avail.  In the 'show/hide item' links, I merely declare them with name=> and args=>;  are there any other params that I should specify to cause them to target/update the correct page region (i.e. the one in which the link appears)?
Does that explain the issue? or might I need to send code samples?

Overpaid or Underpaid? Check our comprehensive Salary Centre

More information about the jifty-devel mailing list