Accessing Children of VBox

Hello All,
I have dynmaically created some CheckBox's and added them to a VBOX.
What i want to do is create a function that will iterate through them all and deselect. I have got this far:
private function clearSelection():void
            for (var i:int = 0; i < campaignRadioButtons.numChildren; i++) {
                var tmpCheckBox:CheckBox = new CheckBox
                tmpCheckBox = CheckBox(campaignRadioButtons.getChildAt(i));
                trace (tmpCheckBox.label);
Ok so this at the moment returns all of the labels. What I want to do is get access to the 'selection' attrubute and set it to false. How do I do this?.. without having to re add them all over again.
Thanks

private function clearSelection():void
    var n:int = campaignRadioButtons.numChildren;
    for (var i:int = 0; i < n; i++)
        var tempCheckBox:CheckBox = CheckBox(campaignRadioButtons.getChildAt(i));
        tempCheckBox.selected = false;
Note: DON'T do
private function clearSelection():void
    var n:int = campaignRadioButtons.numChildren;
    for (var i:int = 0; i < n; i++)
        var tempCheckBox:CheckBox = new CheckBox();
        tempCheckBox = CheckBox(campaignRadioButtons.getChildAt(i));
        tempCheckBox.selected = false;
This needlessly creates n new CheckBox instances and frees them when the reference to the ith new CheckBox in tempCheckBox is overwritten with the reference to the ith existing CheckBox.
Gordon Smith
Adobe Flex SDK Team

Similar Messages

  • Accessing children of children

    Hey!
    for some reason STORAGE[0].getChildAt(0) works whereas liner.getChildAt(0).getChildAt(0) does not. STORAGE is a movieclip and a child of liner. the error is something about not being able to use getChildAt on a display object.
    what's wrong? is there any other approach i could use?
    PS: liner.getChildAt(0) works and does indeed seem to refer to STORAGE[0]
    thanks!!

    What do you mean when you say "liner.getChildAt(0) works and does indeed seem to refer to STORAGE[0]"... in what ways does it work and seem?  You might find out that what you believe is STORAGE[0] is not.
    Try using...
    trace(DisplayObjectContainer(liner.getChildAt(0)).getChildAt(0));
    and see what comes up.
    If you have direct access to the objects via the STORAGE array there is no need to be trying to reach them via whatever you might have added them as children.  The reference in the array is a direct line to them.
    You should show the code that creates this system so that it is clearer what each element is and from where each arises.  If you are getting an error message, include the complete message.

  • Accessing children by index

    if I create a symbol, go to the linkage window, set the
    symbol's class name to myClass (which extends sprite), set it's
    base class to Sprite, then create an instance of myClass in AS3, my
    instance already has a child, of type shape, which presumably is
    just an instance of my symbol.
    this seems very problematic. if I want to then add and remove
    children using indices, everything will be off by one (or more?
    or, what if I at some point addChildAt(0)? then things get
    worse
    am I doing something wrong? should my symbol-extended objects
    begin life w/ zero children?
    if not, does that mean I should just stores my children in a
    backing array and manipulate that? or do it strictly by obj
    reference, as in removeChild(ref)?
    thanks

    that may cause some unexpected issue because it's not really
    a sprite and it's not a movieclip.
    anyway, each object created in the authoring environment has
    a graphic child object of some sort. that shouldn't cause any
    problems and doesn't interfere with accessing other child object
    types once you recognize the shape is a child object.

  • Accessing children on frames after gotoAndStop

    Hi
    I have an SWF file where I want to access symbol instances on
    frame 2.
    I have noticed that after I call gotoAndStop(2); it takes a
    little while before the symbol instances are instantiated.
    I get null ref exceptions if I immediately access the
    children on a frame after calling gotoAndStop, but if I wait a bit
    it works, because it seems as if the children have had time to be
    instantiated, see examples below.
    I prefer not to rely on delaying my code, but would rather
    prefer to listen for an event that could notify me when a frame is
    properly "initialised", that is, when all symbol instances have
    been instantiated. Is there such an event and if not, is there
    another solution ?
    Examples:
    mc2 is a movieclip.
    1) This gives null exceptions because the child of frame 2 is
    null when accessed.
    mc2.gotoAndStop(2);
    for(var i:int = 0; i < mc2.numChildren; ++i)
    var child:DisplayObject = mc2.getChildAt(i)
    trace(child.name);
    trace("done");
    But it works if I wait a bit, because apparently I have
    waited enough to allow the child to become instantiated:
    mc2.gotoAndStop(2);
    var intervalId:int = setInterval(callback,100);
    function callback():void
    clearInterval(intervalId);
    for(var i:int = 0; i < mc2.numChildren; ++i)
    var child:DisplayObject = mc2.getChildAt(i)
    trace(child.name);
    trace("callback done");
    trace("done");
    Is there an event that can be used instead of relying on some
    delay ?
    Best regards Stig Nielsson

    My guess is that you are waiting for the timeline to advance
    to frame 2, which doesn't happen instantly, it follows the frames
    per second rate you establish for the file. If the frame 2 clips
    don't exist in frame 1 but that's where your code (which does act
    instantly) starts looking for them, then it was probably looking at
    frame 1 when it ran the code.

  • Accessing children of element created with PopUpManager

    My application has 2 files. First one is main application, second one is custom component (Popup) used to create popup windows. I would like to know how can i access ViewStack element (has id assigned to "vs") in popup from main application.
    NB! Lot of code has been removed for readability!
    application.mxml
    <s:Application creationComplete="init()">
         <fx:Script>
              <![CDATA[
                        public function init():void{
                             var popup:TitleWindow = PopUpManager.createPopUp(this , Popup , false) as TitleWindow;
                             trace(popup.vs , "It's not working!!");
              ]]>
         </fx:Script>
    </s:Application>
    Popup.mxml
    <s:TitleWindow>
         <mx:ViewStack id="vs">
         </mx:ViewStack>
    </s:TitleWindow>

    <s:Application creationComplete="init()">
         <fx:Script>
              <![CDATA[
                        public function init():void{
                             var popup:Popup= PopUpManager.createPopUp(this , Popup , false) as Popup;
                             popup.vs // should get access
              ]]>
         </fx:Script>
    </s:Application>
    Can you please try the above.

  • Customclass accessing children

    Hi there,
    I made a search looking for custom class problems but didn`t find anything about what I`m having trouble with. Witch I thought to be pretty weird. I think I may be doing something stupid.
    I have a customScrollBar_mc in my library which consists of 2 movieclips instanced as mcBar and mcBackGround.
    I exported customScrollBar_mc for actionscript with a custom class attached to it called CustomScrollBar and I UNchecked the export in frame 1 option (I left only the preloader things with that checked).
    Well, I made my CustomScrollBar class but the problem is. If I try something like this in its constructor
    mcBar.height = 10; or
    mcBackGround.width = 10;
    Flash tells me that those instances doesn`t exist.
    How can I make flash recognize them ?
    Here is some structure information:
    Project organization
    /Project
       /bin
       /src
         Main.as
         /sessions
           CustomScrollBar.as
           Session.as this class instances CustomScrollBar
    Export SWC is checked.
    Sourcepaths added are /src and /src/sessions
    Automatically declare stage instances is UNchecked.
    All my files have no PACKAGE especification (if I add "sessions" to the package name it tells me that it doesn`t especify the real location of the files. Don`t know why this happends.)
    Could anyone please help me with this ?
    Thanks in advance,
    Oscar

    Hi there, the topic was on the 4th page so I decided to make some screenshots and explain better this so it would be easier to help me out.
    I don`t have a clue about it and I just crossed a point where I can`t go any further without this.
    I took a photo of my publish settings, library, movieclip properties andproject folder so you can understand what is happening.
    First of all, the problem is related to the topico_mc movieclip (translation: topic_mc)
    topico_mc is composed by:
    movieclip topico_quadrado_mc (translation: square_topic_mc) that is just a small square: mcSquare
    dynamic text: dynText
    I export it to actionscript with class name TopicosFlash and unchecked export in frame 1 (I tested with this checked too). I also tried browsing my symbol in the Source field just as shown in the screenshot.
    I make the TopicosFlash.as file, make it extends movie clip and add a simple code to the constructor: mcSquare.alpha = 1
    In the document class I simply add it: addchild(new TopicosFlash());
    The issue: mcSquare is a undefined property
    Screenshot:
    Trying to solve this I found some things that for me were strange:
    1) If I don`t make the TopicosFlash.as file, the movieclip is added with no problems.
    2) If I make the TopicosFlash.as file but let it empty flash throw an error: Cannot create property dynText on TopicosFlash.
    3) If I make the file, it gives the mcSquare undefined error.
    Sorry for the bad words but wtf is going on?
    I really am not being able to understand this and I can`t find any answers anywhere.
    Thanks in advance,
    Oscar

  • Looping through an objects children

    This post is related to another post I have in the forums:
    "Dynamically adding containers".
    However, I am using an object (note this object can change -
    is dynamic):
    [CODE]
    [Bindable]
    public var dashboardDP:Object =
    {item:"dashboard", children: [
    {item:"vbox", id:"vbox 1", children: [
    {item:"panel", id:"panel 1", children: [
    {item:"hbox", id:"hbox 1", children: [
    {item:"view" id:"view 1"},
    {item:"view" id:"view 2"},
    {item:"view" id:"view 3"}
    {item:"hbox", id:"hbox 2", children: [
    {item:"view" id:"view 4"},
    {item:"panel", id:"panel 2", children: [
    {item:"vbox", id:"vbox 2", children: [
    {item:"view" id:"view 5"},
    {item:"view" id:"view 6"},
    [/CODE]
    And I want to loop through every child in this object but am
    struggling to do so :(
    e.g. the following loop will ony return the first child of
    the object:
    [CODE]
    for(var i:int=0; i<dashboardDP.children.length; i++)
    // some code.....
    [/CODE]
    I want to advance this loop so that it "drills" into and
    retrieves / reads every child and sub child of each parent etc.....
    Is this possible???
    Any help would be much appreciated on this one.
    Thanks in advance,
    Jon.

    Hi "xtempore" thanks for the fast reply!!!
    Just off the top of my head... I am using an Object type for
    "dashboardDP".
    Will this work as in your example to loop through and get all
    the children?
    I notoce you are using a type UIComponent and referencing
    UIComponent.children - will this work?
    I have train but am getting errors... with the line:
    for each (var c: UIComponent in comp.children) {
    when trying to access the ".children"
    Could you please expand?
    Thanks again,
    Kind Regards,
    Jon

  • Scene Graph traversal. Getting all the children of a node recursively

    Hi,
    Requirement: To resize all the controls of a scene (including controls that contain text like label, button) as per the scene size
    Approach: To implement the above requirement (see code snippet below), I added Listeners for width and height properties of a Scene and whenever the scene size changes, I get all the children of the root node of the scene and invoked the setScaleX() and setScaleY() for the children.
    Problem: In my design, labels and buttons are wrapped inside VBox, HBox etc. Method getChildrenUnmodifiable() returns only the first level of children and hence my HBox and VBox are getting scaled as per the scene size but not the children of VBox and HBox. Is there a built-in function to get all the children of a node recursively ? Or what is the best way to resize text as the scene size changes ?
    Scene mainScene = new Scene(borderPane, PERMANENT_WIDTH,
                    PERMANENT_HEIGHT, Color.HONEYDEW);
    rootNode = mainScene.getRoot();
            mainScene.widthProperty().addListener(new ChangeListener() {
                @Override
                public void changed(ObservableValue observable, Object oldValue,
                        Object newValue) {
                    Double widthScalingFactor = ((Double) newValue) / PERMANENT_WIDTH;
                     ObservableList<Node> children = rootNode.getChildrenUnmodifiable();
                    for (Node child : children) {
                        child.setScaleX(widthScalingFactor);
            mainScene.heightProperty().addListener(new ChangeListener() {
                @Override
                public void changed(ObservableValue observable, Object oldValue,
                        Object newValue) {
                    Double heightScalingFactor = ((Double) newValue) / PERMANENT_HEIGHT;
                    ObservableList<Node> children = rootNode.getChildrenUnmodifiable();
                    for (Node child : children) {
                        child.setScaleY(heightScalingFactor);
            });Thanks.

    Added the following code to get all the children recursively. now the scaling is applied to all nodes of a scene.
        private static void getChildren(Parent parentNode) {
            if (parentNode.getChildrenUnmodifiable().size() != 0) {
                ObservableList<Node> tempChildren = parentNode
                        .getChildrenUnmodifiable();
                allChildren.addAll(tempChildren);
                for (Node n : tempChildren)
                    getChildren((Parent) n);
            } else
                allChildren.add(parentNode);
        }

  • TitledPane in a VBox ... TitledPane ignores maxSize

    Hi,
    I want to use a VBox instead of an Accordion, so i can have more TitledPanes expanded than one.
    <?xml version="1.0" encoding="UTF-8"?>
    <?import javafx.scene.layout.*?>
    <?import javafx.scene.control.*?>
    <VBox xmlns:fx="http://javafx.com/fxml">
         <children>
              <TitledPane VBox.vgrow="ALWAYS">
                   <text>Navigation</text>
                   <content>
                        <TreeView showRoot="false" >
                             <root>
                                  <TreeItem value="Documents">
                                       <children>
                                            <TreeItem value="Item1" />
                                       </children>
                                  </TreeItem>
                             </root>
                        </TreeView>
                   </content>
              </TitledPane>
              <TitledPane  VBox.vgrow="ALWAYS">
                   <text>Navigation</text>
                   <content>
                        <TabPane tabClosingPolicy="UNAVAILABLE">
                             <tabs>
                                  <Tab>
                                       <content>
                                            <ListView/>
                                       </content>
                                       <text>tab1</text>
                                  </Tab>
                                  <Tab>
                                       <content>
                                            <ListView/>
                                       </content>
                                       <text>tab2</text>
                                  </Tab>
                             </tabs>
                        </TabPane>
                   </content>
              </TitledPane>
         </children>
    </VBox>The strange thing is, that the TitledPanes wont resize correctly ... Its just working if I remove the VBox.vgrow ... but than the TitledPanes wont resize over a maximum Height, even if I set Double.Max_Value as maxHeight.
    Anyone has a Idea how to manage these TitledPanes in a VBox?

    In before: thanks for the JIRA-Entry, I will watch it! :)
    In build 10 you are not allowed to set maxWidth and prefWidth in the content-node of the TitledPane anymore.
    Like that:
    <VBox fx:id="sidebar" fx:controller="de.ibees.erp.offline.gui.main.SidebarController" xmlns:fx="http://javafx.com/fxml">
         <children>
              <TitledPane fx:id="navigation">
                   <text>Navigation</text>
                   <content prefHeight="1000">
                        <fx:include source="navigation.fxml"/>
                   </content>
              </TitledPane>
         </children>
    </VBox>So the little "fix" above wont work anymore.
    Now it seems like, the TitledPane will resize with the needed space of its content. So my components should try to get as much height as possible.
    So I tryed to set the minHeight property of my TitledPane-content-root-node (what a word ^^) to a high Value like Double.MAX_VALUE.
    <VBox fx:id="sidebar" fx:controller="de.ibees.erp.offline.gui.main.SidebarController" xmlns:fx="http://javafx.com/fxml">
         <children>
              <TitledPane fx:id="navigation">
                   <text>Navigation</text>
                   <content>
                        <StackPane  minHeight="$MAX_DOUBLE">
                             <children>
                                  <fx:include source="navigation.fxml"/>
                             </children>
                        </StackPane>
                   </content>
              </TitledPane>
         </children>
    </VBox>But this will result in a Freeze or a not starting application ... so I tryed a lower value like 2000 and I got the same behavior like with the older "fix".
    And again the scrollbars wont appear ... apparently because of the minHeight-value, since a "normal" TitledPane has build-in scrollbars (as I discovered :) )
    Anyone have some other ideas how to "strech" the content in the height?
    @swpalmer:
    I think its exactly the same problem you have ... currently we just found the shown solutions.
    For a real world application its maybe currently the best solution to use the Accordion and disclaim the use of multiple expanded TitledPanes, because it seems like there is "something going on" with the TitledPanes :).
    Maybe you should also try the build 10, because its seems to use the min- and maxSize-properties.

  • Can I create a dashboard layout on the fly?

    Hi all, I am trying to create a dashboard layout "on-the-fly"
    (dynamically).
    for example: I can create the following layout using MXML
    very easily:
    [CODE]
    <mx:VBox width="100%" height="100%"
    horizontalAlign="center">
    <mx:Canvas id="dashboardCanvas" width="90%"
    height="90%">
    <mx:HBox width="100%" height="100%">
    <mx:Panel title="panel 1" width="50%" height="100%">
    <mx:VBox width="100%" height="100%"
    borderStyle="solid">
    <myDashboarComp borderStyle="solid" />
    <myDashboarComp borderStyle="solid" />
    <myDashboarComp borderStyle="solid" />
    </mx:VBox>
    </mx:Panel>
    <mx:Panel title="panel 2" width="50%" height="100%">
    <mx:HBox width="100%" height="100%">
    <myDashboarComp borderStyle="solid" />
    <myDashboarComp borderStyle="solid" />
    <myDashboarComp borderStyle="solid" />
    </mx:HBox>
    </mx:Panel>
    </mx:HBox>
    </mx:Canvas>
    </mx:VBox>
    [/CODE]
    You can see that I want to build my dashboard up using
    HBox's, VBox's, Panels and the individual custom components
    (myDashboarComp) - keepinng the layout and structure quite simple.
    The above MXML creates a simple Dashboard consisting of the
    canvas (where it all starts - it constructed from -
    "dashboardCanvas"). the canvas has 2 panels within a HBox (so are
    side by side) called "panel 1" and "panel 2". panel 1 contains a
    VBox containing 3 components (displayed vertically) and panel 2
    contains a HBox containing 3 components (displayed horizontally) -
    so very simple.
    However - I want to control this layout externally e.g.
    passing an object or array (some sort of descriptor) to describe
    the layout to my app.
    I then want to loop through this descriptor item and build my
    dashboard using ActionScript rather than MXML to more control and
    flexibility.
    this is the object I have created and have been experimenting
    with in ActionScript:
    [CODE]
    [Bindable]
    public var descriptorObj:Object =
    {item:"dashboard", children: [
    {item:"vbox", id:"vbox1", percentWidth:100,
    percentHeight:100, children:[
    {item:"panel", id:"panel1", percentWidth:50,
    percentHeight:100, children:[
    {item:"vbox", children: [
    {item:"myDashboarComp"},
    {item:"myDashboarComp"},
    {item:"myDashboarComp"}
    {item:"panel", id:"panel2", percentWidth:50,
    percentHeight:100, children:[
    {item:"hbox", children: [
    {item:"myDashboarComp"},
    {item:"myDashboarComp"},
    {item:"myDashboarComp"}
    [/CODE]
    This is as far as I got as I kept hitting hurdles from here.
    Basically - all I want to do is somehow read / loop through
    this object and build my dashboard.
    First of all I was unsure of the best way to loop through the
    object - as I have to do it in order to get the correct layout...
    i.e. the first 3 "myDashboarComp's" are added to the >
    VBox that is added to > "panel1" that is added to the > HBox
    that is added to the > Canvas.
    This is where I ran into my second problem. I managd to loop
    through and read the elements checking there "item" in the object
    and adding them accordingly.... I could loop though and add each
    item to the canvas ok, e.g:
    [CODE]
    private function initApp():void
    for(var i:int=0; i<descriptorObj.children.length; i++)
    var itemType:String = descriptorObj.children
    .item.toString();
    var percentWidth = descriptorObj.children.percentWidth;
    var percentHeight = descriptorObj.children
    .percentHeight;
    addContainer(itemType, percentWidth, percentHeight);
    private function addContainer(conType:String, pWidth:int,
    pHeight:int):void
    if(conType == "panel")
    addPanel(pWidth, pHeight);
    else if(conType == "vbox")
    addVBox(pWidth, pHeight);
    private var newPanel:Panel;
    private function addPanel(pWidth:int, ptHeight:int):void
    newPanel = new Panel();
    newPanel.percentWidth = percentWidth;
    newPanel.percentHeight = percentHeight;
    newPanel.title = "test panel";
    dashboardCanvas.addChild(newPanel);
    [/CODE]
    in the above actionScript the canvas "dashboardCanvas" is
    already set up in the MXML (but is the only MXML container added as
    the rest should be built using the create object "descriptorObj" in
    AS).
    This is my next problem - when I have added a container,
    e.g. a panel the next items e.g. my "myDashboarComp's" should then
    be added to the previously added panel and not to the canvas
    anymore - I need some way of telling the app to add children to the
    last added container and not to the canvas (and each container can
    change type from a panel to VBox to HBox etc....)
    I hope what I am trying to say makes sense, and any help on
    this one would be greatly appreciated.
    I just need pointing in the right direction and some ideas on
    how to continue would be good - and if my thinking / method / ideas
    are actually possible.
    Kind Regards,
    Jon.

    There are several ways to do this. The third chapter in the
    cookbook is a good place to start.
    All things in ActionScript are based on objects. Constructing
    them with the data needed for the ui information you will need and
    then binding that data to your dashboard objects is basically what
    you are going to be doing.
    For me it makes the most sence to have an idea of what
    different types of objects you will be creating and create some
    extended components for those objects. Then when you recieve your
    data, binary or xml, you can digest the configuration settings from
    the layout and populate the constructor for each of your
    components.
    It sounds like you need to organize your layout structure in
    a heirarchy and from that you can walk each branch and create each
    set of things as you parse your data.
    Without a bit more information as to what you are
    specifically doing that is about as far as I can go minus adding in
    some code along some line that I think might work.
    Hope that helps some.
    -D

  • How to implement a go to next node button for an ADF Tree backed by ADF Bin

    Dear all,
    I have been trying for quite some time now, and I do not get it. For my ADF Tree component, I want to implement a series of little iconic buttons that my users can press to Expand and Collapse the current node - those I have got to work, sort of - and Move to the Next or Previous node. My definition of Next Node is: the next node you can see on the screen; this can either be a child, a sibling or an ancestor's sibling.
    + A
    - B
    |- C
    |+ D
    + E
    So from A, next means B, from B next means C, from C it means D and from D it should go to E.
    My main question is: how can I programmatically set the currently selected node in the tree? And I mean not just set the focusRowKey...
    My tree is bound to a ADF Tree Iterator Binding.
    My tree nodes are 'clickable through an action link; this informs a managed bean of the currently selected node, a JUCtrlHierNodeBinding instance.
    <f:facet name="DeptView1Node" >
    <h:panelGroup>
    <af:commandLink text="#{node.Dname}"
    immediate="true"
    action="StartHrmTree"
    >
    <af:setActionListener from="#{HrmTreeTree.tree.rowKey}"
    to="#{HrmTreeTree.focusRowKey}"/>
    <af:setActionListener from="#{node}"
    to="#{HrmTreeTree.selectedNode}"/>
    <af:resetActionListener/>
    </af:commandLink>
    </h:panelGroup>
    </f:facet>
    At that point, in my setSelectedNode method, I can access the Node, its children etc. Methods calls to the tree are less successful; despite their description in the JavaDoc, calls like: getTreeModel().getRowKey() or getContainerRowKey() return null.
    From the Next Node button:
    <af:commandButton immediate="true" actionListener="#{HrmTreeTree.nextNode}" text="&gt;">
    </af:commandButton>
    I invoke the nextNode() method on my bean. When I access the selectedNode that I saved on this bean when the node was clicked on, I no longer can access the children of the node. Even the childIterator property returns null.
    Using the RowSetIterator I can access the current Row, go to the next row in the RSI, access children, so that seems a reasonable approach. However, I do not know how I can make the first child the currently selected node or even how to tell the tree that the child iterator is the current one.
    Using this code:
    // find out if the current Node has a child
    DCBindingContainer container =
    (DCBindingContainer)JsfUtils.getExpressionValue("#{bindings}");
    String iterName = "HrmTreeTreeIterator";
    JUIteratorBinding ib =
    (JUIteratorBinding)container.findIteratorBinding(iterName);
    List ibs =container.getIterBindingList();
    FacesCtrlHierBinding tree = (FacesCtrlHierBinding)container.findCtrlBinding("HrmTreeTree");
    RowSetIterator rsi2 = ib.getRowSetIterator();
    I never seem to be able to get beyond the RowSet iterator of the root level nodes. How can I make a child node's row set iterator the current one? How is it that my selected node object does not know how to access its child-nodes or even its childIterator binding? What refresh operation is required here?
    Any help will be very much appreciated (and credited in the blog article I will write when it all works out).
    Lucas

    Can you try setSelectedRowKeys(RowKeySet newSelectionState) API on the tree? That should change the selection.
    You can do some thing like this to populate the RowKeySet:
    RowKeySet oldSelectionState = null;
    RowKeySet newSelectionState = null;
    oldSelectionState = table.getSelectedRowKeys(); //table is the table component
    newSelectionState = oldSelectionState.clone();
    newSelectionState.clear();
    Object oldRowKey = table.getRowKey(); //Save the orginal rowKey in the variable
    String rowKey = "XXXX" // the key of the row you want to select
    table.setRowKey(rowKey); //set the currency of the table to the row you want to select
    newSelectionState.setContained(true); //add the current row to the selection key set
    table.setRowKey(oldRowKey); //Restore the currency to the old one.
    table.setSelectedRowKeys(newSelectionState); //update the table selection
    ///Now Do some partial update here to change display

  • Xmlclassgen for java feature requests

    1) automatically generate code to populate
    these classes from xml input (preferably using SAX parser)
    2) open up the sources so that folks like
    myself can add functionality like (1) or at
    lease document private and protected functions so that I can derive from these classes.
    3) runtime access to DTD info.
    4) easy way to map between tags and java class names
    5) ability to add a java package to generated code (I see an option for this, but so far
    it hasn't worked at all for me).
    6) programatic access to id->node map (there must be one, since validation claims to check this.)
    7) introduce intermediate node-group classes
    so that methods to access children, and be
    number and type specific.
    8) Xpath navigation tools (query a tree of generated class nodes using Xpath syntax)
    null

    5) ability to add a java package to generated code (I see an option for this,
    but so far it hasn't worked at all for me).
    We already have this functionality. And Here is the example for DTD class Generator:import java.util.Vector;
    Vector m_packageName = new Vector();
    m_packageName.addElement("testpackage");
    // set Java Package Name
    generator.setJavaPackage(m_packageName);
    XML Schema Generator will create package for each namespace, we also support that.null

  • Iterating through a GroupItem selection (actionscript)

    Driving me crazy. Converting some Javascript to Actionscript for an extension. Have a selection. Need to iterate through selection, and then when finding groups, iterate through groups to get geometricbounds.
    in Javascript GroupItem.Pageitems[i] will allow me to access properties of items in the group. Actionscript is a big fat 1009 NULL error. Probably some type error since GroupItem is Object?
    This simple code throws the error. I have two rectangles grouped. That is what is selected.
    var mySelItem:Array = app.activeDocument.selection as Array;
                         if (mySelItem[0] is GroupItem){
                              var myPath:PathItem = mySelItem[0].PageItems[0]
                         myPath.remove()
    Can somebody give me the line of code that will allow me to access children of GroupItem and get properties?

    OK,
    Of course shortly after I post the answer is there.
    This:
    var mySelItem:Array = app.activeDocument.selection as Array;
                         if (mySelItem[0] is GroupItem){
                              var myPath = mySelItem[0].PageItems.index(0)
                         myPath.remove()
    Knew it was easy... just not obvious.

  • Tab Navigator Error

    Found a problem when submitting a textinput field from a
    canvas on a TabNavigator. Problem only occurs when you do not go to
    the tab when viewing on screen before submitting the TextInput.text
    This is the error.
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    If you click on the tab, view the contents of whatever and
    then submit, there is no error. If you do NOT click on the tab,
    then the error occurs. Seems like it does not create the tab until
    you view it. Which would not seem correct. Think of the case of
    entry screens where you have 3 or 4 or more tab sections on the
    screen.
    Thanks.
    Bill Brittain

    Hi Bill,
    > Found a problem when submitting a textinput field from a
    canvas on a
    > TabNavigator. Problem only occurs when you do not go to
    the tab when viewing
    > on screen before submitting the TextInput.text
    >
    > This is the error.
    > TypeError: Error #1009: Cannot access a property or
    method of a null object
    > reference.
    >
    > If you click on the tab, view the contents of whatever
    and then submit, there
    > is no error. If you do NOT click on the tab, then the
    error occurs. Seems
    > like it does not create the tab until you view it. Which
    would not seem
    > correct. Think of the case of entry screens where you
    have 3 or 4 or more tab
    > sections on the screen.
    Try setting creationPolicy="all" on the TabNavigator. By
    default,
    creationPolicy is set to "auto", which means the TabNavigator
    only
    creates the children of the initially visible pane on
    startup--this is
    to make startup faster. In your case, since you need to
    access children
    of the hidden tabs regardless of whether the user visits
    them, you
    should use creationPolicy="all".
    nj
    Flex Builder team

  • Would the CSS style set to a parent node be inherited to underlying nodes?

    Hi,
    Would the CSS style set to a parent node be inherited to underlying nodes?
    With below code, style setting to parent(VBox) is not getting inherited to children(Text).
    Style.java
    package style;
    import javafx.application.Application;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.layout.VBox;
    import javafx.scene.paint.Color;
    import javafx.scene.text.Text;
    import javafx.stage.Stage;
    public class Style extends Application {
        public static void main(String[] args) {
            Application.launch(Style.class, args);
        @Override
        public void start(Stage primaryStage) {
            primaryStage.setTitle("Hello World");
            Group root = new Group();
            Scene scene = new Scene(root, 300, 250, Color.LIGHTGREEN);
            scene.getStylesheets().add("/style/style1.css");
            // Create children
            Text text1 = new Text("Text1");
            Text text2 = new Text("Text2");
            // Create parent and set style
            VBox vBox = new VBox();
            vBox.getChildren().addAll(text1, text2);
            vBox.getStyleClass().add("font-normal");
            root.getChildren().add(vBox);       
            primaryStage.setScene(scene);
            primaryStage.setVisible(true);
    }Style1.css
    .font-normal {
        -fx-font-size: 9pt;
        -fx-font-family: "Arial";
        -fx-fill: #FF0000;
    }Edited by: Simosh on Jun 10, 2011 4:24 PM

    Hello Simosh,
    I know you are thinking of VBox as container so their children must have inherited the css of parent like as of HTML <div> pattern. But in JavaFx this is different every node has it's CSS implemented from the Parent of their extended class . Even if you add children inside VBox CSS has nothing to do with children. So to make children to use the css of VBox then you must call getStyleClass().add() explicitly for every children.
    Either you call getStyleClass() for every node
    or you can make a custom Container as on below
    A sample getChildren() overriding of VBox which make VBox children to use their parent css.
    Algorithm to make your custom VBox
    class MyBox extends VBox{
         @Override public ObservableList<Node> getChildren(){     
              //iterate children of super
                   //now bind your children.styleclass with super.styleclass
              //end of iterate
              //return children
    }Thanks.
    Narayan

Maybe you are looking for

  • Urgent regarding session variable

    Hi Everyone, I have a prompt having fromdate(calendar ctrl) and todate(calendar ctrl) and one orderID(here it is multiselect). Now my requirement is i should select an order ID from the multiselect and when i hit go the date should be prompted for th

  • XL Report conexiones en el servidor

    Hola a todos, tengo una duda, al conectarse los usuarios que tienen activado el XL report, en el servidor se generan 5 conexiones por usurio, esto obvio generar lentitud en el sistema, mi pregunta es, esto es normal ?? y si no es asi, como ouedo opti

  • Similar report as MI20 tcode but with extra field

    Hi Friends, I need to create a report with similar functionality as MI20 and that report should have additional field in the selection screen of the report. Please suggest me is there any way to do that..

  • BB not working

    the apps on my phone are not working, only whatsapp is working. the media card isnt working either. cant disconnect the calls either. have to choose switch application option to exit. tried rebooting a lot of times but emails, messages they just dont

  • HOW do I create a NICE enlarged image in a window EFFECT? CS5

    Maybe a long unnecessary title but I'm not sure how to describe it, and I can't find an example at the moment. Basically, I would like to create little image thumbnails which when clicked on bring up an enlarged version of the thumbnail. Basic I know