[jifty-devel] Passing variables back from ajax components

Alex Vandiver alexmv at bestpractical.com
Fri Mar 24 18:41:00 EST 2006


On Fri, 2006-03-24 at 21:50 +1100, bart bunting wrote:
> I've customised it so that there is a mason variable indicating which
> Category you are currently editing.  This is all working fine until
> you hit submit.  I've passed the CategoryId down through the
> components but for example with the new_categoryMember fragment when
> you hit submit the CategoryId is lost.  As a result a page showing
> members from all categories is shown.

How are you creating the new_categoryMember fragment?  If you pass it a
default category, it should maintain that value when it refreshes:
<% Jifty->web->region(
       name => 'new',
       path => '/admin/fragments/categoryMembers/new_categoryMember',
       defaults => { category => $category },
   ) %>

> I paste below my new_categoryMember fragment.  I am sure it has the
> correct CategoryId when it is called but am confused as to how I am
> meant to pass this back up so when the submit is hit the page is
> redrawn showing only things in that category.
What do you mean by 'pass this back up'?  The onclick method that you
define below says that when the submit button is clicked, you submit the
Create action, refresh the current fragment (which is the
new_categoryMember) and add a new fragment to the end of the <dl> in the
parent element.
  You're not actually refreshing the whole list, so I'm a little
confused by the question.
  Does that help any?
 - Alex


More information about the jifty-devel mailing list