Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Composed Types

    Hi all,

    My question is this: can you make a composed type and use it in a datasource so that the value and unit are displayed in one field (listgrid field) and can be modified in that one field as well?

    Some more background/info:

    Our existing application makes use of several composed types (Currency, Duration, Distane, etc.). On database level these are stored as seperate fields, but in code (or on our existing rich client) we always use the composed type.

    Example: Distance consists of a distance (double) and distanceUnit (integer).

    I am stuck on how to do the same with smartClient. I have tried several things like making a simpletype "Duration" (with the above two fields) or even a "Duration" pojo and using the setJavaClass() function on datasourcefield but to no effect.

    If anybody has an example of how he/she implemented a composed type or knows how to solve this problem, I would be very gratefull!

    To make it a bit more interesting we are trying to avoid validators and/or formatters.

    Thanks a lot
    Bart

    #2
    Screenshot

    I added a screenshot... so you can see what I mean
    Attached Files

    Comment


      #3
      I'm doing a very similar thing. My DataSource has a bunch of "internal" fields that are then combined together in a few different columns of a ListGrid.

      There are two ways of doing it:

      1) combine the fields together into a single field on the server sending the result back in a single field within the XML.

      2) using a CellFormatter for the aggregate column within the ListGrid.

      We chose the second option and have been pretty happy with it. Why don't you want to use formatters?

      Comment


        #4
        Hey,

        Thanks for your response! I was working on some other stuff, so hadn't checked the forum in a while.

        We didn't want to use formatters as these are client side.
        In a previous project we noticed that doing a lot of client side formatting impacts performance (specifically string manipulations).

        Anyways, there seems to be no other way around this problem. So we are using formatters as well.

        Regards,
        Bart

        Comment

        Working...
        X