Bind data to the tree?

Hi all

I have a result of a webservice (as arraycollection collection)

I can only say that it contains the categories that have id, name, parentid

as you can see that the parentid points which, if this category is belong to one id.

-ID - NAME - ParentID

1 - cat1 - 0 < < < < 0 means that it is a main category

2 - cat_sub - 1 < < < < < this category is void cat. of cat1

3 - cat2 - 0

4 - cat2_Sub - 3

5 - cat_sub_sub - 2

so can I link these data to tree in a simple way?
What should I do? I don't want to loop at all and look if it's parent or main and where it belongs in and add to the tree.

Is there an easy way?

All information in the specification

http://livedocs.Adobe.com/Flex/3/langref/MX/controls/tree.html#dataDescriptor

Tags: Flex

Similar Questions

  • Refresh the data from the tree

    Hello

    I have a master form / retail and a tree

    I want 2 display the data entered and stored on the tree at the time wherever he is saved...?

    instead of re - run the form can I do this?


    Kind regards

    abdetu...

    Hello
    If I understand you want to refresh the tree based on the master-details data. If so, then what happens when you try to code in form (KEY of VALIDATION caled) level trigger?

    COMMIT;
    -- Here code for populating the tree...
    

    -Clément

  • How to access the data in the row (text of children) in a pragmatic control tree?

    In LabVIEW 2010, I entered the data in row a tree with pragmatism control using the Add item and providing the child text table and the child tag for the line. When a row in the tree control is selected, I can get the line label in the Value property of the tree. But how do I access the data in the child text table when the line is selected? I can't seem to find a tree control property or method which will return data back.

    What I'm trying to do is: once a line in a tree is selected and a button is pressed, if the line tag is valid, I want to transfer all the data in row in another tree the same formatting. For this I need the data for the tree line and the line that was selected. I don't find a way to get access to these data of the line when it was composed in the tree.

    Can someone tell me how to access pragmatically the child text or row data in a tree control from a selected line in the tree? I have the label of the line, but how do I access data?

    Thank you for your help.

    Looking through numerous examples, I found how to do this using the properties ActiveItemRow and ActiveColNum, but I can't find these documented properties anywhere using LabVIEW. Even research through aid could not do anything about them.

    Where these important parameters are documented?

    Why they do not appear in the help?

    Are there other ways to access the data in the row (child text) form a selected line in a tree control?

  • Casting error trying to access the tree liaison

    JDeveloper version 11.1.2.1.0

    java.util.ArrayList cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierBinding

    Hi all

    I use the ADF Code corner (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/78-man-expanding-trees-treetables-354775.pdf) code to programmatically set the level of disclosure of the tree node when the page is rendered at the beginning. Property DisclosedRowKeys of the tree is #{viewScope.FieldPickerHandler.newDisclosedTreeKeys}. Below is the code for the handler method that is the cause of the problem. First of all, you can see that I commented on the original code of Frank on lines 5, 6 and 8 because for some reason, it did not find the component of the tree (always returned null). To remedy this, I put the tree component binding property to #{viewScope.FieldPickerHandler.jsfTree} so that the instance of the component available in the Manager and it seems to work. However, when typing code line 16 I get the exception of cast of class at the head of this post.

    Significant variation of the example Code corner, is my tree is based on a POJO model that is populated by a VO (as shown by Lucas Jellema http://technology.amis.nl/blog/2116/much-faster-adf-faces-tree-using-a-pojo-as-cache-based-on-read-only-view-object-showing-proper-leaf-nodes-again) program where my node set root, and each child node set, is declared as "nodes list < FieldPickerNode > = new ArrayList < FieldPickerNode > ();".

    Is the way the POJO tree is built that it is incompatible with the method of development of node Code corner? Can anyone suggest how I can change my bean handler code to work with POJO tree?

    Thank you

    Adrian

    PS the property Value of the tree is set on #{viewScope.FieldPickerHandler.treemodel} where treemodel is a property managed bean - I guess that means that my tree is not related to the ADF?

    1 public RowKeySetImpl getNewDisclosedTreeKeys() {}
    2 if (newDisclosedTreeKeys == null) {}
    3 newDisclosedTreeKeys = new RowKeySetImpl();
    4
    5 / / FacesContext fctx = FacesContext.getCurrentInstance ();
    6 / / UIViewRoot root = fctx.getViewRoot ();
    7 //lookup thetree component by its component ID
    8 / / RichTree tree (RichTree) = root.findComponent ('t1');
    9 tree //if is located...
    10 if (jsfTree! = null) {}
    11 //get the model from the collection to access the ADF link layer for
    12 //the binding used tree. Note that for this sample links
    13 //used of the tree is different from the binding used for the tree
    14 //table
    15 model CollectionModel = (CollectionModel) jsfTree.getValue ();
    16 JUCtrlHierBinding treeBinding = (JUCtrlHierBinding) model.getWrappedData ();

    Published by: blackadr on November 3, 2011 17:56

    Hello

    java.util.ArrayList cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierBinding

    JUCtrlHierBinding is the model tree binding in the ADF, while if you are not using the ADF for the binding of the tree, its your tree model implementatuon, which in your case seems to be an ArrayList. If the code of the ADF Code corner is sort of by going through your custom implementation. You must cast to an ArrayList and get the data you want to work with out of this list

    We must look on what is the key of the row of each node. Then give you a clue on how to make the angle of ADF Code work for your example of the sample.

    Frank

    PS. : Blog post from Lucas is kind of old and focuses on 10.1.3

  • Hide the tree nodes

    I searched for a while, but have yet to find a solution to this:

    I want to hide items (associated with each node html help topic) in a tree with xmlListCollection data provider. I found this article:
    http://www.axelscript.com/2008/02/20/using-a-data-manager-and-filtering-data-in-a-Flex-Tre e-same-the-nodes.

    but I don't actually want to exclude data from the tree... just hide it... and access to place content elsewhere.

    I tried to play with the updateDisplayList function in my custom treeItemRenderer, but I can't completely hide the presence of the list item

    Thanks for any help!

    Custom data descriptor:
    http://livedocs.Adobe.com/Flex/3/HTML/Help.HTML?content=about_dataproviders_6.html

  • Of the data in the table to get a tree using declarative and perform operations above.

    Hello

    I use Jdeveloper 11.1.2.4.

    I'm creating a declarative component. The component is supposed to display the data in a table and allow the user to remove entries of it.

    The table should be included in a pop-.

    From now on, I made a picture of the tree within a collection of panels. I'm creating a tree in the pagedefinition of the ViewController project file and passing the tree of the same model to the component attribute declarative. After binds the attribute passed to table component tree declarative, I am able to fill lines. First please let me know if my approach is correct or not. The user can select any row of the table and press delete. The button must remove the entry from the table. Is it possible to remove operation on the table in the declarative component.

    Thank you

    First of all, please let me know if my approach is correct or not.

    Seems ok

    The user can select any row of the table and press delete. The button must remove the entry from the table. Is it possible to remove operation on the table in the declarative component.

    You have several ways to do this:

    (a) similar to the declarative component attribute, you can bind methods, for example: ADF Essentials eCourse - declarative components ADF: work with methods

    (b) pass the name of the iterator to your component and then use it to remove programmatic in backing bean

    (c) create pageDef declarative component for, something similar to this: ADF practice: liaison for component container declarative

    Dario

  • Convert data in hierarchal of hierarchical data for the creation of the tree

    Hi guys,.

    I tried to figure this out for about two days together now and I'm still stuck and I see no possible solution that does not involve a new creation of the table.
    I want to create a tree to navigate through projects and tasks, I use the demo "Task Manager" app, which I customized it a bit to fit my needs.

    Basically, I can't create the tree because the relationship between projects and tasks is not a hierarchical relationship, it's a relationship 1: n like this:

    __Projects__
    ID (PK)
    PROJECT NAME



    ___Tasks___
    ID (PK)
    Project (done FK reference Projects.ID)


    So what I have to do is to "force" this relationship 1: n with a hierarchical relationship by creating a query (view) that links the two tables into one and have 2 columns, I can use as ID and PARENT_ID for the creation of the tree.

    This is the data model:


    CREATE TABLE 'EBA_TASK_PROJECTS '.
    (NUMBER OF 'ID',
    'PROJECT_NAME' VARCHAR2 (255),
    "CREATED_ON" DATE NOT NULL ACTIVATE.
    'CREATED_BY' VARCHAR2 (255) NULL NOT ACTIVATE.
    DATE OF THE "UPDATED_ON"
    "UPDATED_BY' VARCHAR2 (255),
    'FLEX_01' VARCHAR2 (4000).
    'FLEX_02' VARCHAR2 (4000).
    'FLEX_03' VARCHAR2 (4000).
    'FLEX_04' VARCHAR2 (4000).
    'FLEX_05' VARCHAR2 (4000).
    NUMBER OF "PARENT_ID"
    VARCHAR2 (1) 'IS_ACTIVE ',.
    VARCHAR2 (4000) "DESCRIPTION."
    CONSTRAINT CHECK of 'EBA_TASK_PROJECTS_ACTIVE_CC' (in is_active ('Y', 'n')) ENABLE,.
    ENABLE 'EBA_TASK_PROJECTS_PK' CONSTRAINT PRIMARY KEY ('ID')
    ) ; ALTER TABLE 'EBA_TASK_PROJECTS' ADD 'EBA_TASK_PROJECTS_FK' OF CONSTRAINT FOREIGN KEY ('PARENT_ID')
    REFERENCES 'EBA_TASK_PROJECTS' ('ID') ON DELETE CASCADE ACTIVE;


    CREATE TABLE 'EBA_TASK_TASKS '.
    (SELECT 'ID' NUMBER NOT NULL,)
    ACTIVATE THE "PROJECT" NUMBER NOT NULL,
    ACTIVATE THE "TASK_PRIORITY" VARCHAR2 (400) NOT NULL,
    ACTIVATE THE "TASK_DIFFICULTY" VARCHAR2 (400) NOT NULL,
    ACTIVATE THE "TASKNAME" VARCHAR2 (4000) NOT NULL,
    VARCHAR2 (4000) "TASK_DETAILS."
    "CREATED_ON" DATE NOT NULL ACTIVATE.
    DATE 'DONE ',.
    ACTIVATE THE 'CREATED_BY' VARCHAR2 (400) NOT NULL,
    'STATUS' VARCHAR2 (4000).
    DATE OF THE "UPDATED_ON"
    "ON THE ROAD" DATE.
    NUMBER OF "TASK_PREDEFINED_ID."
    "UPDATED_BY' VARCHAR2 (255),
    ACTIVATE THE "USER_NAME" VARCHAR2 (255) NOT NULL,
    'FLEX_01' VARCHAR2 (4000).
    'FLEX_02' VARCHAR2 (4000).
    'FLEX_03' VARCHAR2 (4000).
    'FLEX_04' VARCHAR2 (4000).
    'FLEX_05' VARCHAR2 (4000).
    NUMBER OF "PERCENTAGE."
    ENABLE 'EBA_TASK_TASKS_PK' CONSTRAINT PRIMARY KEY ('ID')
    ) ; ALTER TABLE 'EBA_TASK_TASKS' ADD 'EBA_TASK_TASKS_PROJECTS_FK' OF CONSTRAINT FOREIGN KEY ('PROJECT')
    REFERENCES 'EBA_TASK_PROJECTS' ('ID') ON DELETE CASCADE ACTIVE;

    I use APEX4.0

    It's good enough that this guy, hope you can help me with this. I'm really stuck on this and I'm about to give up.

    Hello

    So what I have to do is to "force" this relationship 1: n with a hierarchical relationship by creating a query (view) that links the two tables into one and have 2 columns, I can use as ID and PARENT_ID for the creation of the tree.

    I'd say you need a UNION rather than a JOIN.
    Something like:

    WITH project_task_view AS (
     SELECT 'P'||to_char(id) as id
          , null as parent_id
          , project_name as node_name
     FROM eba_task_projects
     UNION ALL
     SELECT 'T'||to_char(id)
          , 'P'||to_char(project_id)
          , task_name
     FROM eba_task_tasks
    )
    SELECT id, parent_id, node_name, level
    FROM project_task_view
    START WITH parent_id IS NULL
    CONNECT BY PRIOR id = parent_id
    ;
    
  • How to use record group to insert data into the hierarchy tree?

    Hello

    I had a hierarchical tree in my block and I want to use the record group to display
    in the hierarchy tree, call david_tree. He did work for the code I try below
    and I think it might be that the create_group_form_query was wrong? or miss an order?


    DECLARE
    htree;
    rg_data RECORDGROUP;
    v_ignore NUMBER;
    BEGIN
    htree: = Find_Item ('tree_block.david_tree');

    rg_data: = CREATE_GROUP_FROM_QUERY ('rg_bank',
    "select name, short_name".
    || "from css_banks");

    -Fill the record with data.

    v_ignore: = POPULATE_GROUP (rg_data);

    -Transfer the data from the record group to the hierarchical
    -tree and bring it to display.

    FTREE. SET_TREE_PROPERTY (htree, FTREE. (RECORD_GROUP, rg_data);

    END;


    Thank you


    David

    David,
    You get an error with your code? Looks like you took your example code help Forms. I don't really see a problem with the code, but the forms example gives an example of how create the record group used by the HTree so the Receiver General may be the cause of the problem. When I used the HTree, I used the FTREE. Procedure ADD_TREE_DATA to fill the tree. When I started working with HTree I created a wrapper package to simplify the process. You can watch how I work with the HTree in a demo that I published called: forms and how to: create a shape of the HIERARCHICAL tree.

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

  • How to display tree view in data in the grid?

    Friends hi.,.

    I use the tree control to get the data from database dynamically.

    Now I use selected (node or folder) will be grid view in the tree structure with the help of Panel.   an example of coding...?

    Someone help me...

    Regarding.,.

    Lingu..,.

    I've posted some examples of arborescent structures in a Datagrid in a subject a little below it

    http://forums.Adobe.com/thread/569070?TSTART=0

  • the problem display of hierarchical data on table tree of ADF 11 g

    We try to display hierarchical data tree ADF tabletop.
    our table a (id, parant_id, name) columns and an open relationship between id and id columns adorning it.
    We create module OT, vo and app. Jdev automatically creates connection object and Association.
    In the editor view, drag us and drop our table as a tree of ADF table.
    In table tree aditor rool we add a rool Association name.
    When we launch the application data display incorrectley. For example if the data as

    1 aaa 0
    2 1 BBB
    3 ccc 2
    4 2 ddd

    We want to display the structure of the tree as

    1
    -> 2
    -> 3
    -> 4

    but it shows the possibilities of something like (lines "BOLD" incorrectly) added.


    1
    -> 2
    -> 3
    -> 4
    * 2 *
    -> 3
    -> 4
    * 3 *
    * 4 *


    (We have 10g. But in the table tree 11g have a different configuration. )

    Thank you...

    I think that if you want to limit the list of records shown at the first level of the tree to those without a father - you'll need create a VO that this query - and then add a viewlink to the full list.
    For example by using the employees table in the HR schema, which would be something like a VO with 'where manager_id is null' for the first level, as well as a link from there to the VO used to get other levels.

  • Hierarchical data in the component of the tree should not be visible

    JDeveloper version - 11.1.1.7.0

    Default in the ADF, the performance of a page with a tree component, existing hierarchies are displayed as trees.


    For my requirement the TRIE hierarchies will not be displayed and component of the tree must be empty when the page runs.

    Why not just use the executeEmptyRowSet(), as described here:

    http://www.jobinesh.com/2010/05/displaying-empty-table.html

  • Filtering problem date to the table QBE filter when it is supported by the POJO data control

    @Timo Hahn ADFfan 11.1.1.4 or 11.1.1.7

    I have exactly the same problem as described in the discussion archived here unanswered

    Definiton vc_temp_1 not found error for the filter of the columns date

    I used the sample downloaded 37 here as a model

    037. how to build the pagination in the POJO ADF data control

    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/index-101235.html

    It is easy to replicate, just to run this sample and try to filter on the date of hire.  It takes about 2 minutes to download and run.

    sample image 37 running on 11.1.1.7

    Here is the stacktrace.   Don't know why it's using java.sql.Timestamp.   My POJO returns a java.lang.Date

    java.lang.IllegalArgumentException: timestamp format must be yyyy-mm-dd hh: mm: [.fffffffff]

    at java.sql.Timestamp.valueOf(Timestamp.java:194)

    to oracle.jbo.common.JboTypeMapEntries$ 3.convert(JboTypeMapEntries.java:149)

    at oracle.jbo.domain.TypeFactory.get(TypeFactory.java:855)

    at oracle.jbo.domain.TypeFactory.getInstance(TypeFactory.java:102)

    at oracle.jbo.common.JboTypeMapEntries.convertValue(JboTypeMapEntries.java:382)

    at oracle.jbo.common.OracleTypeMapEntries.convertValue(OracleTypeMapEntries.java:162)

    at oracle.jbo.common.JboTypeMap.convertValue(JboTypeMap.java:869)

    at oracle.jbo.domain.TypeConvMapEntry.convert(TypeConvMapEntry.java:120)

    at oracle.jbo.domain.TypeFactory.get(TypeFactory.java:855)

    at oracle.jbo.domain.TypeFactory.getInstance(TypeFactory.java:102)

    at oracle.jbo.RowComparator.compareEquals(RowComparator.java:34)

    at oracle.jbo.RowValueSupplier.compareValues(RowValueSupplier.java:253)

    at oracle.jbo.expr.JIParserNode.evaluate(JIParserNode.java:1274)

    at oracle.jbo.ExprEval.doEvaluate(ExprEval.java:1099)

    at oracle.jbo.ExprEval.evaluateForRow(ExprEval.java:911)

    at oracle.jbo.RowMatch.rowQualifies(RowMatch.java:187)

    at oracle.jbo.server.ViewObjectImpl.rowQualifies(ViewObjectImpl.java:2811)

    at oracle.jbo.server.QueryCollection.rowQualifies(QueryCollection.java:3705)

    at oracle.jbo.server.QueryCollection.populateRow(QueryCollection.java:3590)

    at oracle.jbo.server.QueryCollection.fetch(QueryCollection.java:3387)

    at oracle.jbo.server.QueryCollection.sortRows(QueryCollection.java:994)

    at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1184)

    at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:1338)

    at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:1256)

    at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:1250)

    at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:6809)

    at oracle.adf.model.bean.DCBeanDataControl.executeIteratorBinding(DCBeanDataControl.java:948)

    at oracle.adf.model.binding.DCIteratorBinding.doExecuteQuery(DCIteratorBinding.java:2177)

    at oracle.jbo.uicli.binding.MyIteratorBinding.executeQuery(JUAccessorIteratorDef.java:721)

    at oracle.jbo.uicli.binding.JUSearchBindingCustomizer.applyAndExecuteViewCriteria(JUSearchBindingCustomizer.java:607)

    at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding.processQuery(FacesCtrlSearchBinding.java:442)

    application example will reproduce the problem with no changes

    Post edited by: Don Kleppinger confirmed it happens on 11.1.1.7 as well (see image)

    Frank Nimphius-Oracle

    I have a work around for this bug to Oracle.  I have a version in 037 sample that actually works and that will sort the field date.  I'm ready to download a copy to replace the download version that is there if Oracle is listening.  The sample was there 5 years ago so it is regrettable that this bug still exists.

    That's what I did

    create beans with custom queryListener

    On the table

    change

    queryListener = "#{bindings.allEmployeesQuery.processQuery} '"

    TO

    queryListener = "#{queryListenerBean.processQuery} '"

    Add an additional field to the line which is a long value of the Date column.   In the queryListener I change the input filter on the value of long type instead of the date value.

    I do not display the column containing the value of long (time) in the table, but she must appear in the binding of the tree. (shuttles to the right)

    In the listener query

    • Read the filter value Date and read the value of time full, clear the value of the filter date
    • long time set in the filter
    • Run the query by call of the listener of the original request #{bindings.allEmployeesQuery.processQuery}
    • Set the date value to the value entered by the user
    • erase the value of long type

    Here is the code

    {} private void processQuery (QueryEvent queryEvent)

    Table richeTableau = (RichTable) queryEvent.getComponent ();

    FilterableQueryDescriptor filterQD = (FilterableQueryDescriptor) table.getFilterModel ();

    Card filterCriteria = filterQD.getFilterCriteria ();

    Date dt = (Date) filterCriteria.get ("hireDate");

    time of to of subject Date and filter on hireDateLong instead of column hireDate column

    containing the value of long type of date instead of the Date

    If (dt! = null) {}

    TM long = dt.getTime ();

    filterCriteria.put ("hireDateLong", tm);

    filterCriteria.put ("hireDate", null); This must be null or will not work

    }

    DCBindingContainer bc = (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();

    Object execBinding = bc.findExecutableBinding ("allEmployeesQuery");

    does not perform a cast of the class internal oracle but another technique guided under

    does not work with POJO data control

    run the filter

    (ExecBinding) .processQuery (queryEvent) (FacesCtrlSearchBinding);

    This will fail

    invokeQueryEventMethodExpression ("#{bindings.allEmployeeesQuery.processQuery}",)

    restore the value of the filter if he continues to display in the QBE bar

    filterCriteria.put ("hireDate", dt);

    filterCriteria.put ("hireDateLong", null);

    }

  • How can I migrate my old synchronization data to the new system when I signed in devices

    I just reformat the hard drive of my computer and reinstalled Windows and Linux. Now that I have installed and updated, Firefox wonder to migrate to the new synchronization system they have. Problem is, I still want to be able to connect to the old system just to be able to get my favorites so I can migrate to the new system.

    I always sync my key and the connection information for the old system, but I just want to know how to access it once for the information available to me. I can handle everything from there.

    Hello, in this case you'd probably have to use a workaround and download the previous firefox version, disable the automatic update for the moment (in options > advanced > update), bind it to the old account synchronization and upgrade after you successfully restore your data in this way...

    Install an older version of Firefox

  • Adding items to the tree in an effective way

    Hello

    I am trying to add items in the tree.

    The problem I am facing is, I have to update the tree constantly and add elments.

    To add first items bit it takes less time, but as the tree grows the accumlated gets.

    Demo Vi is attached for reference.

    Any HELP WILL BE GREATFUL. (vi ATTACHED IS in 2009 version)

    First of all, 1% for calibration of time Windows is 'no difference '.

    But indeed, the update of the front panel is not the factor limiting here: this is the number of children-entries that create problems. So with zero children (as I did in my first test), to postpone the updates done grant you a huge performance increase as is the one and only overhead.

    In your case (100 children), defer updates is disabled the relevance as the method 'Add items' takes awhile.

    I agree that the performance impact is huge, maybe too big, to increase the number of children. But on the other hand, you must understand that you are dealing with arrays of cluster... is in fact a big effort for the memory manager to allocate enough memory, copy of things around and (internally) the deallocation of memory. It's the more data, the most important, this will create. Therefore, it will get slower the more data that you add. But certainly, the measure is surprisingly high.

    But nothing you can change.

    To the last comment: why do you need a tree that changes many times during execution while maintaining several 100ths of elements in any combination of parent/child?

    Norbert

  • Configuration of the tree control

    OK, so I'm unable to set up a tree control the way I want to...

    I have a 2D channels table that looks something like this [1, 1, 1, 2, 2] row 0

    [a, a, c, d and e] 1st row

    [x, y, y, x, x] rank 2

    For each unique element in row 0, a parent tag must be created and an item added to the tree of the same name as the parent tag.

    For every single element in the row 1, a child must be added to its parent

    For each unique element in row 2, add a grandchild to his parents and grandparents.

    If the matrix 2D above tree should look like in...

    -1

    -one

    x

    y

    -c

    y

    -2

    d

    x

    EI

    x

    I have attached my work to date...

    As I was mountain BIKING in the train a simple useful optimization appeared to me, saving a lot of redundant comparisons: use the iterator from the most to the loop as long as the start of the next loop index.  In addition, loop if the array is empty (you would think that it's automatic, but it turns out that an autoindexed for loop with an entry in a table of 4 x 0 will be still go 4 times, at least with the highlight performance enabled).  Here is an excerpt showing the change, which was not tested, but I think it's good:

Maybe you are looking for