Announcement

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

    ComplexFields

    Hi,

    is there any example on how to use ComplexFields?

    I have a form bound to a datasource. the datasource contains complex objectstypes. those complex types need special editor.

    many thanks!

    #2
    This example shows how to use an adjacent ListGrid to allow editing a list of subobjects (the classic order / order item master-detail screen).

    Comment


      #3
      thx.

      but how do i do this with rpc?

      i declined following in my DataSource:

      Code:
      DataSourceTextField imagesField = new DataSourceTextField("images");
      imagesField.setForeignKey("resourceid");
      imagesField.setTypeAsDataSource(imageds);
      imagesField.setMultiple(true);
      but this does not work.

      Comment


        #4
        Sorry, way too little information - think through the information someone might need in order to help you, and post that.

        Comment


          #5
          sorry, here some more.

          My server returns an object type Item. The Item contains objects type Image. Now I have a Itemdatasource which overrides transformRequest(), where i copy my Item objects to ItemRecords. The Itemdatasource is connected to an editor. Now my question is, what is best practice to include the nested Images. Right now I copy them in my Itemdatasource to Imagerecords, but for that i wouldn't need a new datasource for images. And i would need a field images connected to an Imagedatasource, what you did in that example.

          thx!

          Comment


            #6
            still i do not figuered out, how i can do that with out defining xml.

            Code:
            <field name="items" title= "Order Items" multiple="true"  
             type="masterDetail_orderItemHB"   
              javaClass="com.smartgwt.sample.showcase.server.OrderItem"  
            />
            in that example are to datasources initialized, but just one (dataSource) of them gets useded.

            Code:
            DataSource dataSource = DataSource.get("masterDetail_orderHB");  
            DataSource orderItemDS = DataSource.get("masterDetail_orderItemHB");

            Comment


              #7
              Not really following where you're having trouble. You have two object types and the example has two object types. Define DataSources for each just as shown in the example. Use the DataSources just as shown in the example. That's it. There's no need for transformRequest() or anything else.

              Again, if you need more help, think through what information you might need to provide. You still have not mentioned even what type of DataSource you are using.

              Comment


                #8
                Sorry that i could not make me clear. But neverless, I think I solved it. Thanks for trying to help!

                Comment

                Working...
                X