Double reference selector

0
Hi people!   I have two reference selectors, they use a no-persistant entity and under two association make reference to the same value: vc_campo from other persistant entity, but both point the same attribute. When I want to save the data in my page, it only keeps the first value for both reference selectors. I realized a debug and the id for both is the same because it pints to the same database. How can I create a “duplicate object” only to store that attribute? Or there is another solution?   Thank you for your time.   Adolfo
asked
1 answers
0

Hey there,

 

if i am correct you need the following:

  • Main entity with 2 associations to a different entity
  • 2 reference selectors on a page, both pointing to the same entity, but through different associations
    • Entity1_Association1ToEntity2
    • Entity1_Association2ToEntity2
  • Try to debug the save flow to check if at first, both associations are filled and secondly if after committing, they both are still set.
  • A different problem that might rise is if the associated object is only allowed to be associated to 1 other object, resulting in an overwrite of your association. You might want to try and use *-* associations where both sides are owners of the association.
answered