Forms in Farcry

3 views
Skip to first unread message

coldbama

unread,
Nov 6, 2008, 5:32:07 PM11/6/08
to farcry-dev
Hi guys,

Can anyone tell me how to create FORM in Farcry 5.

Thanks in advance.

TD

Marco van den Oever

unread,
Nov 6, 2008, 5:58:53 PM11/6/08
to farcry-dev
- for the form use <ft:form> and </ft:form>
- in between use html formatted form elements like <select><option>
etc
- use the <ft:button value="xls" size="small" /> code to set buttons
- use <ft:processform action="xls"> code </ft:processform> to
generate code (here action is xls so that is triggered when the button
with the action="xls" parameter is clicked)

Example:

The form:

<ft:form>
<tr>
<td><select name="polling">
<cfloop query="dropdown" startrow="1"
endrow="#application['wsoFarcryPolling' & pollingid]#">
<option value="#dropdown.ObjectID#"<cfif
#dropdown.ObjectID# EQ #application.wsoFarcryPolling_stats_objectid#>
selected="selected"</cfif>>#dropdown.question#</option>
</cfloop>
</select></td>
<td align="left">
<ft:button value="Select" size="small" />
<ft:button value="Edit" size="small" />
<ft:button value="xls" size="small" />
</td>
</tr>
</ft:form>

<ft:processform action="xls">

code to generate (in this case) an xls file

</ft:processform>

coldbama

unread,
Nov 7, 2008, 2:26:34 PM11/7/08
to farcry-dev
Thanks Marco.

Where exactly should I put the form codes? In the page itself or
project webskin or ?? I tried different ways with no success.

Thanks in advance.

--TD

On Nov 6, 2:58 pm, Marco van den Oever <marcovandenoe...@gmail.com>
wrote:

AJ Mercer

unread,
Nov 7, 2008, 6:05:15 PM11/7/08
to farcr...@googlegroups.com
The docs site has lots of formtool
    http://docs.farcrycms.org

search for forms for formtool
--
AJ Mercer
Web Log: http://webonix.net


Once you come to the realisation that everyone is crazy,
You will never be surprised or disappointed ever again.
AJM 2008

Marco van den Oever

unread,
Nov 7, 2008, 7:30:19 PM11/7/08
to farcry-dev
Indeed there you can find many stuff on how to do that, and i don't
know how much you already know of Farcry, but if you haven't yet
checked the Farcry 4 course, also good to know:

http://blog.daemon.com.au/go/blog-post/farcry-4-0-training-course-released

On Nov 8, 12:05 am, "AJ Mercer" <ajmer...@gmail.com> wrote:
> The docs site has lots of formtool
>    http://docs.farcrycms.org
>
> search for forms for formtool
>

modius

unread,
Nov 8, 2008, 2:09:53 AM11/8/08
to farcry-dev
On Nov 7, 9:32 am, coldbama <tsering.d...@gmail.com> wrote:
> Can anyone tell me how to create FORM in Farcry 5.

I would strongly recommend downloading the FarCry 5.0 Jump Start
course:
http://docs.farcrycms.org/display/FCDEV50/FarCry+5.0+Jump+Start+Course

Unit 10 talks about forms. But you really need to understand how
webskins (ie. views) work in the FarCry framework so make sure you
have read through earlier units.

Plus if you can outline what sort of "form" you are trying to build,
we can more easily recommend how you might approach implementing it.

Best regards,

geoff
http://www.daemon.com.au/

modius

unread,
Nov 8, 2008, 2:34:02 AM11/8/08
to farcry-dev
On Nov 8, 6:26 am, coldbama <tsering.d...@gmail.com> wrote:
> Where exactly should I put the form codes? In the page itself or
> project webskin or ?? I tried different ways with no success.

Nearly everything should be in a webskin, these are the VIEW in the
MVC of FarCry development.

FarCry is centred around objects and views are *always* rendered in
the context of an object. This is different from other frameworks
where the VIEW and MODEL are kind-of wired together by the controller.

Framework mumbo-jumbo aside, it means you always start by thinking
about what type of object you are going to be working with to render
your view.

EG, if you have a blog post content type (say farBlogPost) and want to
provide an edit handler to update a post, you would look to have a
webskin that is in the farBlogPost folder (./webskin/farblogpost). By
the way FarCry automatically builds this form but if you wanted to
override it you would start by creating a template called edit.cfm (./
webskin/farblogpost/edit.cfm)

EG, if you just want to display the blogpost you would create a
webskin like ./webskin/farblogpost/displaypagestandard.cfm And inside
there you would add all the HTML needed to render your page.

EG, if you wanted a comment form embedded in your blog post to collect
comments from visitors you might start by creating a comment content
type (farBlogComment) -- because you need somewhere to persist or
store comments. Rather than trying to build a view of the blog post
you would instead build a view for the comment type (farBlogComment),
and then embed that view in the blog post detail view. ie. you would
call the comment edit form from within the blog
displaypagestandard.cfm view.

In all examples, the view is always being called in the context of a
specific content type.

You can look through this specific example by downloading the NearCry
blogging app at:
http://www.farcrycore.org/builds

Hope that helps,

geoff
http://www.daemon.com.au/
Reply all
Reply to author
Forward
0 new messages