extending ftWatch to numeric and string

View: New views
10 Messages — Rating Filter:   Alert me  

extending ftWatch to numeric and string

by Tomek Kott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All,

I wanted to play around with ftWatch and see what I could do with the displays and such, and extending the two formtools (numeric, string) was quite instructive. I thought it would be useful to post it here (and eventually on wiki), since its an easy example of checking whether a boolean field is being watched, and if so, displaying the input or not depending on the boolean value:

        <cfif structkeyexists(arguments.stMetadata,"ftWatch") and len(arguments.stMetadata.ftWatch)
            AND structkeyexists(arguments.stObject,"#listfirst(arguments.stMetadata.ftWatch)#")
            AND isValid("boolean",arguments.stObject[listfirst(arguments.stMetadata.ftWatch)])
            AND NOT arguments.stObject[listfirst(arguments.stMetadata.ftWatch)] >
            <cfset html=""/>
        <cfelse>
            <cfset html = super.edit(argumentCollection="#arguments#") />
        </cfif>

And similar for display function.

Now if only I could get rid of the label for that as well...any ideas on that?

Tomek



--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: extending ftWatch to numeric and string

by Tomek Kott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example

quick editing job, feel free to correct / expand / etc.

Tomek

On Thu, Jun 4, 2009 at 7:31 PM, Tomek Kott <tkott.spam@...> wrote:
Hi All,

I wanted to play around with ftWatch and see what I could do with the displays and such, and extending the two formtools (numeric, string) was quite instructive. I thought it would be useful to post it here (and eventually on wiki), since its an easy example of checking whether a boolean field is being watched, and if so, displaying the input or not depending on the boolean value:

        <cfif structkeyexists(arguments.stMetadata,"ftWatch") and len(arguments.stMetadata.ftWatch)
            AND structkeyexists(arguments.stObject,"#listfirst(arguments.stMetadata.ftWatch)#")
            AND isValid("boolean",arguments.stObject[listfirst(arguments.stMetadata.ftWatch)])
            AND NOT arguments.stObject[listfirst(arguments.stMetadata.ftWatch)] >
            <cfset html=""/>
        <cfelse>
            <cfset html = super.edit(argumentCollection="#arguments#") />
        </cfif>

And similar for display function.

Now if only I could get rid of the label for that as well...any ideas on that?

Tomek




--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: extending ftWatch to numeric and string

by Tomek Kott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

already found a problem when no ftDefault value is defined for the boolean. Updated code (including javascript to get rid of the label showing up as well) is here:

http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example

Tomek

On Thu, Jun 4, 2009 at 10:49 PM, Tomek Kott <tkott.spam@...> wrote:
http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example

quick editing job, feel free to correct / expand / etc.

Tomek


On Thu, Jun 4, 2009 at 7:31 PM, Tomek Kott <tkott.spam@...> wrote:
Hi All,

I wanted to play around with ftWatch and see what I could do with the displays and such, and extending the two formtools (numeric, string) was quite instructive. I thought it would be useful to post it here (and eventually on wiki), since its an easy example of checking whether a boolean field is being watched, and if so, displaying the input or not depending on the boolean value:

        <cfif structkeyexists(arguments.stMetadata,"ftWatch") and len(arguments.stMetadata.ftWatch)
            AND structkeyexists(arguments.stObject,"#listfirst(arguments.stMetadata.ftWatch)#")
            AND isValid("boolean",arguments.stObject[listfirst(arguments.stMetadata.ftWatch)])
            AND NOT arguments.stObject[listfirst(arguments.stMetadata.ftWatch)] >
            <cfset html=""/>
        <cfelse>
            <cfset html = super.edit(argumentCollection="#arguments#") />
        </cfif>

And similar for display function.

Now if only I could get rid of the label for that as well...any ideas on that?

Tomek





--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: extending ftWatch to numeric and string

by Marco van den Oever :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Awesome Tomek, gonna play with it asap :)

On Jun 5, 4:57 pm, Tomek Kott <tkott.s...@...> wrote:

