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

:)
LVL 16
Gurpreet Singh RandhawaWeb DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pravin AsarPrincipal Systems EngineerCommented:
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
Pravin AsarPrincipal Systems EngineerCommented:
0
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
Thanks but how exactly using Coldfusion.window.getWindowObject
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Pravin AsarPrincipal Systems EngineerCommented:
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 AsarPrincipal Systems EngineerCommented:

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 AsarPrincipal Systems EngineerCommented:
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 AsarPrincipal Systems EngineerCommented:

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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 AsarPrincipal Systems EngineerCommented:
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 AsarPrincipal Systems EngineerCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.