Update within Relationship table list does not persist to parent schema

Avatar

Avatar
Validate 1
Level 2
Tetyana_Savenko
Level 2

Likes

3 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Give Back 3
Give Back
Ignite 1
Boost 3
View profile

Avatar
Validate 1
Level 2
Tetyana_Savenko
Level 2

Likes

3 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Give Back 3
Give Back
Ignite 1
Boost 3
View profile
Tetyana_Savenko
Level 2

24-09-2019

I have a Relationship table defined between two tables that contains links to respective tables.

Within a form, I have an input of type "list" based on the Relationship table defined above. The list references fields from both tables and (as expected) allows to edit values of those fields. Once a filed is updated, "Save" button appears within the related container and the changes are seemingly propagated - the field displays an update value. However, the actual object whose field was just "updated" retains its original value and, as soon as the screen is Refreshed (F5), the field displays its original value again.

Relationship table definition:

...

<element label="RelTable" name="relTable">

  <key internal="true" name="id">

      <keyfield xlink="table1"/>

      <keyfield xlink="table2"/>

    </key>

  

    <element integrity="neutral" label="Table1" name="table1" revIntegrity="own"

             target="cus:table1" type="link"></element>

    <element integrity="neutral" label="Table2" name="table2" revIntegrity="own"

             target="cus:table2" type="link"/>

</element>

...

Input Form:

...

<container colcount="2" label="CB Extend">

          <input img="nms:geolocation.png" nolabel="true" type="list" xpath="relTable">

            <input label="Field1" xpath="table1/@fieldId"/>

            <input label="Name" xpath="table1/@fieldName"/>

            <input hidden="true" xpath="[@table2-id]"/>

            <input hidden="true" xpath="[@table1-id]"/>

            <orderBy>

              <node expr="[table1/@fieldName]"/>

            </orderBy>

          </input>

        </container>

....

Would anyone have any suggestions?.. Thank you!

Replies

Avatar

Avatar
Establish
MVP
wodnicki
MVP

Likes

976 likes

Total Posts

1,096 posts

Correct reply

514 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile

Avatar
Establish
MVP
wodnicki
MVP

Likes

976 likes

Total Posts

1,096 posts

Correct reply

514 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile
wodnicki
MVP

25-09-2019

Hi,

The form is on the bridge table? If so, change revIntegrity to integrity.

You probably also want owncopy instead of own.

Thanks,

-Jon

Avatar

Avatar
Validate 1
Level 2
Tetyana_Savenko
Level 2

Likes

3 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Give Back 3
Give Back
Ignite 1
Boost 3
View profile

Avatar
Validate 1
Level 2
Tetyana_Savenko
Level 2

Likes

3 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Give Back 3
Give Back
Ignite 1
Boost 3
View profile
Tetyana_Savenko
Level 2

25-09-2019

Hi @wodnicki !

Updated schema definition to this:

<element label="RelTable" name="relTable">

  <key internal="true" name="id">

      <keyfield xlink="table1"/>

      <keyfield xlink="table2"/>

    </key>

 

    <element integrity="neutral" label="Table1" name="table1" revIntegrity="owncopy"

             target="cus:table1" type="link"></element>

    <element integrity="neutral" label="Table2" name="table2" revIntegrity="owncopy"

             target="cus:table2" type="link"/>

</element>

Same result      

could you please elaborate on "The form is on the bridge table? If so, change revIntegrity to integrity."

Thank you!

Avatar

Avatar
Validate 250
Level 10
pablo_rosero1
Level 10

Likes

81 likes

Total Posts

348 posts

Correct reply

77 solutions
Top badges earned
Validate 250
Validate 100
Validate 50
Validate 25
Validate 10
View profile

Avatar
Validate 250
Level 10
pablo_rosero1
Level 10

Likes

81 likes

Total Posts

348 posts

Correct reply

77 solutions
Top badges earned
Validate 250
Validate 100
Validate 50
Validate 25
Validate 10
View profile
pablo_rosero1
Level 10