> already found a problem when no ftDefault value is defined for the boolean.
> Updated code (including javascript to get rid of the label showing up as
> well) is here:
>
> http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> Tomek
>
> On Thu, Jun 4, 2009 at 10:49 PM, Tomek Kott <tkott.s...@...> wrote:
> >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > quick editing job, feel free to correct / expand / etc.
>
> > Tomek
>
> > On Thu, Jun 4, 2009 at 7:31 PM, Tomek Kott <tkott.s...@...> wrote:
>
> >> Hi All,
>
> >> I wanted to play around with ftWatch and see what I could do with the
> >> displays and such, and extending the two formtools (numeric, string) was
> >> quite instructive. I thought it would be useful to post it here (and
> >> eventually on wiki), since its an easy example of checking whether a boolean
> >> field is being watched, and if so, displaying the input or not depending on
> >> the boolean value:
>
> >>         <cfif structkeyexists(arguments.stMetadata,"ftWatch") and
> >> len(arguments.stMetadata.ftWatch)
> >>             AND
> >> structkeyexists(arguments.stObject,"#listfirst(arguments.stMetadata.ftWatch)#")
>
> >>             AND
> >> isValid("boolean",arguments.stObject[listfirst(arguments.stMetadata.ftWatch)])
>
> >>             AND NOT
> >> arguments.stObject[listfirst(arguments.stMetadata.ftWatch)] >
> >>             <cfset html=""/>
> >>         <cfelse>
> >>             <cfset html = super.edit(argumentCollection="#arguments#") />
> >>         </cfif>
>
> >> And similar for display function.
>
> >> Now if only I could get rid of the label for that as well...any ideas on
> >> that?
>
> >> Tomek
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: extending ftWatch to numeric and string

by Marco van den Oever :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Tomek, i replied on:

http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example

Just to be sure you know, i don't see notifications on comments...


On Jun 5, 5:09 pm, Marco van den Oever <marcovandenoe...@...>
wrote:

> Awesome Tomek, gonna play with it asap :)
>
> On Jun 5, 4:57 pm, Tomek Kott <tkott.s...@...> wrote:
>
> > already found a problem when no ftDefault value is defined for the boolean.
> > Updated code (including javascript to get rid of the label showing up as
> > well) is here:
>
> >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > Tomek
>
> > On Thu, Jun 4, 2009 at 10:49 PM, Tomek Kott <tkott.s...@...> wrote:
> > >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > > quick editing job, feel free to correct / expand / etc.
>
> > > Tomek
>
> > > On Thu, Jun 4, 2009 at 7:31 PM, Tomek Kott <tkott.s...@...> wrote:
>
> > >> Hi All,
>
> > >> I wanted to play around with ftWatch and see what I could do with the
> > >> displays and such, and extending the two formtools (numeric, string) was
> > >> quite instructive. I thought it would be useful to post it here (and
> > >> eventually on wiki), since its an easy example of checking whether a boolean
> > >> field is being watched, and if so, displaying the input or not depending on
> > >> the boolean value:
>
> > >>         <cfif structkeyexists(arguments.stMetadata,"ftWatch") and
> > >> len(arguments.stMetadata.ftWatch)
> > >>             AND
> > >> structkeyexists(arguments.stObject,"#listfirst(arguments.stMetadata.ftWatch)#")
>
> > >>             AND
> > >> isValid("boolean",arguments.stObject[listfirst(arguments.stMetadata.ftWatch)])
>
> > >>             AND NOT
> > >> arguments.stObject[listfirst(arguments.stMetadata.ftWatch)] >
> > >>             <cfset html=""/>
> > >>         <cfelse>
> > >>             <cfset html = super.edit(argumentCollection="#arguments#") />
> > >>         </cfif>
>
> > >> And similar for display function.
>
> > >> Now if only I could get rid of the label for that as well...any ideas on
> > >> that?
>
> > >> Tomek
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: extending ftWatch to numeric and string

by Tomek Kott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Marco,

Viewing over your code, and if you updated everything (I think FC5.1 now caches the functions, so you need to update after changing them), then it should work. If it doesn't work, then my guess is that the problem lies in ftSeq.

To debug, maybe try switching the order of the ftSeq just for a test?

Tomek

On Sun, Jun 21, 2009 at 12:23 PM, Marco van den Oever <marcovandenoever@...> wrote:

Hi Tomek, i replied on:

http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example

Just to be sure you know, i don't see notifications on comments...


