Discussion:
Best way to use Form Tools on the frontend.
Mark Picker
2014-02-26 02:40:31 UTC
Permalink
Hi,



I’m trying to get myself familiar with form tools again at the same times
as needing to build a frontend form with related objects in FarCry 6. My
problem is that I’m not sure on the correct approach.



What I’m trying to end up with is something like this:



*typeSession*

Small list of training session parent objects (generic information, no
location or dates). E.g:



Cooking

Programming

Mining



(each of the above would have teaser text, descriptions etc.)



*typeSessionDetails*

Related type that will contain specifics about each training session. E.g:



1 April 7pm – associated with Cooking from typeSession

2 April 7pm - associated with Cooking from typeSession

2 March 3pm – associated with Mining from typeSession



Etc.



*typeRegistration*

Name

Address

Fields (note plural) selected from typeSessionDetails



Then on a frontend registration form where you provide name, address etc.
you are given a list of all the available training sessions, grouped by the
parent name (cooking, programming). The parent itself isn’t selectable but
each of the dates/times are.



So what I’ve done so far is build the 3 custom types (typeSession,
typeSessionDetails and typeRegistration) to hold the various bits of
information. One field in typeSessionDetails is joined to typeSession via:



<cfproperty name="sessionID" type="string" ftLabel="Session" ftType="uuid"
ftJoin="typeSession">



All that seems like it is ok but I’m coming unstuck on the frontend. I’m
unsure of the correct way to control the way the session details are being
formatted on the form.



I want it to appear like below:



Cooking: Who needs it when you have a good Chinese restaurant on speed dial?



1 April at 7pm (with a checkbox)

2 April at 7pm (with a checkbox)



Programming: Who needs a life after work?



10 March at 5pm (with a checkbox)



I’ve found that I can display the above session details by using
ftJoin=”typeSessionDetails”, type=”array” and ftRenderType=”checkbox” on
the field in typeRegistration that holds the array. However all I’m getting
is the record title. What I want to do is control the output so I can have
everything grouped and also filter options so that we don’t display
sessions that are older than now().



I know I can build a librarySelected.cfm file for my types but that, as the
name implies, is only applicable to the library picker (which I’m not
using).



Should I be looking at looping over the typeSession type in the frontend
and for each record, get matching records from the typeSessionDetails using
getContentObjects? Or is there a quicker easier way? Is there a way to use
<skin:view> to build form components? Any pointers would be greatly
appreciated.



Regards

Mark
--
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev-/***@public.gmane.org
To unsubscribe, email: farcry-dev+unsubscribe-/***@public.gmane.org
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
---
You received this message because you are subscribed to the Google Groups "farcry-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to farcry-dev+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Loading...