This is pretty tenuous as far as the thread goes, but it is related to
putting conditional logic in the index.xxx, and it is fusebox, and anyway i
reckon Hals just trying to get together a load of best practices so he can
add it to his cour$e and sell them back to us
;)
Anyway, to add my 2 pence, (and try and get some feed back on my ropey jsp),
heres an example of what I've done:
<mytags:BdyCntent>
<jrun:switch>
<jrun:case expr='<%= "regions".equals(fuseaction) %>'>
<jsp:include page="dsp_regions.jsp" flush="true">
<jsp:param name="xfa_regionedit" value="regedit"/>
</jsp:include>
<%= request.getAttribute("bodycontent") %>
</jrun:case>
<jrun:case expr='<%= "regedit".equals(fuseaction) %>'>
<jsp:include page="dsp_regionedit.jsp" flush="true">
<jsp:param name="xfa_cancel" value="regions"/>
<jsp:param name="xfa_commit" value="regedit"/>
</jsp:include>
<% if ("true".equals(request.getAttribute("bregionsaved"))) {%>
<jsp:forward page="index.jsp?fuseaction=regions"/>
<% } else {%>
<%= request.getAttribute("bodycontent") %>
<% }%>
</jrun:case>
<jrun:case expr='true'>
<h3>fuseaction <b><%= fuseaction %></b> not recognised</h3>
</jrun:case>
</jrun:switch>
</mytags:BdyCntent>
Basically, if the user tries to edit a region (fuseaction=regedit) the form
posts to itself, and depending on the result (bregionsaved) I'll either
forward back to "index.jsp?fuseaction=regions", or dump the bodycontent,
which will contain the form and any errors, and gets scooped up by the outer
<mytags:BdyCntent>
Bert
> -----Original Message-----
> From: Hal Helms [mailto:[EMAIL PROTECTED]]
> Sent: 09 April 2001 16:08
> To: Fusebox
> Subject: Once more, into the breach...
>
>
> One more question: In the following code, "qryMyQ.cfm" is a
> simple query--no
> conditional code. If after the query executes, you want to call a new
> fuseaction, "doThisNow", do you use method A, method B, or
> something else?
>
> Method A:
> <cfcase value="doSomething">
> <cfinclude template="qryMyQ.cfm">
> <cflocation url="index.cfm?fuseaction=doThisNow">
> </cfcase>
>
> Method B:
> <cfcase value="doSomething">
> <cfinclude template="qryMyQ.cfm">
> <cfinclude template = "url_doThisNow.cfm">
> </cfcase>
>
> Hal Helms
> Team Allaire
>
> [ See www.halhelms.com for info on training classes ]
>
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists