Hi all, I updated to a recent SVN copy of Reactor, and I am trying to update my code for the open-source list to accommodate the changes that have been made. The one area I am having trouble with is in the area of the iterator and linking tables. It appears that in the old method, you could still get the records for the linking table, but now you only get the records for the objects that the linking table is linking to (and while I am explaining this rather poorly, it does actually make more sense). So, I had a "resource" object that had many categories via a linking table. My form would handle this by getting the array of resourceCategories (i.e. the linking table records) and verifying that you haven't deselected any in the multiple select box in the form that were previously selected like this:

<!--- delete any existing categories no longer on the list --->
<cfset arrCurrentCategories = resource.getOpenSourceResourceCategoriesArray() />
<cfloop from="1" to="#arrayLen(arrCurrentCategories)#" index="i">
<cfif NOT listFind(form.categoryID,arrCurrentCategories[i].getCategoryID())>
          <cfset arrCurrentCategories[i].delete() />
   </cfif>
</cfloop>

I am wondering how to handle this type of situation now. What has changed is that the iterator will give me either a query or array of the categories, and not the linking table records (unless I am completely dense and missing something). I have a couple of ideas, but they all seem to involve a decent amount of additional coding, so I was hoping someone might be able to direct me on the right path. (if you want the full code I am discussing, this was my Getting Started with Reactor post from February - http://www.remotesynthesis.com/blog/index.cfm/2006/2/17/Getting-Started-with-Reactor)

Thanks.

--
Brian Rinaldi
blog - http://www.remotesynthesis.com/blog
ColdFusion Open Source List - http://www.remotesynthesis.com/cfopensourcelist
Boston ColdFusion User Group - http://www.bostoncfug.org





-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/


Reply via email to