UA-17470720-3

Jump to content


Photo
- - - - -

titlePropertyName


  • Please log in to reply
2 replies to this topic

#1 Vince

Vince

    Jr. Member

  • STV 4.0 Std
  • PipPip
  • 23 posts
Reputation: 0
Neutral

Posted 12 May 2014 - 07:09 AM

Hello all

 

I managed to solve my problem with the cascaded relationships but I'm now facing a new one which is not an error but rather conceptual and i couldn't find any hint in the documentation. Maybe someone here can help me understand.

 

Screen Shot 2014-05-08 at 14.36.17.png

 

I have again the same DB Model. When adding a recipe I can correctly add an aroma and it's percentage. The aroma gets fetched from the aroma_details which again has it's own attributes. that works all well but...

 

Selecting an Aroma_Detail and navigating back to Aroma, takes over correctly the name of the Aroma_Detail in the SelectionObject. When I navigate back to the Recipe though, the SelectionObject doesn't show the name anymore but instead a reference String to the entry in the Aroma Table, thus sort of loosing the name. 

 

I assume I would have to use "titlePropertyName" to set it right, but how can I access a field in the aroma_detail from the first recipe table?

 

I hope it makes sense the way I explained it, although I reckon it's not so easy :-S

 

best wishes Vince



#2 Everett

Everett

    Ev

  • STV 5.0 Pro
  • PipPipPipPipPip
  • 191 posts
  • LocationMichigan
Reputation: 60
Outstanding

Posted 12 May 2014 - 05:24 PM

Hey Vince,

it's not really clear what you are asking?  Maybe a couple of screen shots?



#3 Vince

Vince

    Jr. Member

  • STV 4.0 Std
  • PipPip
  • 23 posts
Reputation: 0
Neutral

Posted 13 May 2014 - 01:50 AM

Hi Everest

 

I'm struggling uploading screenshots as the Forum seems to restrict the numbers of file you can have in your library and I can't figure how to remove the ones I don't need anymore... anyway will try to explain verbally again...

 

Let me start though by stating that I found the solution after a long while, but I will describe it here just in case someone encounters the same problem.

 

I have the following entity model:

 

Recipe <<--->> Aroma <<---> AromaDetail

 

Every relation between the entities is of type SCPropertyTypeObjectSelection. The flow is the following and must be considered as a drill down:

 

- Recipe Overview

--- Add Recipe

------ Add an Aroma

---------- Select / Add an Aroma Detail

 

The Name of the Aroma is stored in the AromaDetails but I need it to be displayed in the Aroma- AND Recipe View. I was thus struggling getting that Name passed through all views up to the Add Recipe View. In the latter I saw a relationship string instead of the Aroma Name. 

 

In short, I had to set the titlePropertyName of the Aroma to something like that because the Name Attribute is saved in another entity:

aromaDefinition.titlePropertyName = @"rel_aroma_details.name";

The trick I learned, you can get attributes of related entities by just adding a (.) period between the entity relation and the attribute. In this case between "rel_aroma_details" and "name".

 

I hope it makes sense to anyone who reads this, but basically, wherever you need to refer to an attribute in another related entity, you can use the period (.) to build up your string which refers to this foreign entity attribute

 

regards

 

Vince






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users