Flex TitleWindow

tamilselvanmani
tamilselvanmani used Ask the Experts™
on
Hi,

I am using TiltleWindow to show the popup screen on click of itemrenderer, I want to remove the default padding for the content area in TitleWindow. i had tried all the the properties of panel as the TitleWondow extends Panel.
If anyone has the solution please provide it to me.

Thanks in Advance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Hello,

Did you tried paddingBottom, paddingLeft, paddingRight, paddingTop to set to 0?

Thanks,
Vindys

Author

Commented:
Hi,

before posting the question i had tried this option this propertie is not controling the padding in TitleWindow content area.
Do you have another solution?

Thanks,

Commented:
Can you take a screen shot and show which padding you mean? Also its helpful if you show the code snippet.

Thanks,
Vindys
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Hello,

Try this.

borderAlpha="1" borderThicknessBottom="0" borderThicknessTop="0" borderThicknessLeft="0"
borderThicknessRight="0" paddingLeft="0" paddingRight="0" paddingBottom="0" paddingTop="0"

Hope this will work.

Thanks
Arun

Author

Commented:
hi,

i havn't tried the borderAlpha so tried it but its not working as expected. here i had attached the screen shot for reference please look in to it. In the screen shot i had had drawn 3 lines which specifies the space which i want to remove. i.e. i want to strech the Login bar to get the same size as My Popup  bar.

Thanks.



TitleWindow.bmp

Commented:
Sorry Tamil,

I am not getting any clear idea. Just show some code snippet if possible. So can check it out.

Thanks,
Vindys

Author

Commented:
Hi Vindys,

Please find the code snippet which i had attached.

Thanks.
// Title window code which is rendered on click of a button.

<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" verticalGap="0" horizontalGap="0" borderAlpha="1"
		layout="vertical" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" borderThickness="3"
		width="410"	height="215" title="My Popup" titleStyleName="titleWindowHeader" titleBackgroundSkin="@Embed(source='images/header_bg.gif')">

<mx:Script>
			<![CDATA[
				import mx.managers.PopUpManager;
				
				private var statusText:String;
				private var contentText:String;
				
				public function setStatusText(value:String):void{
					statusText = value;
				}
				
				public function setContentText(value:String):void{
					contentText = value;
				}
				
				private function closeWindow():void{
					PopUpManager.removePopUp(this);
				}
			]]>
		</mx:Script>
<mx:Panel width="100%" height="162" borderThickness="1" layout="horizontal" title="{statusText}"
			paddingTop="0" paddingLeft="0" paddingRight="0"	paddingBottom="0" cornerRadius="0" headerHeight="24"
			dropShadowEnabled="false" borderThicknessBottom="0" borderThicknessLeft="0" borderThicknessRight="0" 
			borderThicknessTop="1" titleBackgroundSkin="@Embed(source='images/header_bg.gif')"
			titleStyleName="titleWindowStatusText" borderColor="#9DDBF4" borderSides="top" borderAlpha="1" backgroundAlpha="1">
			<mx:Form width="100%" height="133" horizontalGap="0" verticalGap="0" verticalCenter="true"
				 indicatorGap="0" paddingBottom="0" paddingTop="0">
				<mx:VBox width="100%" height="130" verticalGap="0">
					<mx:Text text="Are you sure you want to {contentText}?" height="42" styleName="titleWindowLabel"/>
					<mx:Text text="{statusText} Comments" fontWeight="bold" styleName="titleWindowLabel" height="24"/>
					<mx:TextArea width="100%" height="31"/>
					<mx:HBox width="100%" horizontalAlign="right" height="30" verticalAlign="middle">
						
						<mx:Button label="Cancel" click=" closeWindow()" enabled="true" styleName="titleWindowButton"/>
						<mx:Spacer height="100%" width="3"/>
						<mx:Button label="{statusText}" enabled="true" styleName="titleWindowButton" verticalCenter="true"/>
					</mx:HBox>
				</mx:VBox>
			</mx:Form>
		</mx:Panel>

</mx:TitleWindow>


// Code to invoke the Title window

