Disposing a parent container
I have a panel (which contains buttons) which is added in another panel and this another panel is also added in another tab container and the tab is in a JFrame. Now, in panel which contains buttons, there is a button- CLOSE. Now,how can I dispose the parent (may be grand parent) container- JFrame from that class of panel (button panel).
HA HA...........but if the parents dont have the capability to save themselves and give the child a means to kill them..what to do? I just want to know HOW CAN A CHILD DO THAT so that I can take some measures for saving the parents....lol..
Similar Messages
-
Hi All ,
I have created a sample project using a link button which when clicked opens up an TitleWindow which has an iframe and a text area in a hbox
When you execute the application ,
Click the link button
The Popup window opens up showing the title window with the close button
Click the close button of the title window
The Title window is removed and the iframe and the text area are not visible
Do this a couple of times
You can notice that the iframe is still visible even when the title window is closed
Can someone explain me how this issue can be resolved and also explain me why the iframe(child container) is still visible when the title window(parent container) is not visible.
Main Application file
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
width="100%" height="100%" creationPolicy="all"
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical" creationComplete="init()"
xmlns:containers="containers.*">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import containers.PopUpBrowser;
public function doRequest():void
var requestPopup:PopUpBrowser = PopUpManager.createPopUp(this, PopUpBrowser) as PopUpBrowser;
PopUpManager.addPopUp(requestPopup,this);
requestPopup.x = 220;
requestPopup.y = 50;
]]>
</mx:Script>
<mx:Text fontSize="14" fontWeight="bold" text="Click the link button below to open the Title Window" />
<mx:Spacer height="100"/>
<mx:LinkButton label="Click me" fontSize="16" fontWeight="bold" click="doRequest()"/>
</mx:Application>
PopUpBrowser.mxml Component
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow
xmlns:mx="http://www.adobe.com/2006/mxml"
close="removeMe()"
showCloseButton="true"
styleName="myTitleWindowStyle"
width="850" height="500"
title="Klout User Profile"
paddingTop="1" paddingBottom="1"
paddingLeft="1" paddingRight="1"
xmlns:generic="com.serendio.voom.components.generic.*"
xmlns:flexiframe="http://code.google.com/p/flex-iframe/"
horizontalScrollPolicy="off"
verticalScrollPolicy="off" >
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
public function removeMe():void
PopUpManager.removePopUp(this);
]]>
</mx:Script>
<mx:HBox width="100%" height="100%">
<flexiframe:IFrame source="http://www.google.com" id="iFrame" width="50%" height="100%"/>
<mx:TextArea text="Open and close the title window few times and watch the iframe remain visible even when the title window is closed"
fontSize="14" width="50%" height="80%"/>
</mx:HBox>
</mx:TitleWindow>
Thanks,
AjanthaHey,
This is working fine for me with the current 4.5 Flex, Firefox 3.6.12, IE8. On what browser you are getting this error.
Thanks,
Jayagopal. -
How can i centre two side by side divs vertically so they both are in the centre of there parent /containing div? One of the divs is larger than the other so i would want the smaller one to centre inside a parent div like so:
Grey= parent/container (Width of both orange and red div)
Orange= Div 1
Red= Smaller div- centralised (hopefully)If you wanted to go completely "Not for IE8 or lower" and use some of the often overlooked viewport units, it could be very responsive to browser resizing...
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title> VW, it's not just a car for Mac users...</title>
<style>
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
box-sizing:border-box;
#gray {
background-color:gray;
width:80vw;
margin:0 auto;
height:40vw;
font-size:2vw;
#red {
width:50%;
height:50%;
background-color:red;
margin-top:12.5%;
float:left;
#orange {
background-color:orange;
width:50%;
height:100%;
float:left;
</style>
<!--[if lt IE 9]>
<link href="IE-only.css" rel="stylesheet" type="text/css">
<![endif]-->
</head>
<body>
<div id="gray">
<div id="orange"></div>
<div id="red"></div>
</div>
</body>
</html> -
Get parent container size in renderer?
Hi,
I'm trying to add a variable number of same-sized Canvas
squares to the HorizontalList below:
<mx:HBox width="100%" height="50%" >
<mx:HorizontalList height="100%" width="60%"
dataProvider="{myData}"
itemRenderer="renderers.Topic" >
</mx:HorizontalList>
<mx:Canvas height="100%" width="40%" >
</mx:Canvas>
</mx:HBox>
I want the squares to be proportional such that as the app is
resized, the squares also grow or shrink in size. My item renderer
gets the size of the parent HorizontalList (via
BaseListData.owner.width) in order to calculate the dimensions of
each canvas square; as the app is resized, the size of the parent
changes and my square's dimensions are recalculated. However, it
seems that the size of the parent container isn't know until I
render some content but I can't render content until I know the
amount of real estate available in the parent. I missing something
basic here, right?
Thanks, GarryTurn it around. Instead of having the item renderer calculate
its width based on it's parent's width, have the HorizontalList set
the size of its children in updateDisplayList(). -
Float clearing for parent container - DW doesn't display
When I use one of the methods of float clearing for a parent container that has other floated elements inside of it, it seems to work fine in FF and IE. But it never shows up properly in DW design view. Instead, it just continues to show the parent container as collapsed.
Is there some setting in DW that I can change to make it display properly? It's difficult to really know what's going on when it displays like this.
Thanks...
-JesseJesseLY wrote:
Thanks, Osgood. Here's a link to a test page.
http://www.jesseyoung.com/tests/float_test/
It displays fine in FF and IE, but shows the outer container as collapsed in DW design view.
-Jesse
Hi Jesse
Change overflow: auto; to overflow: hidden; on the 'wrapper' css as below. This method will only work in DW CS4 design view.
If you have a previous version of DW then you'll need to use the <br style="clear: both;"> method in the code if you want to see the correct rendering in Design view (see below)
#wrapper {
border: 5px solid purple;
padding: 10px;
overflow: hidden;
width: 700px;
background-color: white;
Insert the <br> after the last floated element (as below)
</div><!-- end floatLeft -->
<br style="clear: both;" />
</div><!--end wrapper -->
Incidentally you appear to have an 'unpaired' </div> tag at the end of the code . -
Datagrid Scrolling Problem.. Does not fit into Parent Container..
Hi All,
I have a module and module contains only one datagrid. I am adding this module to tab navigator dynamically in the next index. I am using Text as Item renderer in the datagrid and the row height will change depending upon the data diplyed on the Text. When the data populate in datagrid the datagrid going beyond the containers layout. i.e height is not fit into parent container. I am using Canvas as parent container .. Please find the below attached pictures and you will get to know what is my problem?
Please help me to get out from this issue.. It is urgent..Thanks for quick reply
Here I am adding this module to canvas and the canvas is also dynamic . As you said "customize the measure() method in Text control and return the correct measuredHeight based on the explicitWidth." what is the relation between Text control height and datagrid? Datagird should take it's parent container width and heights. I am newbie to this Flex.. can you please explain it briefly. And if you have any Other way to do this please tell me .. it is very helpful to me.. Can you please post cusomized measure method if possible. please -
Change components parent container (owner)...
Hi, I have two containers which basically have draggable panels inside(components). on a button click I would like the panel(component) to change the parent container.. example..
container A has three panels(components) inside Panel1,Panel2,and Panel3. Once I click on a button in either one of the panels i want the Panel(component) to move to container B. So it is no longer in A , now it is in B. How is this possible...
also.. how do you make a panel dissapear...destroy it.. on button click ??Hi,
to remove panel from conatiner A
In Flex 3 say A.removechild(panel) Flex 4 A.removeElement(panel)
to add panel in to Container B
In Flex 3 say b.addchild(panel) Flex 4 B.addElement(panel)
to disapper panel say panel.visible = false.
to appear it again say panel.visible = true -
How can I control a parent container clip?
I have a site with the usual design: main.swf with a
container clip which loads the various swfs into it using
MovieClipLoader.
In one of the swfs that is loaded into the container clip, I
have a button that, onRelease, I'd like to load another swf into
the main container clip.
Can I have a button address the container clip that is
holding it's parent swf?
Another way to put it, can I have a movieclip unload itself
by loading another movieclip into it's own container clip?
thanks for any insight!kglad, thank you very much for taking a look.
Perhaps it would be better to view the entire site here:
http://www.katodesignstudio.net/linda/index.html
On the News page, I'd like to have a button that will load
the Screening page (screening.swf) where the News page is loaded.
At the link above, the button has been removed until I can find a
solution but it would be located where the "see screening page for
details" text is now.
As you can see by going to any other page, all of the pages
in the site load into a container clip. From what I can tell so
far, I need the button to unload the News.swf from the container
clip and load the Screening.swf into that same container clip,
similar to what the top Nav menu is doing. The trick seems to be to
get the button to unload the swf that the button is located in...
How can this be done?
thanks again for your help! -
How to test ajax parent container ?
Hi all Spryer,
I have a main page with many different categories and the
page use the Spry.Utils.updateContent to refresh a main DIV
container where i display some HTML content.
Till here, no pb but..
I would like to find how to make a redirection to the main
page with the main container if someone call directly one of an
html page who don't have to be displayed outside the main DIV
container.
I hope my question is quite clear. Sorry for mistakes
SOf from franceThe inheritance chain looks something like this:
Submit Button->ToolBar->ControlBar->RichTextEditor
So, in keeping with your original approach, you could just go
up the parent chain a couple more times to get to the
RichTextEditor.
event.target.parent.parent.parent.text should get you to the
TextArea and...
event.target.parent.parent.parent.id should get you your
id -
Parent Container can't autoLayout Issue
var m:Matrix=new Matrix();
m.scale(a, d);
cusStage.transform.matrix=m.clone();
The parent Containter can't autoLayout, and the H/Vscrollbar don't show automatically.
The child is a displayobject. Parent is a Canvas.Hello,
I've run into the same, if you have opened any sub-references to sheets, books etc they all need to be closed. What you have is a surviving reference floating about.
I wrote a container that kept all these references in shift registers and I needed to ensure that every new instance was closed after it was finished with. By the way it took a while to chase them all down.
If it is excel 97 and all you want to do is put data in tables and copy graphs I can forward you a copy of our component
Steve Watts (ssdc) -
Get Parent container to change child height on resize Event
Ok,
I've created a composite component called ResizableTextArea.
The parent is an extended class of Canvas called ResizableCanvas.
The child is an extended class of TextArea called myTextArea.
In myTextArea, there's an update function that makes the
textarea change it's height based on explicit height (how many
lines it actually has). when you add text, the height expands for
the new text. When you delete, the textarea's height shrinks to
contain the text. Beautiful.
Now, the parent, ResizeableCanvas, has a button that let's me
drag the width. The child's width is set to 100% of parent so it
resizes along with it. However, no matter what I try, when I resize
the parent canvas, the child textarea will not update its height.
I've tried everything I know and some, but nothing triggers
the change. Please assist!Sure, just focus on the last class, ResizableTextArea. Canvas
on the outside, Textarea on the inside. -
How to senter a JPanel on a parent container
Hi,
I have a fixed sized JPanel that I want to add to the center of a container. I would like my JPanel's center to be fixed to the center of the container.
I have tried to use GridBagLayout with a GridbagConstraint like follows:
GridBagLayout gridbag = new GridBagLayout();
getContentPane().setLayout(gridbag);
GridBagConstraints c = new GridBagConstraints();
c.fill = c.CENTER;
SubPanel subPanel = new SubPanel();
gridbag.setConstraints(subPanel, c);
getContentPane().add(subPanel);
setSize(400, 500);
setVisible(true);
But this results in the upper left corner of my JPanel being put in the center of the container. Does anyone know how to get the center of my JPanel being placed in the center?
Best regards
// Johanhow about flowlayout?
this.setLayout( new Flowlayout( Flowlayout.CENTER ) );
this.add( subPanel );
This might put it at the center at the top though.
Another way would be to use GridLayout and set the grids, when you add your panel it Should size the cells equal to your largest component which would be the JPanel, then just add blank JLabels to the other cells and add your subpanel to the center cell, that my work better. -
How to call a custom method in a parent container.
I have an MXML component that defines the method:
public function showAllGlyphs(spots:Array):void { ... }
There is a child component of this MXML componet called
DataClip, which has
a method that needs to call the parent method:
parent.showAllGlyphs(pushPins);
I get a 1061 error when compiling. I understand the problem.
The compiler
thinks the paret is a static class, and does not know about
the extention.
My question is how to I cast or otherwise reference this
method in the
PARENT?
Severity Description Resource In Folder Location Creation
Time Id
2 1061: Call to a possibly undefined method showAllGlyphs
through a
reference with static type
flash.display:DisplayObjectContainer.
DataClip.mxml Transitions line 32 August 21, 2006 3:07:28 PM
169I understand why what you say is the correct design pattern
(much more
modularity and the potential for re-use).
In my case, it still might make sense to use .parentDocument
(my problem was
not understanding the difference between .parent and
.parentDocument)
Although I still don't understand why .parentDocument does
work.
I have a bunch of purely GUI oriented subComponents of a
.parentApplication.
The parentApplication has a custom AS-only module that does
the "business
logic, network connections, etc).
Basically, I want a module (Singleton Class) that is
accessible from all GUI
subcomponents that provides general utility functions. It
can't be
instatiatiated multiple times. So there needs to be one
global place for it.
It does not really make things clear if everything is done
via an event
paradigm. (Well, maybe to me, but I have a Ph.D. in CS so I
am tainted) I
want this clear to the average programmer.
===============================
Dr. Yechezkal Gutfreund
Team ACE for Mobile Devices
===============================
"peterent" <[email protected]> wrote in
message
news:[email protected]...
> As a rule of thumb, a child should never call functions
in its parent. It
> is
> possible, it just not a very good programming practice.
> If a child needs the parent to do something, the child
should dispatch an
> event. In your child, declare an event using Metadata:
>
> <mx:Metadata>
> [Event("showGlyphs")]
> </mx:Metadata>
>
> The child should have a public property that the parent
can access to
> handle
> the event:
>
> public var pushPins:Array;
>
> When the child needs the parent to do this, have the
child set the
> pushPins
> array, then dispatchEvent( new Event("showGlyphs") );
>
> In the parent, on the child's tag, have it listen for
the event and
> execute it:
>
> <MyChild
showGlyphs="showAllGlyphs(event.target.pushPins)" />
>
> I know this seems like a lot more work, but it is a much
better strategy
> than
> having children reach up and into the parent's code.
> -
Submit button doesn't work after moving form to another parent container
I'm re-arranging the page using jquery. When I moved a div or table containing a form to another div, the submit button doesn't work anymore. Using the emulation mode under the Inspect Element feature of IE, the same code works for IE9 but not under IE10
and up.
Any ideas?
I will steal the answer that George gave to a similar question, because it turns out it is applicable here as well:
George Johnson on Feb 23, 2012 11:17 AM
When you distribute a form, it replaces the email address that you've set up in a submit button with the email address you have specified in "Edit > Preferences > Identity > Email Address". So before you initiate the Distribute Form process, change the email address there to the one you want to use.
It is a ridiculous solution, because it means I have to make the identity of my personal copy of Acrobat the email address of someone else or some other department when I make the form, but whatever -- at least the form sends now. -
How to get the label of parent container?
Hi
I have a Canvas, Its label is "News".
I added a text control in it and i want to set its text
dynamically from the canvas label.
But i dont know how to access the label of the Canvas
"without" using the id of the canvas.
like
<mx:Canvas label="News">
<mx:Text text="{parent.label}"/>
</mx:Canvas>
Please guide me to achieve the above thing.
Thanks in advance"manofspirit" <[email protected]> wrote in
message
news:garoob$lqh$[email protected]..
> Thanks for the reply Amy
> But I dont have any idea about sub-classing!
> Please put some light on this concept.
> Thanks
Say you have an application
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
xmlns:mm="com.magnoliamultimedia.*"
layout="absolute">
<mx:Canvas label="foo">
<mm:ParentLabelText width="100" height="25" />
</mx:Canvas>
</mx:Application>
If you have a directory com that has a directory
magnoliamultimedia in it,
then if it has this file, you should see "foo" on the screen
when you run
that application:
<?xml version="1.0" encoding="utf-8"?>
<mx:Text xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="init()">
<mx:Script>
<![CDATA[
private function init():void{
if (parent.hasOwnProperty('label')){
text=parent['label'];
} else {
text='parent has no label property';
]]>
</mx:Script>
</mx:Text>
HTH;
Amy
Maybe you are looking for
-
Error while creating a sales order BAPI_SALESORDER_CREATEFROMDAT2
Hi All, I am using the BAPI BAPI_SALESORDER_CREATEFROMDAT2 to create a sales order. I am passing all the required fields and also the rejection code at the item level. Also I am using a variant configuration material and hence ai am filling the VC co
-
External hard drive problem, please help!
I have a SEAGATE external hard drive which I had associated with Time machine so its file system was HFS+ journaled. when i turn the hdd on a window pop up comes on the screen telling me to either initialize, ignore or eject. if i go to disk utility
-
Hello I am trying to install the latest itunes software to my computer. After installing I keep receiving the error messages. Runtime error. Please see the screen capture of the error messages. Please help, Thank you Ab Majid
-
6300 games etc not found on memory card anymore
as said above, i tried to copy (not cut) everything over to a 2GB card, but some things were write protected. so i put the old card back in to the phone (including all the exsisting files), but now theres no games, even thought you can explore the me
-
Emailing dashboard page to users
Hi guys, We have a request to send reports by email to end users, each user will receive 3 reports ( compiled into a single dashboard page per user) with their related data. ie User A => Dashboard page with 3 reports with data for this user alone Use