On Jun 5, 5:09 pm, Marco van den Oever <marcovandenoe...@...>
wrote:
> Awesome Tomek, gonna play with it asap :)
>
> On Jun 5, 4:57 pm, Tomek Kott <tkott.s...@...> wrote:
>
> > already found a problem when no ftDefault value is defined for the boolean.
> > Updated code (including javascript to get rid of the label showing up as
> > well) is here:
>
> >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > Tomek
>
> > On Thu, Jun 4, 2009 at 10:49 PM, Tomek Kott <tkott.s...@...> wrote:
> > >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > > quick editing job, feel free to correct / expand / etc.
>
> > > Tomek
>
> > > On Thu, Jun 4, 2009 at 7:31 PM, Tomek Kott <tkott.s...@...> wrote:
>
> > >> Hi All,
>
> > >> I wanted to play around with ftWatch and see what I could do with the
> > >> displays and such, and extending the two formtools (numeric, string) was
> > >> quite instructive. I thought it would be useful to post it here (and
> > >> eventually on wiki), since its an easy example of checking whether a boolean
> > >> field is being watched, and if so, displaying the input or not depending on
> > >> the boolean value:
>
> > >>         <cfif structkeyexists(arguments.stMetadata,"ftWatch") and
> > >> len(arguments.stMetadata.ftWatch)
> > >>             AND
> > >> structkeyexists(arguments.stObject,"#listfirst(arguments.stMetadata.ftWatch)#")
>
> > >>             AND
> > >> isValid("boolean",arguments.stObject[listfirst(arguments.stMetadata.ftWatch)])
>
> > >>             AND NOT
> > >> arguments.stObject[listfirst(arguments.stMetadata.ftWatch)] >
> > >>             <cfset html=""/>
> > >>         <cfelse>
> > >>             <cfset html = super.edit(argumentCollection="#arguments#") />
> > >>         </cfif>
>
> > >> And similar for display function.
>
> > >> Now if only I could get rid of the label for that as well...any ideas on
> > >> that?
>
> > >> Tomek
>
>



--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: extending ftWatch to numeric and string

by Marco van den Oever :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Tomek it works now, awesome :)

On Jun 22, 3:37 pm, Tomek Kott <tkott.s...@...> wrote:

> Marco,
>
> Viewing over your code, and if you updated everything (I think FC5.1 now
> caches the functions, so you need to update after changing them), then it
> should work. If it doesn't work, then my guess is that the problem lies in
> ftSeq.
>
> To debug, maybe try switching the order of the ftSeq just for a test?
>
> Tomek
>
> On Sun, Jun 21, 2009 at 12:23 PM, Marco van den Oever <
>
> marcovandenoe...@...> wrote:
>
> > Hi Tomek, i replied on:
>
> >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > Just to be sure you know, i don't see notifications on comments...
>
> > On Jun 5, 5:09 pm, Marco van den Oever <marcovandenoe...@...>
> > wrote:
> > > Awesome Tomek, gonna play with it asap :)
>
> > > On Jun 5, 4:57 pm, Tomek Kott <tkott.s...@...> wrote:
>
> > > > already found a problem when no ftDefault value is defined for the
> > boolean.
> > > > Updated code (including javascript to get rid of the label showing up
> > as
> > > > well) is here:
>
> > > >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > > > Tomek
>
> > > > On Thu, Jun 4, 2009 at 10:49 PM, Tomek Kott <tkott.s...@...>
> > wrote:
> > > > >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > > > > quick editing job, feel free to correct / expand / etc.
>
> > > > > Tomek
>
> > > > > On Thu, Jun 4, 2009 at 7:31 PM, Tomek Kott <tkott.s...@...>
> > wrote:
>
> > > > >> Hi All,
>
> > > > >> I wanted to play around with ftWatch and see what I could do with
> > the
> > > > >> displays and such, and extending the two formtools (numeric, string)
> > was
> > > > >> quite instructive. I thought it would be useful to post it here (and
> > > > >> eventually on wiki), since its an easy example of checking whether a
> > boolean
> > > > >> field is being watched, and if so, displaying the input or not
> > depending on
> > > > >> the boolean value:
>
> > > > >>         <cfif structkeyexists(arguments.stMetadata,"ftWatch") and
> > > > >> len(arguments.stMetadata.ftWatch)
> > > > >>             AND
>
> > structkeyexists(arguments.stObject,"#listfirst(arguments.stMetadata.ftWatch)#")
>
> > > > >>             AND
>
> > isValid("boolean",arguments.stObject[listfirst(arguments.stMetadata.ftWatch)])
>
> > > > >>             AND NOT
> > > > >> arguments.stObject[listfirst(arguments.stMetadata.ftWatch)] >
> > > > >>             <cfset html=""/>
> > > > >>         <cfelse>
> > > > >>             <cfset html =
> > super.edit(argumentCollection="#arguments#") />
> > > > >>         </cfif>
>
> > > > >> And similar for display function.
>
> > > > >> Now if only I could get rid of the label for that as well...any
> > ideas on
> > > > >> that?
>
> > > > >> Tomek
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: extending ftWatch to numeric and string

