[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 681
  • Last Modified:

cfwindow information

i am using coldfusion 9's cfwindow tag but also i want to use the cfwindow animate feature and collapible features, but i know they are explicity declared, can u guide how can i try using ext js js objects and make my cfwindow actually animate and show the collapible icons

:)
0
Gurpreet Singh Randhawa
Asked:
Gurpreet Singh Randhawa
  • 8
  • 6
1 Solution
 
Pravin AsarCommented:
ColdFusion.Window.getWindowObject(windowname) will get you the  associated ExtJS Object.


http://dev.sencha.com/deploy/ext-3.4.0/docs/

look at ani**  properties/methods

0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
Thanks but how exactly using Coldfusion.window.getWindowObject
0
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

 
Pravin AsarCommented:
Here is example


<cfajaximport tags="cfform">
<cfajaximport tags="cfwindow">
<cfajaximport tags="cfgrid">
<cfajaximport tags="cftree">

<script>
function ShowWindow() {
      var wObj=ColdFusion.Window.getWindowObject('TreeWindow');
      ColdFusion.Window.show('TreeWindow');
      wObj.collapse(true);
}
function HideWindow(url) {
      window.location.href=url;
      ColdFusion.Window.hide('TreeWindow');
}

</script>

<cfform name="f1">
<cfinput type="button" name="b1" value="Show Window" onclick="ShowWindow()"/>
</cfform>

<cfwindow name="TreeWindow"  modal="false" initshow="false" resizable="false"
  title="Tree Window">
<cfform format="html"  name="treeform">
<cftree format="html" name="t1">
<cftreeitem value="1" display="Yahoo Site" href="javascript:HideWindow('http://www.yahoo.com');"  parent="0"/>
<cftreeitem value="2" display="Mail Site" href="javascript:HideWindow('http://mail.yahoo.com');" parent="0"/>
<cftreeitem value="11" display="Tree Item 11" parent="1"/>
<cftreeitem value="12" display="Tree Item 12" parent="1"/>
<cftreeitem value="21" display="Tree Item 21" parent="2"/>
<cftreeitem value="22" display="Tree Item 22" parent="2"/>
<cftreeitem value="23" display="Tree Item 23" parent="2"/>
<cftreeitem value="24" display="Tree Item 24" parent="2"/>
</cftree>
</cfform>
</cfwindow>

0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
That is really a good example.

2 questions,

1. it should open cfwindow on cloick of button and in the cfwindow a collapisble icon shud appear on cfwindow and on click should collapse it or expand it
0
 
Pravin AsarCommented:

wObj.collapsible = true;

should work.

When shown, if you do not want window collapsed, set

wObj.collapse(false);
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
i am not what is going wrong, my code is like this


var getID = ColdFusion.getElementValue('mygridname','formname','id');
      		var day = new Date();  
        	newID  = 'Open' + day.getTime();    
        	var windowOptions = new Object();  
                  windowOptions.width = 700;  
                  windowOptions.height = 300;  
                  windowOptions.x = 400;  
                  windowOptions.y = 400; 
                  windowOptions.modal = true;  
                  windowOptions.refreshOnShow = true; 
                  windowOptions.destroyOnClose = true;
                  windowOptions.resizeable = true;  
                  windowOptions.initshow = true;  
                  windowOptions.draggable = true;  
                  windowOptions.closable = true; 
     		ColdFusion.Window.create(newID,'Details','a.cfm?id=' + getID + '&random=' + Math.random(Math.random() * 1000), windowOptions); 
		var wObj = ColdFusion.Window.getWindowObject('newID');
     		wObj.collapse(false);
      		}I am getting the following error!

uncaught exception: ColdFusion.Window.getWindowObject: No window exists by the name newID

Open in new window

0
 
Pravin AsarCommented:
In your case, newID is a variable which tells the name of window. That is not a name of window.


var wObj = ColdFusion.Window.getWindowObject(newID);

0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
well it di some changes, i did not get the icon to expand/collapse in the cfwindow, just like cf_window custom tag
0
 
Pravin AsarCommented:

Here is working code. Look at my comments


<cfajaximport tags="cfform">
<cfajaximport tags="cfwindow">
<cfajaximport tags="cfgrid">
<cfajaximport tags="cftree">
<cfajaximport tags="CFINPUT-DATEFIELD" >

<script>

function CreateWindow() {
      var day = new Date();  
    newID  = 'Open' + day.getTime();    
      
    var windowOptions = new Object();  
    windowOptions.width = 700;  
    windowOptions.height = 300;  
    windowOptions.x = 400;  
    windowOptions.y = 400;
    windowOptions.modal = true;  
    windowOptions.refreshOnShow = true;
    windowOptions.destroyOnClose = true;
    windowOptions.resizeable = true;  
    windowOptions.initshow = false; // Do not show  
    windowOptions.draggable = true;  
    windowOptions.closable = true;
      getID=12;
      windowOptions.collapsible=true;
    ColdFusion.Window.create(newID,'Details','draw.cfm?id=' + getID + '&random=' + Math.random(Math.random() * 1000),
      windowOptions);

         //
      // Get the ExtJS Object
      //
      var wObj = ColdFusion.Window.getWindowObject(newID);
      
      //
      // Set the unsupported attribute by Coldfusion, but this is supported by ExtJS
      //
      wObj.collapsible = true;

        //
      // Now Show the window. make sure        windowOptions.refreshOnShow = true
      //
      ColdFusion.Window.show(newID);
}
                  
</script>

<cfform name="f1">
<cfinput type="button" name="b1" value="Create Window" onclick="CreateWindow()"/>
</cfform>
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
Thanks Mate, Only thing i am calling this cfwindow directly onclick of link and i am creating it rather than creating in a function and then doing cfwindow, if you can show me a sample of that, that will be nice of you
0
 
Pravin AsarCommented:
You lost me with your last post.

I do not understand what you want ?

Create Window with ExtJS ?



0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
i am creating a window using the code of Cldfusion.Window.Create, I am not using the Coldfusion.Window.show -- That is what i want to say.

Only using window.create will work or not

That is my concern

Regards
0
 
Pravin AsarCommented:
As I mentioned earlier, CF ignores the  "collapsible" attribute. [Although that is supported by ExtJs.

To have "collapse" caret/arrow, when window is collapsed, this is a work around.

0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 8
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now