Announcement

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

    Crucial Evaluation dilemma

    Hi,

    I've tried everything I could

    Not sure how to proceed.

    have a recursive table with special fields cat_id, cat_father_id, cat_name

    On a form

    I have several comboBoxes that load different values

    first combo does a custom where clause where cat_father_id = 10;
    setoptiondatasource(jobsDS)

    second combo does a custom where clause where cat_father_id = 20;
    setoptiondatasource(employeesDS)

    main form is assign a job to a person with some other extra fields

    db model is this

    table jobs_assigned
    ob_id
    job_date_add
    job_date_mod
    job_detaiils


    table jobs_join_cat
    job_id
    cat_id
    cat_order


    talbe categories
    cat_id
    cat_father_id
    cat_name


    I've even created a view, won't insert when using subqueries, mysql issue

    Can't find a sample how to perform save in different tables

    I have a single form and a single datasource.

    Please help me or I will have to find another tool, I am sure Java / JPA and BlazeDS will work, but will make me insane having to code pojos and dto''s here and there.

    Cheers,

    EJ
    Last edited by joppert; 25 Jan 2011, 07:34.

    #2
    Ok I was able to reproduce the calls using operationBindings

    But when saving, related tables aren't being updated.

    I get an error if I use the same binding for the add operationtype.

    Please, I am lost here

    Cheers,

    EJ

    Comment


      #3
      Anyone?

      I need to insert into a master table

      and into a joined table, please someone, you will get good karma for helping me!

      Cheers,

      EJ

      Comment


        #4
        Please see the QuickStart Guide, Server Framework chapter, sections on DMI for how to do operations on related DataSources.

        If you know how to do this with JPA, then you know how do do this with SmartGWT.

        Comment


          #5
          I am trying to avoid the usage of dmi methods.

          Perhaps If I define a datasource for the join table and map their foreign keys it would work automatically?

          I just need to add data into the master and join table, the other n table would be loaded as optiondatasource anyways.

          Can this be done without the need of DMI or pro license?

          Cheers,

          EJ

          Comment


            #6
            DMI and/or custom DataSources are how you avoid writing DTOs everywhere and duplicating information between client and server-side code.

            DMI imposes no restrictions on data model or interaction model.

            There's no sensible reason to avoid DMI (other than your time being extremely inexpensive).

            The only thing we can suggest is a thorough, cover to cover read of the QuickStart Guide, as you seem to be casting about trying to eliminate things that have nothing to do with the problem you're trying to solve.

            Comment


              #7
              Hello,

              I've read and re-read the Guide lots of times.

              The main thing is that the documentation of Datasource ds.xml file definitions are a bit numb for me.

              I wanted to make use of ds.xml files whenever possible, even if I have to write one for each tables, like hibernate does with their hbm.xml files.

              I wanted to make use of them, specify join fields with tableName clause and make it update or insert the related table whenever necessary.

              I just don't want to make use of custom operations whenever a default definition is doable. I am trying to make use of all resources available to avoid having to customize my code.

              if I could make 3 ds.xml file, define them as fk and pk whenever needed and once performing a fetch, add or update, I could update related tables as well.

              Cheers,

              EJ

              Comment


                #8
                OK but.. everything you've just asked how to do is covered in the QuickStart Guide and the samples it links to. So we're kind of at a loss.

                Here, for example, is a sample that almost directly reflects your use case.

                Comment


                  #9
                  This example sort of mimics my code

                  But my code have a third join table in between, this one represents 1-n relationship

                  If I had to add another join table, can it be done as well?

                  If so, how?

                  Cheers,

                  EJ

                  Comment

                  Working...
                  X