Saving dynamic radioButtonGroup selection

Hi,

I’m trying to save the selected item of radioButtonGroup (alternatively the selection from lookupField) but am at a loss so far as to how to achieve this.

Basically two radioButtonGroup and one lookupField load their data-aware content using the dataLoadCoordinator. Feeding the sources and creating the associations between the entities in the respective screens is working as intended.

There are three entities:

  • Questions
  • Answers
  • Information

Basic workflow as following:

1.Enter the answers first which are a composition to questions many-to-one
2. Enter the questions which are composition to answers one-to-many
3. Set which question may have which answers (one or more answers)
4. Go to information screen and select a question and its corresponding answer

Now in this information screen from step 4, then a user selects any item from the first radioButtonGroup and then from the second radioButtonGroup (or lookupField) the selection should be commited to the DB after the editor window is closed (again any other way like an extra button or saving immediately once a value changes is perfectly fine).

Inspiration I took from this demo project which is except for the Groovy (don’t know or know how to migrate) part and being on 6.x platform pretty much what I need as well.

I’ve attached my test project.test.zip (11.8 MB)

I must admit I am by now at a complete loss as to how to do this even after checking all sources several times I can think of.

Really appreciate any and all help!

Here the relevant parts taken from the demo project.

Editor screen in which the selection is done and should be commited to the database (information-edit.xml).

        <collection id="informationsDc"
                    class="com.company.test.entity.Information"
                    view="information-view">
            <loader id="informationsDl">
                <query>
                    <![CDATA[select e from test_Information e]]>
                </query>
            </loader>
        </collection>
        <collection id="questionsGroup1Dc" class="com.company.test.entity.reference.Questions" view="questions-view">
            <loader id="questionsGroup1Dl">
                <query>
                    <![CDATA[select e from test_Questions e]]>
                </query>
            </loader>
        </collection>
        <collection id="answersGroup1Dc" class="com.company.test.entity.reference.Answers" view="answers-view">
            <loader id="answersGroup1Dl">
                <query>
                    <![CDATA[select e from test_Answers e where e.mapAnswerToQuestion = :container_questionsGroup1Dc]]>
                </query>
            </loader>
        </collection>
        <instance id="informationDc" class="com.company.test.entity.Information" view="information-view">
            <loader id="informationDl"/>
            <collection id="questionsesDc" property="mapInfoToQuestion"/>
            <collection id="answeresDc" property="mapInfoToAnswer"/>
        </instance>
    </data>
    <dialogMode height="600"
                width="800"/>
    <facets>
        <dataLoadCoordinator auto="true"/>
    </facets>
    <layout spacing="true" margin="true">
        <vbox spacing="true" margin="true">
            <hbox id="editActions" spacing="true">
                <button action="windowCommitAndClose"/>
                <button action="windowClose"/>
            </hbox>
            <form id="informationForm" dataContainer="informationDc">
                <column width="350px">
                    <textField id="pismsIDField" property="pismsID"/>
                    <textField id="pismsNameField" property="pismsName"/>
                </column>
            </form>
            <groupBox spacing="true" caption="Question group 1" collapsable="true"
                      showAsPanel="true">
                <radioButtonGroup id="questionGroup1" optionsContainer="questionsGroup1Dc"
                                  captionProperty="pismsName"
                                  dataContainer="informationsDc" property="selectedQuestion"/>
                <radioButtonGroup id="answerGroup1" optionsContainer="answersGroup1Dc"
                                  captionProperty="pismsName"
                                  dataContainer="informationsDc" property="selectedAnswer"/>
                <lookupField id="prodLnField" optionsContainer="answersGroup1Dc"
                             captionProperty="pismsName"
                             dataContainer="informationsDc" property="selectedAnswer"/>
            </groupBox>
        </vbox>
    </layout>```

Any pointers? Why is the state of the radio button not comitted? I tried mutliple approaches and setting different attributes but the knot is not untangling.