Skip to main content
Participating Frequently
March 26, 2010
Answered

cfwindow, how do I .....

  • March 26, 2010
  • 1 reply
  • 877 views

Ok I got this code setup for a little login window on page called login.cfm:

<cfif isdefined("form.HICMS")>
<script type="text/javascript">
ColdFusion.Window.hide("loginWindow");
</script>

Do Authentication ......

<cflocation url="private/" addtoken="no">
</cfif>

<cfwindow name="loginWindow" center="true" closable="false" draggable="false" modal="true" title="LOGIN!" initshow="true" resizable="false" width="400" height="180">
<cfform name="loginForm">
<cfinput type="hidden" name="HICMS" value="TRUE">
<table align="center" border="0" cellpadding="4" cellspacing="2" width="100%">
    <tr>
        <td align="center">
            <font color="#FF0000">*</font> <label>UserName: <cfinput name="userName" type="text" id="userName" required="yes" message="You must input a Username!"></label>
        </td>
    </tr>
    <tr>
        <td align="center">
            <font color="#FF0000">*</font> <label>Password: <cfinput name="passWord" type="password" id="passWord" required="yes" message="You must input a Password!"></label>
       
        </td>
    </tr>
    <tr>
        <td align="center">
            <cfinput type="submit" name="" value="Login!">
        </td>
    </tr> 
</table>
</cfform>
</cfwindow>

Along with a private directory with an index.cfm in it says 'hello welcome to private'.

Ok the problem: when it does the cflocation it all stays in the window, little tiny window. How do I get it to go back to the browser? tried hide window and destroy window with no luck, what am I missing here? cflocation does not work in cfwindow?

Any help is greatly appreciated.

This topic has been closed for replies.
Correct answer Fernis

Instead of cflocation, you can use javascript for this, if you want to reload the whole page with another template.

<script>document.location.href='private/';</script><cfabort>

Then again, if you use a bit more elegant design, having a full page cflayoutarea to host your page content so that the loaded scripts and windows don't die, you can use ColdFusion.navigate() to post forms into desired containers. Doesn't apply directly to your example, but in general...

ColdFusion.Ajax.submitForm() might give you even more delicate results, where you can post the form without anyone noticing, then hide the window, etc. Haven't tried this one yet myself, though.

-Fernis

1 reply

Fernis
FernisCorrect answer
Inspiring
March 26, 2010

Instead of cflocation, you can use javascript for this, if you want to reload the whole page with another template.

<script>document.location.href='private/';</script><cfabort>

Then again, if you use a bit more elegant design, having a full page cflayoutarea to host your page content so that the loaded scripts and windows don't die, you can use ColdFusion.navigate() to post forms into desired containers. Doesn't apply directly to your example, but in general...

ColdFusion.Ajax.submitForm() might give you even more delicate results, where you can post the form without anyone noticing, then hide the window, etc. Haven't tried this one yet myself, though.

-Fernis