Re: Multiple submit buttons and Fusebox

2005-01-13 Thread S . Isaac Dealey
That's not necessarily true (that it must be known at parse time) --
though the engine for Fusebox 4 doesn't support it... it's conceivable
that the parsing engine could check for the presence of the #
character and when present replace the usual method of inclusion with
a cfmodule call to the main template or a cfinclude tag which
includes the parsed template for the specified fuseaction (which would
of coure would require testing for and if not present parsing the
file). I'm guessing this would also be another option for handling the
scenario described -- creating an include template which calls Fusebox
via cfmodule using a passed variable for the fuseaction. It would be
more overhead on the server tho.

 Yes a variable can be used in the include tag because that
 is simply
 translated into a cfinclude. The difference is that a do
 tag is
 replaced by all the code that makes up that do...so
 there's no way to
 let that be a variable, it has to be known at parse time.


 On Wed, 12 Jan 2005 19:05:00 -0500, S. Isaac Dealey
 [EMAIL PROTECTED] wrote:
  Isaac, that won't work because do tags are dealt with
  at
  parse time, not at runtime.

 Good to know... I wasn't sure.

 Though if not do (which would be best if available)
 then the
 variable could be used in an include tag right?

 s. isaac dealey 954.927.5117
 new epoch : isn't it time for a change?

 add features without fixtures with
 the onTap open source framework

 http://macromedia.breezecentral.com/p49777853/
 http://www.sys-con.com/story/?storyid=44477DE=1
 http://www.sys-con.com/story/?storyid=45569DE=1
 http://www.fusiontap.com



 

~|
Now there’s a better way to fax. eFax makes it possible to use your existing 
email account to send and receive faxes. Try eFax free.
http://www.houseoffusion.com/banners/view.cfm?bannerid=63

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190232
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Multiple submit buttons and Fusebox

2005-01-12 Thread Matthew Small
I would change the action of the form based on which button was pushed.  For
example:

input type=button
onclick=document.formName.action='index.cfm?fuseaction=fusecircuit1'
value=Do this 1

input type=button
onclick=document.formName.action='index.cfm?fuseaction=fusecircuit2'
value=Do this 2

...

- Matt Small



