Best way to use Form Tools on the frontend.

23 views
Skip to first unread message

Mark Picker

unread,
Feb 25, 2014, 9:40:31 PM2/25/14
to farcr...@googlegroups.com

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

 

Reply all
Reply to author
Forward
0 new messages