by Marco van den Oever :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


What i do notice is when you start without the optional field, then
activate it by checking selectbox, the validation "this is a required
field" is not showing while click submit and fill in no value, when i
start with checkbox selected, so also the field, then it works.

Is there something i need to change or is this an improvement feature
i should add?

On Jun 22, 8:03 pm, Marco van den Oever <marcovandenoe...@...>
wrote:

> Hi Tomek it works now, awesome :)
>
> On Jun 22, 3:37 pm, Tomek Kott <tkott.s...@...> wrote:
>
> > Marco,
>
> > Viewing over your code, and if you updated everything (I think FC5.1 now
> > caches the functions, so you need to update after changing them), then it
> > should work. If it doesn't work, then my guess is that the problem lies in
> > ftSeq.
>
> > To debug, maybe try switching the order of the ftSeq just for a test?
>
> > Tomek
>
> > On Sun, Jun 21, 2009 at 12:23 PM, Marco van den Oever <
>
> > marcovandenoe...@...> wrote:
>
> > > Hi Tomek, i replied on:
>
> > >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > > Just to be sure you know, i don't see notifications on comments...
>
> > > On Jun 5, 5:09 pm, Marco van den Oever <marcovandenoe...@...>
> > > wrote:
> > > > Awesome Tomek, gonna play with it asap :)
>
> > > > On Jun 5, 4:57 pm, Tomek Kott <tkott.s...@...> wrote:
>
> > > > > already found a problem when no ftDefault value is defined for the
> > > boolean.
> > > > > Updated code (including javascript to get rid of the label showing up
> > > as
> > > > > well) is here:
>
> > > > >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > > > > Tomek
>
> > > > > On Thu, Jun 4, 2009 at 10:49 PM, Tomek Kott <tkott.s...@...>
> > > wrote:
> > > > > >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > > > > > quick editing job, feel free to correct / expand / etc.
>
> > > > > > Tomek
>
> > > > > > On Thu, Jun 4, 2009 at 7:31 PM, Tomek Kott <tkott.s...@...>
> > > wrote:
>
> > > > > >> Hi All,
>
> > > > > >> I wanted to play around with ftWatch and see what I could do with
> > > the
> > > > > >> displays and such, and extending the two formtools (numeric, string)
> > > was
> > > > > >> quite instructive. I thought it would be useful to post it here (and
> > > > > >> eventually on wiki), since its an easy example of checking whether a
> > > boolean
> > > > > >> field is being watched, and if so, displaying the input or not
> > > depending on
> > > > > >> the boolean value:
>
> > > > > >>         <cfif structkeyexists(arguments.stMetadata,"ftWatch") and
> > > > > >> len(arguments.stMetadata.ftWatch)
> > > > > >>             AND
>
> > > structkeyexists(arguments.stObject,"#listfirst(arguments.stMetadata.ftWatch)#")
>
> > > > > >>             AND
>
> > > isValid("boolean",arguments.stObject[listfirst(arguments.stMetadata.ftWatch)])
>
> > > > > >>             AND NOT
> > > > > >> arguments.stObject[listfirst(arguments.stMetadata.ftWatch)] >
> > > > > >>             <cfset html=""/>
> > > > > >>         <cfelse>
> > > > > >>             <cfset html =
> > > super.edit(argumentCollection="#arguments#") />
> > > > > >>         </cfif>
>
> > > > > >> And similar for display function.
>
> > > > > >> Now if only I could get rid of the label for that as well...any
> > > ideas on
> > > > > >> that?
>
> > > > > >> Tomek
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: extending ftWatch to numeric and string

