Ok, so I've followed most of your directions, but I think I'm still missing something. Here's what I've done so far...
I've set up the cfproperty for the primary category select as instructed. For the secondary category, I've taken the "reusable sub- categorisation" approach. I've successfully created the secondaryCategory.cfc which extends farcry.core.packages.formtools.category. I've copied the edit() method and was able to verify through cfdebugging that this is being used for rendering the secondary category property. Now, here's where I'm confused. First, I've added the ftPrimaryCategory key to the param'd metadata. Next, when you say "Set ftAlias to the value of that attribute" I'm not sure exactly where you are referring to. By ftAlias, do you mean the other metadata params in the edit method (as in arguments.metadata.ftAlias)? Or, is this the ftAlias attribute in the cfproperty for the secondary category definition? I've added ftWatch to the cfproperty with the name of the primary dropdown property. Also, this may or may not have anything to do with anything, but... I've been digging through the formtools code as well as the wiki to try and figure this out on my own, but I don't seem to really be getting anywhere... It looks like the ajax dependency selects is implemented via farcry.core.packages.formtools.field.addWatch(). So, I searched all the files to see where addWatch() is being called. Other than a recursive call in the method itself, it looks like it's being called only from the object.cfm formtools tag. I set up a trace to see how this was being called from my custom type and it doesn't appear anywhere. I checked some other types and see that it is being called (except from News, which my type is based upon). Wonder if this could be one reason why I'm having problems? Also, I'm looking to just grab just one level of categories. Currently, based on the structure below, if I set ftAlias="content" the dropdown contains all categories below it. I would like to just get the items at the first level beneath "Content". Once a primary is selected, my secondary category dropdown would then be populated with the level 3 categories. root - Content -- Magazine Title 1 (primary) --- Column 1 (secondary) --- Column 2 ... -- Magazine Title 2 --- Column 3 --- Column 4 ... Anyway, I hope this is clear. Thank you so much for helping with this, I'm pretty new to FarCry but so far I'm very impressed with the potential -Nick On Feb 1, 2009, at 5:47 PM, Blair McKenzie wrote: > You can have the first item by using ftType="category", > ftAlias="parentcategoryalias" and ftRenderType="dropdown" (I think). > > For the second one, you will probably need to write a custom > formtool code. > > Two approaches. > > ONCE OFF CUSTOMISATION > 1) Add a function named like ftEditYourSecondaryProperty to the > custom type. Open up core/packages/formtools/category.cfc and copy > the arguments and code from the edit function into yours. > 2) Look for where ftAlias is param'd / used, and change the code so > that the value of the primary property is used instead > 3) In the cfproperty definition, add ftWatch="primarypropertyname". > This will add ajax to the form that updates the field when the > primary property changes. > > REUSABLE SUB-CATEGORISATION > 1) Extend formtools/category.cfc in your project to > secondarycategory.cfc (or whatever) > 2) Copy the edit function from category.cfc to your formtool > 3) Param another metadata attribute ftPrimaryCategory. Set ftAlias > to the value of that attribute. > 4) In the cfproperty definition, set ftType="secondarycategory" > 5) Add ftWatch="primarypropertyname". This will add ajax to the form > that updates the field when the primary property changes. > > On Mon, Feb 2, 2009 at 12:07 AM, nicholas sollecito <[email protected] > > wrote: > 5.1 > > > On Jan 31, 2009, at 11:23 PM, Blair McKenzie <[email protected]> wrote: > >> What version of FarCry are you using? >> >> On Sun, Feb 1, 2009 at 10:34 AM, Nick S. <[email protected]> >> wrote: >> >> I have a custom Article content type. I would like to use the built- >> in >> categorization in FarCry as a way to apply a Category and sub- >> category >> to the content. Is there a way to implement a dependent select so >> that >> the user must first a Category from a drop-down and then a separate >> list box will be populated with the sub-categories to select from? >> >> I'm currently using form tools and I'm not sure how to further >> customize the form to allow for this type of interaction. Let me know >> if this is a possibility, I can't seem to find this functionality >> either in the wiki or mailing list. >> >> Thanks in advance, >> >> >> >> >> > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "farcry-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/farcry-dev?hl=en -~----------~----~----~----~------~----~------~--~---