21-10-2019

Hi wodnicki ,

Thank you for all your participation in our community

Any ideas for Tetyana? She's having the same result.

Thanks again!

Avatar

Avatar
Establish
MVP
wodnicki
MVP

Likes

976 likes

Total Posts

1,096 posts

Correct reply

514 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile

Avatar
Establish
MVP
wodnicki
MVP

Likes

976 likes

Total Posts

1,096 posts

Correct reply

514 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile
wodnicki
MVP

21-10-2019

Hi,

The form container in the original post is unclear- Is there a third schema that's backing it, hosting the UI for the bridged elements?

Either way, AFAIK changes via xtk:persist#Write (console form) will propagate only to owned schemas, not vice-versa as in the schema defined above. Options would then be either make your own xtk:persist#Write calls in <postSave/> event (hacky), or try adding zoom="true" editable="false" to the <input/> element (degraded ux).

Thanks,

-Jon

Avatar

Avatar
Boost 50
MVP
Jyoti_Y
MVP

Likes

88 likes

Total Posts

123 posts

Correct reply

55 solutions
Top badges earned
Boost 50
Shape 1
Boost 5
Give Back 5
Give Back 3
View profile

Avatar
Boost 50
MVP
Jyoti_Y
MVP

Likes

88 likes

Total Posts

123 posts

Correct reply

55 solutions
Top badges earned
Boost 50
Shape 1
Boost 5
Give Back 5
Give Back 3
View profile
Jyoti_Y
MVP

22-10-2019

Hi,

Try by changing element label and name with revLink in schema definition:

<element label="RelTable" name="relTable">

  <key internal="true" name="id">

      <keyfield xlink="table1"/>

      <keyfield xlink="table2"/>

    </key>

 

    <element integrity="neutral" label="Table1" name="table1" revLink="relTable" revIntegrity="own"

             target="cus:table1" type="link">

   <join xpath-dst="@id" xpath-src="@table1-Id"/>

  </element>

    <element integrity="neutral" label="Table2" name="table2" revLink="relTable" revIntegrity="own"

             target="cus:table2" type="link">

      <join xpath-dst="@id" xpath-src="@table2-Id"/>

</element>

Thanks.

Avatar

Avatar
Establish
MVP
wodnicki
MVP

Likes

976 likes

Total Posts

1,096 posts

Correct reply

514 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile

Avatar
Establish
MVP
wodnicki
MVP

Likes

976 likes

Total Posts

1,096 posts

Correct reply

514 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile
wodnicki
MVP

22-10-2019

Hi,

Out of curiosity, how would changing the name of the link impact data propagation?

Thanks,

-Jon

Avatar

Avatar
Boost 50
MVP
Jyoti_Y
MVP

Likes

88 likes

Total Posts

123 posts

Correct reply

55 solutions
Top badges earned
Boost 50
Shape 1
Boost 5
Give Back 5
Give Back 3
View profile

Avatar
Boost 50
MVP
Jyoti_Y
MVP

Likes

88 likes

Total Posts

123 posts

Correct reply

55 solutions
Top badges earned
Boost 50
Shape 1
Boost 5
Give Back 5
Give Back 3
View profile
Jyoti_Y
MVP

23-10-2019

Hi,

It is creating reverse link to your main table. I think it will solve the issue.

Thanks.

Avatar

Avatar
Establish
MVP
wodnicki
MVP

Likes

976 likes

Total Posts

1,096 posts

Correct reply

514 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile

Avatar
Establish
MVP
wodnicki
MVP

Likes

976 likes

Total Posts

1,096 posts

Correct reply

514 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile
wodnicki
MVP

23-10-2019

Hi,

Reverse links are automatically created when creating links, with the option to change the reverse link's name from its default of target schema using attribute 'revLink'- the example you posted sets it to the existing default.

AFAICT the issue isn't about changing the link name, it's a form input being used to set values in a way underlying relationships don't support.

Thanks,

-Jon