Hi Chris,

well, FuseBox isn't dogma.  It's just a way of trying to make things
maintainable/comprehensible, etc.  So keeping that in mind, make your choice:-
By nesting cfswitches you will probably cut down on some code duplication. 
That's good.  You will also make your index.cfm a little harder to read. 
That's bad.

There's clearly no technical problem with the nested switch.  Just see how
much duplication you save, compare with the reduced readability, and see which
wins.  If it's not obvious, then flip a coin, because it obviously doesn't
really matter much one way or the other.

Helpful, eh? ;-)

Luck to you,
Bjork Borkman


"Chris Lott" <[EMAIL PROTECTED]> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Is it common to have other cfswitches embedded in the main index.cfm of
a fusebox application?

For instance, I have a dsp page that lists users for editing/deleting
and displays a form at the end for adding a new user.

rather than have one fuseaction for edit, one for delete and one for
add, I was thinking to have it call the uedit fuseaction with an
add/edit/delete parameter and then have an embedded cfswitch to decide
what to include on the page.

So index.cfm?fuseaction=uedit&process=add

and then in the index.cfm

<cfcase value="uedit">
    
    <cfswitch expression="#attributes.process#">
      <cfcase value="add">
        do act adduser
        do dsp back to list again   
      </cfcase>
      <cfcase value="edit">
        do dsp editform
      </cfcase>
    etc
    </cfswitch>

</cfcase>

Problems with this approach? Should I just break it all out into
discrete fuseactions?

c
- --
Chris Lott <[EMAIL PROTECTED]>| IT Manager|p907-474-3494

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8 for message encryption and authentication: USE PGP!
Comment: KeyID: 0x51046CFD

iQA/AwUBOcvX0daLYehRBGz9EQIgzACaA4qnvW2Rg560fSQiOydjGiigdN0AoIAK
TpMqnWbF6FkC4o+biYqc3TOd
=wCWj
-----END PGP SIGNATURE-----


------------------------------------------------------------------------------
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in the
body.


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1
------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebarRsts&bodyRsts/fusebox or send a message 
to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to