-Original Message-
From: Ken Dunnington [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 12, 2005 12:54 PM
To: CF-Talk
Subject: Multiple submit buttons and Fusebox

Hi, I have a quick fusebox question that I haven't been able to find
an answer to yet. I have a few ideas, but I thought I'd run it by some
people with experience. It's fusebox-specific, so I apologize if it's
too off-topic.

How, in fusebox, do you handle multiple submit buttons in a form? For
example, a form that has  select, delete, and add buttons? I was
thinking it should be submitted to an action that will redirect to
other fuseactions depending on the button pressed (an arbiter) but
should that be done in the circuit.xml file, or in an included page?
If it were done in an included page, there would be the problem of
passing the attributes along to any redirected page. If it were done
in XML, I suppose you would use if clauses to do it, but that just
doesn't 'feel' right to me :)

In Mach-II, I think what I would do is have a listener that would
check the event object for the existence of each 'action', and use
announceEvent() to continue processing. And in good old CFML,
obviously I'd just have an action page with if
(structKeyExists(form,actionToWatchFor)) blocks.

Any thoughts?



~|
Purchase Dreamweaver with Homesite Plus from House of Fusion, a Macromedia 
Authorized Affiliate and support the CF community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=54

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190115
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Multiple submit buttons and Fusebox

2005-01-12 Thread Katz, Dov B (IT)
You can make the button be the fuseaction field (only clicked one is
sent), but sometimes you want a prefix.suffix style fuseaction... In
that case you can do something like this:

script language=JavaScript
function appendFA(fa){
document.forms.RealForm.fuseaction.value+=.+fa;
document.forms.RealForm.submit();
return false;
}
/script
form name=RealForm action=index.cfm
.
input type=hidden name=fuseaction value=someFuseactionPrefix
.

input type=submit value=Delete onClick=return
appendFA('Delete');
input type=submit value=Save onClick=return
appendFA('Save');
input type=submit value=Cancel onClick=return
appendFA('Cancel');

/form

Just ideas...

d
-Original Message-
From: Ken Dunnington [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 12, 2005 12:54 PM
To: CF-Talk
Subject: Multiple submit buttons and Fusebox

Hi, I have a quick fusebox question that I haven't been able to find an
answer to yet. I have a few ideas, but I thought I'd run it by some
people with experience. It's fusebox-specific, so I apologize if it's
too off-topic.

How, in fusebox, do you handle multiple submit buttons in a form? For
example, a form that has  select, delete, and add buttons? I was
thinking it should be submitted to an action that will redirect to other
fuseactions depending on the button pressed (an arbiter) but should that
be done in the circuit.xml file, or in an included page?
If it were done in an included page, there would be the problem of
passing the attributes along to any redirected page. If it were done in
XML, I suppose you would use if clauses to do it, but that just doesn't
'feel' right to me :)

In Mach-II, I think what I would do is have a listener that would check
the event object for the existence of each 'action', and use
announceEvent() to continue processing. And in good old CFML, obviously
I'd just have an action page with if
(structKeyExists(form,actionToWatchFor)) blocks.

Any thoughts?



~|
Purchase Contribute 3 from House of Fusion, a Macromedia Authorized Affiliate 
and support the CF community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=53

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190116
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Multiple submit buttons and Fusebox

2005-01-12 Thread Keith Gaughan
Katz, Dov B (IT) wrote:

 You can make the button be the fuseaction field (only clicked one is
 sent), but sometimes you want a prefix.suffix style fuseaction... In
 that case you can do something like this:
 
 script language=JavaScript
   function appendFA(fa){
   document.forms.RealForm.fuseaction.value+=.+fa;
   document.forms.RealForm.submit();
   return false;
   }
 /script
 form name=RealForm action=index.cfm
 .
 input type=hidden name=fuseaction value=someFuseactionPrefix
 .
 
 input type=submit value=Delete onClick=return
 appendFA('Delete');
   input type=submit value=Save onClick=return
 appendFA('Save');
   input type=submit value=Cancel onClick=return
 appendFA('Cancel');
 
 /form

Huh? That's overkill, isn't it? Why not just have two fields:

form action=index.cfm method=post
input type=hidden name=fuseaction value=someFuseactionPrefix
...
input type=submit name=faSuffix value=Delete
input type=submit name=faSuffix value=Save
input type=submit name=faSuffix value=Cancel
/form

And in your index.cfm file:

cfif IsDefined(FORM.faSuffix)
 cfset FORM.fuseaction = FORM.fuseaction  .  FORM.faSuffix
/cfif

Simpler, no? You're leaving it more accessible, and it's less likely to
screw up in some way.

K.

-- 
Keith Gaughan, Developer
Digital Crew Ltd., Pembroke House, Pembroke Street, Cork, Ireland
http://digital-crew.com/

~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190119
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Multiple submit buttons and Fusebox

2005-01-12 Thread RADEMAKERS Tanguy
I do the same thing, except i usually have a hidden form field called
fuseaction, so the syntax looks like:

input type=button
onclick=document.formName.fuseaction.value='fusecircuit1';document.form
Name.submit(); value=Do this 1

/t


-Original Message-
From: Matthew Small [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 12, 2005 7:03 PM
To: CF-Talk
Subject: RE: Multiple submit buttons and Fusebox

I would change the action of the form based on which button 
was pushed.  For
example:

input type=button
onclick=document.formName.action='index.cfm?fuseaction=fusecircuit1'
value=Do this 1

input type=button
onclick=document.formName.action='index.cfm?fuseaction=fusecircuit2'
value=Do this 2

...

- Matt Small



-Original Message-
From: Ken Dunnington [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 12, 2005 12:54 PM
To: CF-Talk
Subject: Multiple submit buttons and Fusebox

Hi, I have a quick fusebox question that I haven't been able to find
an answer to yet. I have a few ideas, but I thought I'd run it by some
people with experience. It's fusebox-specific, so I apologize if it's
too off-topic.

How, in fusebox, do you handle multiple submit buttons in a form? For
example, a form that has  select, delete, and add buttons? I was
thinking it should be submitted to an action that will redirect to
other fuseactions depending on the button pressed (an arbiter) but
should that be done in the circuit.xml file, or in an included page?
If it were done in an included page, there would be the problem of
passing the attributes along to any redirected page. If it were done
in XML, I suppose you would use if clauses to do it, but that just
doesn't 'feel' right to me :)

In Mach-II, I think what I would do is have a listener that would
check the event object for the existence of each 'action', and use
announceEvent() to continue processing. And in good old CFML,
obviously I'd just have an action page with if
(structKeyExists(form,actionToWatchFor)) blocks.

Any thoughts?





~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190120
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Multiple submit buttons and Fusebox

2005-01-12 Thread S . Isaac Dealey
I _think_ that with Fusebox 4 and later it's possible to use a
variable in the fuseaction in a do tag in your xml... so in theory
you could simply assign the button tag a name, then parameterize the
button name on the action page (you'd have to do this because IE
doesn't include the button value if a user hits enter in a text field)
and use it to process another fuseaction using the do verb...

in your form:

button type=submit name=buttonname
value=saveSave/button
button type=submit name=buttonname
value=deleteDelete/button


in your circuit.xml

fuseaction name=actMyForm
  set name=attributes.buttonname
value=save overwrite=false /
  do action=#attributes.buttonname# /
/fuseaction

Not absolutely certain that works -- I haven't tested it, but I
believe it does.

hth

 Hi, I have a quick fusebox question that I haven't been
 able to find
 an answer to yet. I have a few ideas, but I thought I'd
 run it by some
 people with experience. It's fusebox-specific, so I
 apologize if it's
 too off-topic.

 How, in fusebox, do you handle multiple submit buttons in
 a form? For
 example, a form that has  select, delete, and add buttons?
 I was
 thinking it should be submitted to an action that will
 redirect to
 other fuseactions depending on the button pressed (an
 arbiter) but
 should that be done in the circuit.xml file, or in an
 included page?
 If it were done in an included page, there would be the
 problem of
 passing the attributes along to any redirected page. If it
 were done
 in XML, I suppose you would use if clauses to do it, but
 that just
 doesn't 'feel' right to me :)

 In Mach-II, I think what I would do is have a listener
 that would
 check the event object for the existence of each 'action',
 and use
 announceEvent() to continue processing. And in good old
 CFML,
 obviously I'd just have an action page with if
 (structKeyExists(form,actionToWatchFor)) blocks.

 Any thoughts?

 

~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190121
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Multiple submit buttons and Fusebox

2005-01-12 Thread Ken Dunnington
Thanks, those are both great ideas! I guess I wasn't thinking of
Javascript, but it's a standard requirement these days, and this is
for the admin section, so we have the option to require it be enabled.
It seems like bad MVC practice to use another language to affect
application flow like that, but the more I think about it, the more I
realize I've probably just been thinking too hard. :)
Thanks for the help.


On Wed, 12 Jan 2005 13:05:07 -0500, Katz, Dov B (IT)
[EMAIL PROTECTED] wrote:
 You can make the button be the fuseaction field (only clicked one is
 sent), but sometimes you want a prefix.suffix style fuseaction... In
 that case you can do something like this:
 
 script language=JavaScript
 function appendFA(fa){
 document.forms.RealForm.fuseaction.value+=.+fa;
 document.forms.RealForm.submit();
 return false;
 }
 /script
 form name=RealForm action=index.cfm
 .
 input type=hidden name=fuseaction value=someFuseactionPrefix
 .
 
 input type=submit value=Delete onClick=return
 appendFA('Delete');
 input type=submit value=Save onClick=return
 appendFA('Save');
 input type=submit value=Cancel onClick=return
 appendFA('Cancel');
 
 /form
 
 Just ideas...
 
 d
 -Original Message-
 From: Ken Dunnington [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 12, 2005 12:54 PM
 To: CF-Talk
 Subject: Multiple submit buttons and Fusebox
 
 Hi, I have a quick fusebox question that I haven't been able to find an
 answer to yet. I have a few ideas, but I thought I'd run it by some
 people with experience. It's fusebox-specific, so I apologize if it's
 too off-topic.
 
 How, in fusebox, do you handle multiple submit buttons in a form? For
 example, a form that has  select, delete, and add buttons? I was
 thinking it should be submitted to an action that will redirect to other
 fuseactions depending on the button pressed (an arbiter) but should that
 be done in the circuit.xml file, or in an included page?
 If it were done in an included page, there would be the problem of
 passing the attributes along to any redirected page. If it were done in
 XML, I suppose you would use if clauses to do it, but that just doesn't
 'feel' right to me :)
 
 In Mach-II, I think what I would do is have a listener that would check
 the event object for the existence of each 'action', and use
 announceEvent() to continue processing. And in good old CFML, obviously
 I'd just have an action page with if
 (structKeyExists(form,actionToWatchFor)) blocks.
 
 Any thoughts?
 
 

~|
Purchase Captivate from House of Fusion, a Macromedia Authorized Affiliate and 
support the CF community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=52

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190129
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Multiple submit buttons and Fusebox

2005-01-12 Thread Brian Kotek
Isaac, that won't work because do tags are dealt with at parse time,
not at runtime.

You could do it like this so that you don't have to worry about
appending to the fuesaction or using the index.cfm file to figure out
what to do:

form action=index.cfm method=post
input type=hidden name=fuseaction value=home.formRouter
...
input type=submit name=nextAction value=Delete
input type=submit name=nextAction value=Save
input type=submit name=nextAction value=Cancel
/form

Then the fuseaction is like a mini-controller that determines which
do to call:

fuseaction name=formRouter
if condition=#attributes.nextAction# eq 'Delete'
truedo action=home.delete/true
/if
if condition=#attributes.nextAction# eq 'Save'
truedo action=home.save/true
/if
if condition=#attributes.nextAction# eq 'Cancel'
truedo action=home.cancel/true
/if
/fuseaction

Hope that helps,

Brian

On Wed, 12 Jan 2005 13:30:54 -0500, S. Isaac Dealey [EMAIL PROTECTED] wrote:
 I _think_ that with Fusebox 4 and later it's possible to use a
 variable in the fuseaction in a do tag in your xml... so in theory
 you could simply assign the button tag a name, then parameterize the
 button name on the action page (you'd have to do this because IE
 doesn't include the button value if a user hits enter in a text field)
 and use it to process another fuseaction using the do verb...
 
 in your form:
 
 button type=submit name=buttonname
 value=saveSave/button
 button type=submit name=buttonname
 value=deleteDelete/button
 
 in your circuit.xml
 
 fuseaction name=actMyForm
   set name=attributes.buttonname
 value=save overwrite=false /
   do action=#attributes.buttonname# /
 /fuseaction
 
 Not absolutely certain that works -- I haven't tested it, but I
 believe it does.
 
 hth
 
  Hi, I have a quick fusebox question that I haven't been
  able to find
  an answer to yet. I have a few ideas, but I thought I'd
  run it by some
  people with experience. It's fusebox-specific, so I
  apologize if it's
  too off-topic.
 
  How, in fusebox, do you handle multiple submit buttons in
  a form? For
  example, a form that has  select, delete, and add buttons?
  I was
  thinking it should be submitted to an action that will
  redirect to
  other fuseactions depending on the button pressed (an
  arbiter) but
  should that be done in the circuit.xml file, or in an
  included page?
  If it were done in an included page, there would be the
  problem of
  passing the attributes along to any redirected page. If it
  were done
  in XML, I suppose you would use if clauses to do it, but
  that just
  doesn't 'feel' right to me :)
 
  In Mach-II, I think what I would do is have a listener
  that would
  check the event object for the existence of each 'action',
  and use
  announceEvent() to continue processing. And in good old
  CFML,
  obviously I'd just have an action page with if
  (structKeyExists(form,actionToWatchFor)) blocks.
 
  Any thoughts?
 
 
 
 

~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190164
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Multiple submit buttons and Fusebox

2005-01-12 Thread S . Isaac Dealey
 Isaac, that won't work because do tags are dealt with at
 parse time, not at runtime.

Good to know... I wasn't sure.

Though if not do (which would be best if available) then the
variable could be used in an include tag right?


s. isaac dealey 954.927.5117
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://macromedia.breezecentral.com/p49777853/
http://www.sys-con.com/story/?storyid=44477DE=1
http://www.sys-con.com/story/?storyid=45569DE=1
http://www.fusiontap.com


~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190165
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54