Link to home
Start Free TrialLog in
Avatar of earwig75
earwig75

asked on

CF Window with no title bar/borders or a window that can be dynamically updated

Is it possible to hide the title bar area of a CFWINDOW? If not, without using complex javascripts is there something comparable in ColdFusion that would let me dynamically edit/update information similar to how you can with CFWindow?

I looked into CFDiv but it appears that you must bind the information to something. Would I be able to bind the information in to an xml file?

Thank you.
Avatar of SidFishes
SidFishes
Flag of Canada image

you can't (easily) hide the title bar since it contains the X to close the window but you can


1) Just not use anything for the title attribute

2) hide the title text by manipulating the css (this is a bit silly since you get the same effect by not using a title attribute) but i'm including it because you can do all sorts of other things by creating a class and applying it to the header

<cfajaximport tags="cfwindow"> 
<style>
.noTitle
{font:0px;}
</style>

<script>
function openWindow(){
document.getElementById(ColdFusion.Window.getWindowObject('myWindow').header.id).className = "noTitle";
ColdFusion.Window.show('myWindow')
}
</script>

<cfwindow width="200" height="150" name="myWindow">My Window</cfwindow>
<button onclick="openWindow();">Open</button> 

Open in new window

or

3) manipulate the title dynamically
<cfajaximport tags="cfwindow"> 
<script>
function openWindow(){
document.getElementById(ColdFusion.Window.getWindowObject('myWindow').header.id).innerHTML = openWindow.arguments[0];
ColdFusion.Window.show('myWindow')
}
</script>
<cfwindow width="200" height="150" name="myWindow">My Window</cfwindow>
<button onclick="openWindow('My Variable Title');">Open</button>

Open in new window

Avatar of earwig75
earwig75

ASKER

I'd like to hide the title bar and borders completely... similar to what is being done here: http://www.coldfusionguy.com/ColdFusion/blog/index.cfm/2008/5/30/CFWindow-as-Image-onMouseOver-EnlargerPop-Up

I am not having any luck at all. I am stil a beginner when it comes to this type of code so is there a way to have an example similar to that one? I just want the CFwindow to load the contents and not show the borders etc.

Thanks again.
Also, with the above example, I receive the following error while debugging.. nothing happens when clicking the button.
error.jpg
works fine for me in FF, IE, Chr & Saf - did you copy & paste exactly? What version of CF are you using (working with 8 here)

As for hiding the border completely, (as I said in my original post "you can't (easily) hide the title bar" Scott's blog post covers how you have to do it. There aren't really many shortcuts or other examples that would be any less complicated.
I am using CF 9 - I believe this may be the issue. I can't find any equivalent examples for CF9 anywhere.
there shouldn't be any issue with 9 although I can't confirm it. The functionality should be the same.
> there shouldn't be any issue with 9 although I can't confirm it.

I don't know much about the ext stuff except they changed the version ... again. So some CF8 tricks don't work in CF9. You need to figure out the new syntax all over again. CF9 does have a headerStyle attribute:

            <cfwindow headerStyle="display: none;"...>

but nothing for borders. Least not that I can see.

What's your reservation about using cfdiv?  It's gotta be simpler than messing with cfwindow ...
I am not sure how to do what I was trying with cfdiv. Basically dynamically updating a variable. With cfwindow I can destroy and create it without refreshing the page... not sure how to do this with cfdiv.
thx agx - thought you might chime in. I've not used cfdiv much so perhaps you can help with that.
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial