[fusion-users] Jx.Panel Start Maximized/Closed

Nolte, Tim Tim.Nolte at ipcswirelessinc.com
Fri Aug 8 10:54:52 EDT 2008


Ok, well seeing how you have things defined I tried removing the panels & the panel manager from the global scope and I still left of the 'var' from the panels & panel manager. Well, it works. This seems a little odd to me but so long as it works this way I'm fine with it. I'm sure this is just due to my lack of full understanding of JS and the DOM. Thanks for the help.

- Tim

----
Timothy J Nolte - tnolte at ilpcs.com
Network Planning Engineer

iPCS Wireless, Inc.
4717 Broadmoor Ave, Suite G
Kentwood, MI 49512

Office: 616-656-5163
PCS:    616-706-2438
Fax:    616-554-6484
Web: www.ipcswirelessinc.com 

> -----Original Message-----
> From: Tómas Guðmundsson [mailto:tomas at snertill.is] 
> Sent: Friday, August 08, 2008 10:46 AM
> To: Nolte, Tim; fusion-users at lists.osgeo.org
> Subject: RE: [fusion-users] Jx.Panel Start Maximized/Closed
> 
> Well Tim,
> 
> In my opinion, what you should have is this (no need to 
> declare it null).
> 
> var pm;
> 
> But I have this code, and now declaration of panel4.
> window.onload = function() {
> 
>   Fusion.initializeLocale();  //need to call this first if 
> String.Translate is to be used in the onload
> 
> ...
> 
>   // Added by Snertill (Tomas Gudmundsson).
>   panel4 = new Jx.Panel({label: 
> OpenLayers.String.translate('InformationPanel'), 
> imageBaseUrl: 'images/'});
>   panel4.content.id = 'Information';
> 
> ...
> }
> 
> And then later,
> 
> var fusionInitialized = function() {
>     $('AppContainer').resize({forceResize: true});
>     panelman.maximizePanel(panel4);
> }
> 
> So it's never declared in the global environment but is 
> however working there.
> 
> Don't know if this works for you.
> 
> -----Original Message-----
> From: Nolte, Tim [mailto:Tim.Nolte at ipcswirelessinc.com] 
> Sent: 8. ágúst 2008 14:31
> To: Tómas Guðmundsson; fusion-users at lists.osgeo.org
> Subject: RE: [fusion-users] Jx.Panel Start Maximized/Closed
> 
> Here is my code:
> 
> 	<script type="text/javascript">
> 		var p1 = null;
> 		var p2 = null;
> 		var p3 = null;
> 		var pm = null;
> 		
> 		window.onload = function() {
> 			/* make 'thePage' just fill the browser 
> window and resize automagically
> 			   the user resizes the browser */
> 			new Jx.Layout('thePage');
> 			/* the height of toolbars.  For jxskin-border,
> 			 * its 28 and for jxskin-graphic its 30 */
> 			var h = 28;
> 			new Jx.Layout('Main', {bottom: 22, left: 250});
> 			new Jx.Layout('Statusbar', {height: 22, 
> top: null});
> 			new Jx.Layout('TaskPane', {bottom: 22, 
> width: 250, left: 0});
> 			new Jx.Layout('Toolbar', {height: h, 
> bottom: null});
> 			new Jx.Layout('Splitter', {top: h});
> 			
> 			var splitter = new 
> Jx.Splitter('Splitter', {elements: [$('Map'), 
> $('PanelPane')], containerOptions: [{}, {width: 200}]});
> 			
> 			p1 = new Jx.Panel({label: 'Legend'});
> 			p1.content.id = 'StaticLegend';
> 			//p2 = new Jx.Panel({label: 'Layers'});
> 			//p2.content.id = 'Layers';
> 			p3 = new Jx.Panel({label: 'Selection'});
> 			p3.content.id = 'SelectionPanel';
> 			pm = new Jx.PanelManager('PanelPane', [p1, p3]);
> 			
> 			$('thePage').resize();
> 			$('thePage').style.visibility = 'visible';
> 			
> 			
> Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED, 
> fusionInitialized);
> 			
> Fusion.registerForEvent(Fusion.Event.FUSION_ERROR, fusionError);
> 			Fusion.initialize();
> 		}
> 		
> 		function fusionError(eventId, error) {
> 		    console.log('Fusion Error: \n' + error.toString());
> 		}
> 		
> 		function fusionInitialized() {
> 		    var mapWidget = Fusion.getMapById('Map');
> 			
> 		    $('thePage').jxLayout.resize({forceResize:true});
> 		    $('Toolbar').jxLayout.resize({forceResize:true});
> 			
> 		    //enable pan widget by default
> 		    
> mapWidget.activateWidget(Fusion.getWidgetsByType('Pan')[1]);
> 			
> 			pm.maximizePanel(p1); // Maximize the 
> panel at startup
> 			
> 			//var map = Fusion.getWidgetById('Map');
> 		    //var l = new Jx.Layout($('Toolbar').childNodes[0]);
> 		    //l.resize();
> 		}
> 	</script>
> 
> You'll see that in order for me to reference 'pm' & 'p1' 
> within fusionInitialized I need to declare:
> 		var p1 = null;
> 		var p2 = null;
> 		var p3 = null;
> 		var pm = null;
> All outside of window.onload. I'm wondering if there is some 
> other way to address the PanelManager and Panels without 
> decalring the objects this way? The thing that kind of 
> frustrates me is that there is no documentation at all for 
> the jxlib. I found the website and there is nothing there 
> except for the download.
> 
> - Tim
> 
> ----
> Timothy J Nolte - tnolte at ilpcs.com
> Network Planning Engineer
> 
> iPCS Wireless, Inc.
> 4717 Broadmoor Ave, Suite G
> Kentwood, MI 49512
> 
> Office: 616-656-5163
> PCS:    616-706-2438
> Fax:    616-554-6484
> Web: www.ipcswirelessinc.com 
> 
> > -----Original Message-----
> > From: Tómas Guðmundsson [mailto:tomas at snertill.is] 
> > Sent: Friday, August 08, 2008 10:12 AM
> > To: Nolte, Tim; fusion-users at lists.osgeo.org
> > Subject: RE: [fusion-users] Jx.Panel Start Maximized/Closed
> > 
> > Hi
> > 
> > I'm sorry Tim, but I'm not sure what you're trying to 
> > accomplish. I can only ask you to rephrase your problem 
> > and take a look at this old email from this mailing list: 
> > http://lists.osgeo.org/pipermail/fusion-users/2008-July/000176.html
> > 
> > Hope that explains some problems I solved regarding panels 
> > and resizing.
> > 
> > Regards,
> > Tómas.
> > 
> > -----Original Message-----
> > From: Nolte, Tim [mailto:Tim.Nolte at ipcswirelessinc.com] 
> > Sent: 8. ágúst 2008 13:42
> > To: Tómas Guðmundsson; fusion-users at lists.osgeo.org
> > Subject: RE: [fusion-users] Jx.Panel Start Maximized/Closed
> > 
> > I was aware of the maximizePanel function of the 
> > PanelManager. The problem I can't figure out is how to 
> > address the PanelManager & Panel I want to maximize inside 
> > the fusionInitialized function. The PanelManager & Panels are 
> > getting created in the onload function and as a result it 
> > seems that those objects are only accessibly within that 
> > scope. If I create the empty JS objects in the public scope 
> > first then I am able to access the PanelManager & Panels 
> > inside the fusionInitialized function but I'm not sure this 
> > is the proper way of accomplishing this. I've tried looking 
> > through the DOM (via firebug) and looked through both the 
> > jx_combined.js & fusion-combined.js to figure out if there is 
> > some what of addressing these objects. I have to admit that 
> > I'm no expert in JS but I do have a fairly good handle on things.
> > 
> > BTW...having that one panel maximized on startup is exactly 
> > what I'm trying to accomplish. Thanks.
> > 
> > - Tim
> > 
> > ----
> > Timothy J Nolte - tnolte at ilpcs.com
> > Network Planning Engineer
> > 
> > iPCS Wireless, Inc.
> > 4717 Broadmoor Ave, Suite G
> > Kentwood, MI 49512
> > 
> > Office: 616-656-5163
> > PCS:    616-706-2438
> > Fax:    616-554-6484
> > Web: www.ipcswirelessinc.com 
> > 
> > > -----Original Message-----
> > > From: Tómas Guðmundsson [mailto:tomas at snertill.is] 
> > > Sent: Friday, August 08, 2008 5:08 AM
> > > To: Nolte, Tim; fusion-users at lists.osgeo.org
> > > Subject: RE: [fusion-users] Jx.Panel Start Maximized/Closed
> > > 
> > > Hi tim,
> > > 
> > > Not sure if this is what you're looking for but in index.html 
> > > under the 
> > > templates folder for the template you are using there is a 
> > > function called
> > > fusionInitialized. In there you can ask the panelman, 
> > > (manager of panels)
> > > to maximize a single panel for you.
> > > 
> > > 
> > > var fusionInitialized = function() {
> > >     $('AppContainer').resize({forceResize: true});
> > >     panelman.maximizePanel(panel1); // Maximize the panel 
> > at startup.
> > > 
> > > }
> > > 
> > > However, I do not know how to programmatically resize the 
> > > panels so that
> > > one is x sized, other is y sized and all others are closed 
> > > for example.
> > > (If that is what you're looking for).
> > > 
> > > Regards,
> > > Tómas
> > > 
> > > -----Original Message-----
> > > From: fusion-users-bounces at lists.osgeo.org 
> > > [mailto:fusion-users-bounces at lists.osgeo.org] On Behalf Of 
> > Nolte, Tim
> > > Sent: 7. ágúst 2008 16:37
> > > To: fusion-users at lists.osgeo.org
> > > Subject: [fusion-users] Jx.Panel Start Maximized/Closed
> > > 
> > > I've got two widgets in a panel bar. I'd like one to be default
> > > maximized and the other default closed, when first launching 
> > > the Fusion
> > > application. I've tried looking through the JX JavaScript 
> > > file to get a
> > > handle on how the Panel are constructed. I see that there are 
> > > some items
> > > in there to maximize, and even found a 'state' option for panels.
> > > However, it seems that the 'state' (open/closed) option isn't
> > > implemented yet. Anyone have any suggestions on this? Thanks.
> > > 
> > > - Tim
> > > 
> > > ----
> > > Timothy J Nolte - tnolte at ilpcs.com
> > > Network Planning Engineer
> > > 
> > > iPCS Wireless, Inc.
> > > 4717 Broadmoor Ave, Suite G
> > > Kentwood, MI 49512
> > > 
> > > Office: 616-656-5163
> > > PCS:    616-706-2438
> > > Fax:    616-554-6484
> > > Web: www.ipcswirelessinc.com
> > > _______________________________________________
> > > fusion-users mailing list
> > > fusion-users at lists.osgeo.org
> > > http://lists.osgeo.org/mailman/listinfo/fusion-users
> > > 
> > > 
> > 
> > 
> 
> 


More information about the fusion-users mailing list