Avatar of dpedersen
dpedersen

asked on 

cfwindow closes after action and displays results on parent page behind cfwindow

I have a page that addess 3 inputs from a cfform and the action is the page itself.  what happens is the info gets submitted properly however it closes the window and loads the page on the parent window that was originally behind the cfwindow.  the squence is as follows
review.cfm - has a link to open the cfwindow
addbid.cfm - acquires some prelim info it performs properly in cfwindow and on action forwards to
addbid2.cfm - this page loads in cfwindow, however when you perform the submit the page is suppose to load the info in the database and reload the page...what happens is it closes the window and reloads the page on the parent taht was behind the cfwindow

IM AT A LOSS.  i cant figure out why the first page (addbid.cfm) works great and load addbid2.cfm perfectly.  why does addbid2.cfm on action close the cfwindow?  
ill even give you a link to the site to view ..
go to .. http://darrenpedersen.com/vpf/internal/rfp/review.cfm?requestID=YODER7/23/200811:41:54-1
then click add bid in the upper left hand corner
ADDBID2.CFM
 
 <CFAJAXIMPORT TAGS="cfform, cfwindow"> 
 
<cfset CurrentPage=GetFileFromPath(GetBaseTemplatePath())>
 
<cfif IsDefined("form.add") AND form.add EQ 'y'>
  <cfquery datasource="#DSN#">
  INSERT INTO purchase_order_detail (requestID, quantity, description, price, bidID) VALUES ('#form.requestID#', '#form.quantity#', '#form.description#', '#form.price#', '#form.bidID#')
  </cfquery>
  
<cflocation url="addbid2.cfm?requestID=#form.requestID#&bidID=#form.bidID#">
 
 
</cfif>
 
 
<cfif IsDefined("URL.add") AND url.add EQ 'n'>
  <cfquery datasource="#DSN#">
    DELETE FROM purchase_order_detail WHERE podetailID=<cfqueryparam value="#URL.podetailID#" cfsqltype="cf_sql_numeric">
  </cfquery>
</cfif> 
 
 
 
<cfquery name="get_request" datasource="#DSN#">
SELECT *, (quantity * price) AS total
FROM request_for_product rfp, department d, building b, users u, rfp_bids rb, vendor v, purchase_order_detail pod
WHERE rfp.RequestID = <cfqueryparam value="#url.requestID#" cfsqltype="cf_sql_clob">
AND rfp.requestID = rb.requestID
AND rfp.departmentID = d.departmentID
AND rfp.buildingID = b.buildingID
AND b.po_manager_id = u.user_id
AND rb.vendorID = v.vendorID
AND pod.requestID = rfp.requestID
AND pod.bidID = <cfqueryparam value="#url.bidID#" cfsqltype="cf_sql_clob">
AND pod.bidID = rb.bidID
 
</cfquery>
 
<cfquery name="get_vendors" datasource="#DSN#">
SELECT *
FROM vendor
</cfquery>
<script type="text/javascript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
 
 
 
<table width="50%" border="1" bordercolor="#FFFFCC" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFCC">
  <tr bgcolor="#5F7C9A" bordercolor="#000000" align="center" > 
<td>
 
PO Creation Step 3
 
</td></tr>
<tr><td>
Please enter the line items for Purchase Order " <cfoutput>#get_request.requestID#</cfoutput>"<br />
<br />
 
<cfform action="#CurrentPage#" name="form1" id="form1"  method="post" >
Quantity<cfinput type="text" name="quantity" size="5" required="yes" message="You must enter a valid quantity" validate="integer"> 
Description: <cfinput type="text" name="description" required="yes" message="You must enter a description" >
Price:  <cfinput type="text" name="price" required="yes" message="You Must enter a price" validate="integer">
<input type="submit" value="Add Line Item">
<input type="hidden"  name="requestID" value="<cfoutput>#url.requestID#</cfoutput>">
<input type="hidden"  name="bidID" value="<cfoutput>#url.bidID#</cfoutput>">
  <input type="hidden" name="add" value="y" />
 
 
</cfform>
<br>
-----------------------------------------------------------------------------
<br>
<table width="50%" border="1" bordercolor="#FFFFCC" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFCC">
  <tr>
    <td colspan="2">Purchaes order #: <cfoutput>#get_request.requestID#</cfoutput></td>
    <td align="right">&nbsp;</td>
  </tr>
  <tr bordercolor="#000000">
    <td width="380">
    
    Location: <cfoutput>#get_request.building_name#</cfoutput><br />
    Submitted By: <br />
    Submit Date: <br />
    Submit Time: </td>
    <td colspan="2">Vendor Information: <br />
	  <cfoutput>#get_request.name#</cfoutput><br />
      <cfoutput>#get_request.address1#</cfoutput><br />
      <cfoutput>#get_request.city#</cfoutput>, <cfoutput>#get_request.state#</cfoutput> <cfoutput>#get_request.zip#</cfoutput><br />
      <cfoutput>#get_request.contact_name#</cfoutput><br />
      <cfoutput>#get_request.phone#</cfoutput><br /></td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3">
<!---  Subtable for line items    --->   
  <table width="770px" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000">
      <tr bgcolor="#999999">
        <td width="118">Quantity</td>
        <td width="366">Description</td>
        <td width="102">Price</td>
        <td width="124">Totals</td>
        <td width="50">&nbsp; </td>
      </tr>
 <cfloop query="get_request" >
 	<cfoutput>    
      <tr>
        <td>#get_request.quantity#</td>
        <td>#get_request.description#</td>
        <td>$#numberFormat(get_request.price, ".00")#</td>
        <td>$#numberFormat(get_request.total, ".00")#</td>
        <td><a href="addbid2.cfm?add=n&requestID=#url.requestID#&PODETAILID=#get_request.podetailID#&bidID=#url.bidID#">Delete</a>
      </tr>
</cfoutput>
</cfloop>
    </table>    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="157" align="center" bgcolor="#CCCCCC">Total</td>
    <td width="231" bgcolor="#CCCCCC"><cfoutput>will be calculated next</cfoutput></td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3">Bid Comments:<cfoutput>#get_request.bid_comments#</cfoutput></td>
  </tr>
</table><br />
 
<br>
 
<cfif #get_request.recordcount# is not 0>
<input type="button" value="Complete Bid Entry" onClick="MM_goToURL('parent','review.cfm?requestID=<cfoutput>#get_request.requestID#</cfoutput>');return document.MM_returnValue">
</cfif>
</td>
</tr>
</table>

Open in new window

ColdFusion Language

Avatar of undefined
Last Comment
gdemaria

8/22/2022 - Mon