<mx:Script>
	<![CDATA[
 import mx.managers.PopUpManager;
 var signOffvar:signOff;
            public function createPopUp():void{
            	signOffvar = new signOff();
            	signOffvar.setStatusText("Log in");
            	signOffvar.setContentText("Log out");
				PopUpManager.addPopUp(signOffvar,this,true);
				PopUpManager.centerPopUp(signOffvar);
  			} 
        ]]>


</mx:Script>

<mx:Image id="report" source="{reporting_icon}" click="createPopUp()" useHandCursor="true" buttonMode="true"/>

Open in new window

Commented:
Its caused because of your titleBackgroundSkin.

Author

Commented:
Hi,

It's not because of titleBackgroundSkin. I had tried this sort of probabilities.

Commented:
Can you just use this code instead of your signOff and check if its giving any space
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" verticalGap="0" horizontalGap="0" borderAlpha="1"
                layout="vertical" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" borderThickness="3"
                width="410"     height="215" title="My Popup">

<mx:Script>
                        <![CDATA[
                                import mx.managers.PopUpManager;
                                
                                private var statusText:String;
                                private var contentText:String;
                                
                                public function setStatusText(value:String):void{
                                        statusText = value;
                                }
                                
                                public function setContentText(value:String):void{
                                        contentText = value;
                                }
                                
                                private function closeWindow():void{
                                        PopUpManager.removePopUp(this);
                                }
                        ]]>
                </mx:Script>
                
<mx:Panel width="100%" height="162" borderThickness="1" layout="horizontal" title="{statusText}"
                        paddingTop="0" paddingLeft="0" paddingRight="0" paddingBottom="0" cornerRadius="0" headerHeight="24"
                        dropShadowEnabled="false" borderThicknessBottom="0" borderThicknessLeft="0" borderThicknessRight="0" 
                        borderThicknessTop="1"
                        titleStyleName="titleWindowStatusText" borderColor="#9DDBF4" borderSides="top" borderAlpha="1" backgroundAlpha="1">
                        <mx:Form width="100%" height="133" horizontalGap="0" verticalGap="0" verticalCenter="true"
                                 indicatorGap="0" paddingBottom="0" paddingTop="0">
                                <mx:VBox width="100%" height="130" verticalGap="0">
                                        <mx:Text text="Are you sure you want to {contentText}?" height="42" styleName="titleWindowLabel"/>
                                        <mx:Text text="{statusText} Comments" fontWeight="bold" styleName="titleWindowLabel" height="24"/>
                                        <mx:TextArea width="100%" height="31"/>
                                        <mx:HBox width="100%" horizontalAlign="right" height="30" verticalAlign="middle">
                                                
                                                <mx:Button label="Cancel" click=" closeWindow()" enabled="true" styleName="titleWindowButton"/>
                                                <mx:Spacer height="100%" width="3"/>
                                                <mx:Button label="{statusText}" enabled="true" styleName="titleWindowButton" verticalCenter="true"/>
                                        </mx:HBox>
                                </mx:VBox>
                        </mx:Form>
                </mx:Panel>

</mx:TitleWindow>

Open in new window

Author

Commented:
Hi,

I had resolved my problem with the help of css. i have one problem i.e. i want to pass an object which is fetched from DB to the mxml which invokes the title window mxml. Do any one have any answere. Let me clear one thing i had tried many samples which i found while googling.

Thanks in advance.
Commented:
You have different options. If you have the object at the time of creation of the component itself, you can directly pass the object just like this.

<ns1:titleWindow1 dataObj="{myObj}" width="100%" height="100%" />

Thanks,
Vindys
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
	<mx:Script>
		<![CDATA[
			private var _dataObj:Object;
			public function set dataObj(obj:Object):void{
				_dataObj = obj;
				for (var p:String in obj) {
           			_text.text += p + ":" + obj[p] + "\n";
        		}
			}
			public function get dataObj():Object{
				return _dataObj;
			}
		]]>
	</mx:Script>
	<mx:Text id="_text"/>
</mx:Canvas>

Open in new window

Author

Commented:
i have resolved this issue

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial