Announcement Announcement Module
Collapse
No announcement yet.
Table framework Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Table framework

    Hello,
    I try set table framework using spring rcp.Result is screenshoot :
    http://www.snpe.co.yu/table.png
    Table in views Orders.table don't use java code - it is complete configured with spring xml like this :

    model for bean (use hibernate) :

    <bean name="finNkModel" lazy-init="true"
    class="org.springframework.richclient.snpepetclini c.model.ListDbDataModel">
    <property name="sessionFactory">
    <ref local="sessionFactory" />
    </property>
    <property name="persistentClass">
    <value>org.springframework.richclient.model.hibern ate.FinNk</value>
    </property>
    </bean>

    We have to change property 'persistentClass' for another model and define hibernate config ana POJO
    with for instance middlegen.
    Model is true lazy - it load only 100 rows in memory and it can be changed in model - my example database have > 3000 rows

    Then, I set dbView :
    <bean id="finNkTableView"
    class="org.springframework.richclient.samples.snpe petclinic.ui.DbTableView">
    <property name="beanClazz">
    <value>org.springframework.richclient.model.hibern ate.FinNk</value>
    </property>
    <property name="dbModel">
    <ref bean="finNkModel"/>
    </property>
    <property name="dbColumnNames">
    <list>
    <value>id</value>
    <value>dat</value>
    <value>rj</value>
    <value>orgRj.ime</value>
    <value>zap</value>
    <value>orgZap.ime</value>
    <value>vn</value>
    <value>finVn.ime</value>
    <value>zak</value>
    <value>ok</value>
    </list>
    </property>
    <property name="dbColumnClasses">
    <list>
    <value>java.lang.Long</value>
    <value>java.util.Date</value>
    <value>java.lang.String</value>
    <value>java.lang.String</value>
    <value>java.lang.String</value>
    <value>java.lang.String</value>
    <value>java.lang.String</value>
    <value>java.lang.String</value>
    <value>java.lang.Boolean</value>
    <value>java.lang.Boolean</value>
    </list>
    </property>
    </bean>

    I must change BeanTableModel - add default constructor like :

    public BeanTableModel () {
    super();
    }

    because, I use nested class in DbModelView and it don't work without default constructors

    After this I confgi viewDescriptor like :

    <bean id="finNkTableViewDescriptor"
    class="org.springframework.richclient.snpepetclini c.core.DbTableViewDescriptor">
    <property name="dbTableView">
    <ref bean="finNkTableView"/>
    </property>
    <property name="tabWindow">
    <value>info</value>
    </property>
    </bean>

    I have table without java code - only spring config (view Orders need java code - FormBuilder)

    I plan next :
    - search in view orders get rows in view table.orders - search work for every property and
    can be as you type or with for instance ctrl space
    - when user click to label A in Orders view it sort rows in table view for proerty A - second click work ascend
    when user click to property B sort is for A,B - I have special toolbar icon for clear order rule
    - click to row in table get row in Orders view
    - row can be deleted in table with popup menu
    etc

    Problem :
    1)I must change BeanTableModel - add default constructor like :

    public BeanTableModel () {
    super();
    }

    2) BeanTableModel don't use JCheckBox for Boolean property

    3) Can we register cell renderer for any class (for instance Boolean,Date,Number etc)

    Please comments

    You can see my code on http://www.snpe.co.yu/spring-table.tar.bz2

    regards
    Haris Peco

  • #2
    Hi snpe,

    Is this the latest code drop? Many of the things you've described here in the forums sound exactly like what I'm about to build, so I'd love to see your code.

    Thanks.
    Larry.

    Comment


    • #3
      Larry,
      It isn't, but develompent spring-rcp is slow and I don't send new code
      I use eclipse rcp now and binding and validation from spring rcp only - I send demo soon

      regards

      Comment

      Working...
      X