Solved

cfwindow, cftree and cfajaximport

Posted on 2010-09-09
4
537 Views
Last Modified: 2012-05-10
Hi,
I am trying to open a cfwindow and wants to use the cftree tag on it to open the new page using link and closing the cfwindow on same click. I also want to do some font size and background color on cfwindow. My page 1 code is as under for it. is there anyway to change the mouse icon to hand instead of pointer.

<cfwindow />

Open in new window


color and body style in cfwindow
bodyStyle="font-family: verdana; color: ##000000;font-size:15px;font-weight:bold;" headerStyle="font-family: verdana; background-color:##CC0033; color: white"

Open in new window


code that creates cfwindow
<img src="assets/images/administrator.png" width="134" height="142" alt="Administration" title="Administration" onClick="ColdFusion.Window.create('adminwindow', 'Administration','smile1.cfm',{x:100,y:100,height:300,width:400,modal:true,closable:true,draggable:true,resizable:true,center:true})"/>

Open in new window


when i click on image it brings the cfwindow and ask for cfajaximport which i'm already using it but error is keep popping up. On second page I want so use the link to go to particular page and close the cfwindow.

my second page code is as under:

<cfajaximport tags="cfform, cftree, cftreeitem" />
<cfform name="form">
         <cftree name = "mytree" >
         <cftreeitem display="Naviagtion" value="root" >
            
         <cftreeitem value="a" parent="root" display="a" href="javascript:window.open('sp_AdministratorNewUser.cfm', '_self'); ColdFusion.Window.hide('adminwindow');">
                  <cftreeitem value="b" parent="root" display="b" href="javascript:window.open('sp_AdministratorNewUser.cfm', '_self'); ColdFusion.Window.hide('adminwindow');">
                           <cftreeitem value="c" parent="root" display="c" href="javascript:window.open('sp_AdministratorNewUser.cfm', '_self'); ColdFusion.Window.hide('adminwindow');">
            
         </cftree>
      </cfform>

Open in new window


any help, comment and feedback would be deeply appreciated.
0
Comment
Question by:s_hausen
  • 2
  • 2
4 Comments
 
LVL 28

Expert Comment

by:Pravin Asar
ID: 33646261
Here is a simple but comprehensive example.


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

<script>
function ShowWindow() {
	ColdFusion.Window.show('TreeWindow');
}
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="Goto Yahoo" href="javascript:HideWindow('http://www.yahoo.com');"  parent="0"/>
<cftreeitem value="2" display="Tree Item 2" 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>

Open in new window

0
 

Author Comment

by:s_hausen
ID: 33648274
First of all, very sorry for late response. Secondly I do appreciate your help and solution but I have one little problem, I've multiple buttons and every button needs to bring the diffrent tree. I need to session or any other variable to distinguish between trees. Is there a way I can define the session in onclick attribute. or is there a way I can use two pages to accomplish this task. One to show the buttons and second to bring the tree according to the variable value..
0
 
LVL 28

Accepted Solution

by:
Pravin Asar earned 500 total points
ID: 33648446
My solution was based on the your question.

To meet your  new requirements, you have option of

1. Binding CFWindow to form field.

http://www.rakshith.net/blog/?p=36


2. Create a new window for each action.

http://www.coldfusionjedi.com/index.cfm/2009/1/16/Launching-CFWINDOW-with-a-Dynamic-Location
0
 

Author Closing Comment

by:s_hausen
ID: 33648586
i didn't get the exact solution what i was looking for..
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PowerPoint Presentation .PPTX on Coldfusion 10 webpage 5 138
Cold Fusion Migration 4.5 --> 10 !! 4 49
CFIf Syntax and Logic 27 42
coldfusion, jQuery help 25 95
PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

806 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question