by Tomek Kott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

for my situation this was not a problem and so I never worried about it. If you figure out a way around it, by all means add another section to the wiki.

On Mon, Jun 22, 2009 at 2:08 PM, Marco van den Oever <marcovandenoever@...> wrote:

What i do notice is when you start without the optional field, then
activate it by checking selectbox, the validation "this is a required
field" is not showing while click submit and fill in no value, when i
start with checkbox selected, so also the field, then it works.

Is there something i need to change or is this an improvement feature
i should add?

On Jun 22, 8:03 pm, Marco van den Oever <marcovandenoe...@...>
wrote:
> Hi Tomek it works now, awesome :)
>
> On Jun 22, 3:37 pm, Tomek Kott <tkott.s...@...> wrote:
>
> > Marco,
>
> > Viewing over your code, and if you updated everything (I think FC5.1 now
> > caches the functions, so you need to update after changing them), then it
> > should work. If it doesn't work, then my guess is that the problem lies in
> > ftSeq.
>
> > To debug, maybe try switching the order of the ftSeq just for a test?
>
> > Tomek
>
> > On Sun, Jun 21, 2009 at 12:23 PM, Marco van den Oever <
>
> > marcovandenoe...@...> wrote:
>
> > > Hi Tomek, i replied on:
>
> > >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > > Just to be sure you know, i don't see notifications on comments...
>
> > > On Jun 5, 5:09 pm, Marco van den Oever <marcovandenoe...@...>
> > > wrote:
> > > > Awesome Tomek, gonna play with it asap :)
>
> > > > On Jun 5, 4:57 pm, Tomek Kott <tkott.s...@...> wrote:
>
> > > > > already found a problem when no ftDefault value is defined for the
> > > boolean.
> > > > > Updated code (including javascript to get rid of the label showing up
> > > as
> > > > > well) is here:
>
> > > > >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > > > > Tomek
>
> > > > > On Thu, Jun 4, 2009 at 10:49 PM, Tomek Kott <tkott.s...@...>
> > > wrote:
> > > > > >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > > > > > quick editing job, feel free to correct / expand / etc.
>
> > > > > > Tomek
>
> > > > > > On Thu, Jun 4, 2009 at 7:31 PM, Tomek Kott <tkott.s...@...>
> > > wrote:
>
> > > > > >> Hi All,
>
> > > > > >> I wanted to play around with ftWatch and see what I could do with
> > > the
> > > > > >> displays and such, and extending the two formtools (numeric, string)
> > > was
> > > > > >> quite instructive. I thought it would be useful to post it here (and
> > > > > >> eventually on wiki), since its an easy example of checking whether a
> > > boolean
> > > > > >> field is being watched, and if so, displaying the input or not
> > > depending on
> > > > > >> the boolean value:
>
> > > > > >>         <cfif structkeyexists(arguments.stMetadata,"ftWatch") and
> > > > > >> len(arguments.stMetadata.ftWatch)
> > > > > >>             AND
>
> > > structkeyexists(arguments.stObject,"#listfirst(arguments.stMetadata.ftWatch)#")
>
> > > > > >>             AND
>
> > > isValid("boolean",arguments.stObject[listfirst(arguments.stMetadata.ftWatch)])
>
> > > > > >>             AND NOT
> > > > > >> arguments.stObject[listfirst(arguments.stMetadata.ftWatch)] >
> > > > > >>             <cfset html=""/>
> > > > > >>         <cfelse>
> > > > > >>             <cfset html =
> > > super.edit(argumentCollection="#arguments#") />
> > > > > >>         </cfif>
>
> > > > > >> And similar for display function.
>
> > > > > >> Now if only I could get rid of the label for that as well...any
> > > ideas on
> > > > > >> that?
>
> > > > > >> Tomek
>
>



--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: extending ftWatch to numeric and string

by Marco van den Oever :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Although i think you have more experience and insight in these kind of
stuff, of course when i find a way of solving i will ad it to the
wiki.

Thanks :)

On Jun 22, 9:45 pm, Tomek Kott <tkott.s...@...> wrote:

