Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Table and TreeTable

User
Sergey
2008-10-09
2013-04-26
  • Sergey
    Sergey
    2008-10-09

    Hello all, im begginer in XUI.
    If anyone have samples, write here about:

    Table - how made editing table.
    Which modes of the editing can be.

    How made treeTable.

     
    • Luan O'Carroll
      Luan O'Carroll
      2008-10-10

      Don't you mean new to Aria?

      Do you mean you want something like a spreadsheet? If so yor best bet is to add a third party components. If you want minimal editing you can use the table component built into Aria.

      There is an example of the tree component in both the MetroBank client and also the AriaComponents demo, both of which you can access in the SVN repository at http://aria.svn.sourceforge.net/viewvc/aria/trunk/samples/demos/

       
    • Sergey
      Sergey
      2008-10-10

      How made edit table.

      Necessary to do following:
      At click on cell, show xedit for edit data.
      Write here xui-code.

      Possible something thereof --->

      transTable.setCellEditor(...What write here...)
      transTable.getCellEditor(transTable.getEditingRow(),transTable.getEditingColumn()).stopCellEditing();

       
      • Luan O'Carroll
        Luan O'Carroll
        2008-10-10

        See also Aria's Table component's methods setEditable and getCellEditor (a callback method).

         
    • Sergey
      Sergey
      2008-10-13

      If Aria - it is AriaUserGuide-Draft20080705.pdf, there no examples with edit table

       
      • Luan O'Carroll
        Luan O'Carroll
        2008-10-13

        From the Metrobank swing client  example.

        First a page fragment

        <ScrollPane title="Services" opaque="true" drawBorder="0">
                  <Panel layout="border">
                    <Tree name="serviceTree" drawBorder="0" constraint="center" dragEnabled="false"
                        customToolTip="org.formaria.metrobank.swing.AccountTreeTooltip"
                        renderer="org.formaria.metrobank.swing.AccountTreeCellRenderer"/>
                  </Panel>
                </ScrollPane>

        and the data binding...

                <Bind target="serviceTree" source="services" outputModelPath="true"/>    

        and the static data that it uses...

        <data>
          <data id="info" value="Information" page="infoPage">
            <data id="contact" value="Contacts">
              <data id="0" value="Branch Locator" page="branchLocator"/>
              <data id="1" value="Contact Details" page="contactDetails"/>     
              <data id="2" value="Support" page="supportContacts"/>     
            </data>
            <data id="rates" value="Rates" page="infoPage">
              <data id="0" value="Charges and Fees" page="charges"/>
              <data id="1" value="Exchange Rates" page="forexRates"/>     
              <data id="2" value="Interest Rates" page="interestRates"/>     
            </data>
            <data id="profiles" value="User Profile" page="userProfile"/>     
          </data>
          <data id="services" value="Services" page="infoPage">
            <data id="accounts" value="Accounts" page="infoPage">
              <data id="0" value="Balances" page="accountSummary"/>
              <data id="1" value="Transactions" page="transactionDetails"/>     
              <data id="2" value="Standing Orders" page="standingOrdes"/>     
              <data id="3" value="Direct Debits" page="directDebits"/>     
              <data id="4" value="Foreign Exchange"  page="forex"/>
              <data id="5" value="Account Details" page="accountDetails"/>     
            </data>
            <data id="transfers" value="Transfers" page="infoPage">
              <data id="0" value="Transfers" page="accountTransfer"/>     
              <data id="1" value="Standing Orders" page="standingOrders"/>
              <data id="2" value="Direct Debits" page="directDebits"/>     
              <data id="3" value="Domestic Payment" page="domesticPayment"/>
              <data id="4" value="International Payment" page="intlPayment"/>     
            </data>
            <data id="investment" value="Investment" page="infoPage">
              <data id="0" value="Deposits" page="deposits"/>     
              <data id="1" value="Share Dealing" page="shares"/>     
              <data id="2" value="Investment Funds" page="funds"/>     
            </data>
            <data id="finance" value="Finance" page="infoPage">
              <data id="0" value="Mortgages" page="mortgages"/>     
              <data id="1" value="Car Loans" page="carLoans"/>     
              <data id="2" value="Overdrafts" page="overdrafts"/>     
              <data id="3" value="Invoice Discounting" page="invoiceDiscounting"/>     
            </data>
            <data id="insurance" value="Insurance" page="insurance/infoPage">
              <data id="0" value="Car Insurance" page="insurance/car"/>     
              <data id="1" value="Light Commercial Vehicle insurance" page="insurance/lightCommercial"/>     
              <data id="2" value="Health Insurance" page="insurance/health"/>     
              <data id="3" value="Life Assurance" page="insurance/life"/>     
              <data id="4" value="Key Man Insurance" page="insurance/keyMan"/>     
              <data id="5" value="Building Insurance" page="insurance/building"/>     
            </data>
          </data>
        </data>

        however the static data is onlt there as a temporary filler. I wouldn't recommend using static data extensively even if your application is readonly. A database would be far more useful. Have you tried HSQLDB or similar?

         
    • Sergey
      Sergey
      2008-10-13

      If you not it is difficult PLEASE, write code here, or give link where all about this written

       
    • Sergey
      Sergey
      2008-10-14

      how look structure data for TreeTable?

       
      • Luan O'Carroll
        Luan O'Carroll
        2008-10-14

        The structure for a tree table is the same as for any other table. The tree assumes that the left most columns are sorted. If matching items are found in the leftmost column then the next column is checked and the record is made a child of the left hand value and so on till the values do not match.

        There is also an example of tree table usage in the AriaComponents demo app in SVN.

         
    • Sergey
      Sergey
      2008-10-15

      in XuiCoreSwing.jar (net.xoetrope.swing) no class-file XTreeTable, and error speak about than:

      Wed Oct 15 10:41:00 GMT+04:00 2008 WARNING: Could not instantiate type: TreeTable
      java.lang.ClassNotFoundException: net.xoetrope.swing.XTreeTable
              at java.net.URLClassLoader$1.run(Unknown Source)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(Unknown Source)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at java.lang.ClassLoader.loadClassInternal(Unknown Source)
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Unknown Source)
              at net.xoetrope.xui.XComponentFactory.addComponent(XComponentFactory.jav
      a:462)
              at net.xoetrope.xui.style.XStyleFactory.addComponent(XStyleFactory.java:
      71)
              at net.xoetrope.builder.XuiBuilder.addComponent(XuiBuilder.java:1142)
              at net.xoetrope.builder.XuiBuilder.addComponents(XuiBuilder.java:756)
              at net.xoetrope.builder.XuiBuilder.addComponent(XuiBuilder.java:1208)
              at net.xoetrope.builder.XuiBuilder.addComponents(XuiBuilder.java:756)
              at net.xoetrope.builder.XuiBuilder.addComponent(XuiBuilder.java:1208)
              at net.xoetrope.builder.XuiBuilder.addComponents(XuiBuilder.java:756)
              at net.xoetrope.builder.XuiBuilder.readPage(XuiBuilder.java:431)
              at net.xoetrope.builder.XuiBuilder.loadPage(XuiBuilder.java:230)
              at org.comsoft.xui.HttpXuiBuilder.loadPage(HttpXuiBuilder.java:75)
              at net.xoetrope.xui.XPageManager.doLoadPage(XPageManager.java:203)
              at net.xoetrope.xui.XPageManager.loadPage(XPageManager.java:141)
              at net.xoetrope.builder.XuiBuilder.loadFrames(XuiBuilder.java:332)
              at net.xoetrope.xui.XPageManager.loadFrames(XPageManager.java:340)
              at net.xoetrope.xui.XPageManager.setPageDisplay(XPageManager.java:130)
              at net.xoetrope.xui.XApplicationContext.setHome(XApplicationContext.java
      :658)

      Where possible download fresh jar-file, write link.
      And about structure treeTable, in (AriaComponents demo app in SVN) , i see this example, there binding data to table

      <Bind target="resultsTable" source="COMPONENT_ATTRIBUTES" output="tables/COMPONENT_ATTRIBUTES" />

      but where come themselves data I have not understand, COMPONENT_ATTRIBUTES it is way in XModel, so how i can see structure data.

       
      • Luan O'Carroll
        Luan O'Carroll
        2008-10-15

        the data is mapped in via the DataSource file pointed to by startup.properties, i.e.

        ModelData=cc_datasources.xml

        The data source it turn points to cc_tables.xml which loads the data from a hsqldb (ccdb), which is automatically loaded based on the connection properties listed in the cc_tables.xml file.

        The treetable component is in a commercial library which you probably won't have access to. In Aria the equivalent component is included for free. There is a conversion utility in the downloads on SF. If you have any problems converting please let me know.

         
    • Sergey
      Sergey
      2008-10-15

      on SF - where is it?

       
    • Sergey
      Sergey
      2008-10-15

      What exactly there download?

       
    • Sergey
      Sergey
      2008-10-20

      Please write here how made editTable, I has understood how its work in swing, but can't do in XUI.