[ 
http://issues.apache.org/jira/browse/XAP-128?page=comments#action_12454729 ] 
            
Turyn, Michael commented on XAP-128:
------------------------------------

This seems o.k. now; keep it as a bug, but reduce the priority if retesting 
bears me out, because I believe it's essentially fixed.

Maybe there was a problem with dataBinding before; it now seems o.k. for the 
JSON-sourced data; the XML-based data options aren't around yet, but that's not 
working _anywhere_ today.  Retest in full once XML datasourcing works.

Note that since namespaces have changed significantly since this was posted; 
the following is updated, and the URIs are for a xal file in a sibling 
directory to examples/dataBinding (e.g. examples/widgets).




<xal xmlns="http://openxal.org/ui"; xmlns:xal="http://openxal.org/ui";> 

    <documentDataSource
        xmlns="http://openxal.org/core/data";
        id="myDataSource"
        source="../dataBinding/employees.xml"
    />
    <jsonDataSource
        xmlns="http://openxal.org/core/data";
        id="jsonDS"
        path="../dataBinding/Employees_json.js"
        source="employees"/>
    <macro:macro id="insertcombo" xmlns:macro="http://openxal.org/core/macro";>
        <xm:modifications xmlns:xm="http://openxal.org/core/xmodify";>
            <xm:insert-after select="id('boom')">
                <xal:comboBox id="c1" width="200px" >
                    <xal:listBox selectionMode="single">
                        <iterator xmlns="http://www.openxal.org/data"; 
name="anIterator1" dataSource="myDataSource" select="//employee" 
type="ONE_TIME">
                            <xal:listItem text="{*('@lname')}" />
                        </iterator>
                    </xal:listBox>
                </xal:comboBox>
                <xal:comboBox id="c2" width="200px" >
                    <xal:listBox selectionMode="single">
                        <iterator xmlns="http://openxal.org/core/data"; 
name="anIterator2" dataSource="jsonDS" select="array" type="ONE_TIME">
                            <xal:listItem text="{*('lname')}" />
                        </iterator>
                    </xal:listBox>
                </xal:comboBox>
            </xm:insert-after>
        </xm:modifications>
    </macro:macro>
    <xm:modifications xmlns:xm="http://openxal.org/core/xmodify";>
        <xm:append select="/ui">
            <xal:button id="boom" text="button" />
            <xal:button id="btn_3" text="COMBO ITERATE - GO!!!" 
onCommand="macro:insertcombo.execute()" />
        </xm:append>
    </xm:modifications>
</xal>



> Data Binding: binding to text attribute in listBox/listItem does not work
> -------------------------------------------------------------------------
>
>                 Key: XAP-128
>                 URL: http://issues.apache.org/jira/browse/XAP-128
>             Project: XAP
>          Issue Type: Bug
>          Components: Data Binding
>            Reporter: Matt Carbone
>            Priority: Critical
>
> Currently can't bind to the text attribute of a listItem in a listBox using 
> either json or xml. Using Iterator.
> Xal snippet:
> <xal xmlns="http://www.openxal.org/xal"; 
> xmlns:xal="http://www.openxal.org/xal";>
>     <documentDataSource 
>         xmlns="http://www.openxal.org/data"; 
>         id="myDataSource"
>         source="employees.xml"
>     />
>     <jsonDataSource
>         xmlns="http://www.openxal.org/data";
>         id="jsonDS"
>         path="Employees_json.js"
>         source="employees"/>
>     <macro:macro id="insertcombo"  xmlns:macro="http://www.openxal.org/macro";>
>         <xm:modifications xmlns:xm="http://www.openxal.org/xmodify";>
>             <xm:insert-after select="id('boom')">
>                 <xal:comboBox id="c1" width="200px" >
>                     <xal:listBox selectionMode="single">
>                         <iterator xmlns="http://www.openxal.org/data"; 
> name="anIterator1" dataSource="myDataSource" select="//employee" 
> type="ONE_TIME">
>                             <xal:listItem text="{*('@lname')}" />
>                         </iterator>
>                     </xal:listBox>
>                 </xal:comboBox>
>                 <xal:comboBox id="c2" width="200px" >
>                     <xal:listBox selectionMode="single">
>                         <iterator xmlns="http://www.openxal.org/data"; 
> name="anIterator2" dataSource="jsonDS" select="array" type="ONE_TIME">
>                             <xal:listItem text="{*('lname')}" />
>                         </iterator>
>                     </xal:listBox>
>                 </xal:comboBox>
>             </xm:insert-after>
>         </xm:modifications>
>     </macro:macro>
>     <xm:modifications xmlns:xm="http://www.openxal.org/xmodify";>
>         <xm:append select="/xal">
>             <xal:button id="boom" text="button" />
>             <xal:button id="btn_3" text="COMBO ITERATE - GO!!!" 
> onCommand="macro:insertcombo.execute()" /> 
>         </xm:append>
>     </xm:modifications>
> </xal>
> ********************JSON DATA********************
> var employees = {
>       "array":[
>               {"lname":"Doe", "fname":"John", "id":"001"},
>                       {"lname":"Roe", "fname":"Mary", "id":"002"},
>                       {"lname":"Smith", "fname":"Winston", 
> "id":"003.14159265"},
>                       {"lname":"O'Brien", "fname":"Julia", "id":"004"},
>                       {"lname":"Venture", "fname":"Thaddeus", "id":"005"}
>       
>                       
>               ]
> }
> ******************XML DATA**************************
> <employees>
>               <employee  fname="Jeanne" lname="Doe" />
>               <employee fname="Mary" lname="Roe" />
>               <employee fname="Ameesh" lname="Chakravarti" />
>               <employee fname="Arne" lname="Sachnussen"/>
>               <employee fname="Manny" lname="Fein" />
>               <employee fname="Vipul" lname="Periwal" />
>               <employee fname="Xiuxiu" lname="Guo" />
>       
>               <employee fname="Jeanne" lname="Doe" />
> </employees>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to