> for my situation this was not a problem and so I never worried about it. If
> you figure out a way around it, by all means add another section to the
> wiki.
>
> On Mon, Jun 22, 2009 at 2:08 PM, Marco van den Oever <
>
> marcovandenoe...@...> wrote:
>
> > What i do notice is when you start without the optional field, then
> > activate it by checking selectbox, the validation "this is a required
> > field" is not showing while click submit and fill in no value, when i
> > start with checkbox selected, so also the field, then it works.
>
> > Is there something i need to change or is this an improvement feature
> > i should add?
>
> > On Jun 22, 8:03 pm, Marco van den Oever <marcovandenoe...@...>
> > wrote:
> > > Hi Tomek it works now, awesome :)
>
> > > On Jun 22, 3:37 pm, Tomek Kott <tkott.s...@...> wrote:
>
> > > > Marco,
>
> > > > Viewing over your code, and if you updated everything (I think FC5.1
> > now
> > > > caches the functions, so you need to update after changing them), then
> > it
> > > > should work. If it doesn't work, then my guess is that the problem lies
> > in
> > > > ftSeq.
>
> > > > To debug, maybe try switching the order of the ftSeq just for a test?
>
> > > > Tomek
>
> > > > On Sun, Jun 21, 2009 at 12:23 PM, Marco van den Oever <
>
> > > > marcovandenoe...@...> wrote:
>
> > > > > Hi Tomek, i replied on:
>
> > > > >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > > > > Just to be sure you know, i don't see notifications on comments...
>
> > > > > On Jun 5, 5:09 pm, Marco van den Oever <marcovandenoe...@...>
> > > > > wrote:
> > > > > > Awesome Tomek, gonna play with it asap :)
>
> > > > > > On Jun 5, 4:57 pm, Tomek Kott <tkott.s...@...> wrote:
>
> > > > > > > already found a problem when no ftDefault value is defined for
> > the
> > > > > boolean.
> > > > > > > Updated code (including javascript to get rid of the label
> > showing up
> > > > > as
> > > > > > > well) is here:
>
> > > > > > >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > > > > > > Tomek
>
> > > > > > > On Thu, Jun 4, 2009 at 10:49 PM, Tomek Kott <
> > tkott.s...@...>
> > > > > wrote:
> > > > > > > >http://docs.farcrycms.org/display/FCDEV50/ftWatch+Example
>
> > > > > > > > quick editing job, feel free to correct / expand / etc.
>
> > > > > > > > Tomek
>
> > > > > > > > On Thu, Jun 4, 2009 at 7:31 PM, Tomek Kott <
> > tkott.s...@...>
> > > > > wrote:
>
> > > > > > > >> Hi All,
>
> > > > > > > >> I wanted to play around with ftWatch and see what I could do
> > with
> > > > > the
> > > > > > > >> displays and such, and extending the two formtools (numeric,
> > string)
> > > > > was
> > > > > > > >> quite instructive. I thought it would be useful to post it
> > here (and
> > > > > > > >> eventually on wiki), since its an easy example of checking
> > whether a
> > > > > boolean
> > > > > > > >> field is being watched, and if so, displaying the input or not
> > > > > depending on
> > > > > > > >> the boolean value:
>
> > > > > > > >>         <cfif structkeyexists(arguments.stMetadata,"ftWatch")
> > and
> > > > > > > >> len(arguments.stMetadata.ftWatch)
> > > > > > > >>             AND
>
> > structkeyexists(arguments.stObject,"#listfirst(arguments.stMetadata.ftWatch)#")
>
> > > > > > > >>             AND
>
> > isValid("boolean",arguments.stObject[listfirst(arguments.stMetadata.ftWatch)])
>
> > > > > > > >>             AND NOT
> > > > > > > >> arguments.stObject[listfirst(arguments.stMetadata.ftWatch)] >
> > > > > > > >>             <cfset html=""/>
> > > > > > > >>         <cfelse>
> > > > > > > >>             <cfset html =
> > > > > super.edit(argumentCollection="#arguments#") />
> > > > > > > >>         </cfif>
>
> > > > > > > >> And similar for display function.
>
> > > > > > > >> Now if only I could get rid of the label for that as
> > well...any
> > > > > ideas on
> > > > > > > >> that?
>
> > > > > > > >> Tomek
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---