Which attribute type to use?
CapableObjects Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Which attribute type to use? Expand / Collapse
Author
Message
Posted 2008-12-27 11:36:39
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Yesterday @ 15:41:11
Posts: 190, Visits: 7 533
Hi,

I have a class to create dinamically a comboBox:

ASComboBox
- OclExpression: String
- display: String
- value: ??? (Transient)

In the value attribute I want to save temporary (transient) an object from the model i.e. Order, Orderline, Customer, Invoice ...

I don't want to save in the database in order not to have problems with the PersistenceMapper.

Which attribute's type should I put?

Thanks,

José María Sanmartín

Post #1561
Posted 2008-12-27 12:07:18
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230, Visits: 1 382
If you need the attribute to be ocl-navigable, you probably need to use a string and store the ExternalId (and then use something like "Person.objectFromExternalId(anId)" to get the object back. If you don't need to have it OCL-navigable, you can just add a custom (non-eco) property to your class and store an IObject or IObjectProvider.

/Jonas Hogstrom [CapableObjects]
Post #1562
Posted 2008-12-27 16:57:27
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Yesterday @ 15:41:11
Posts: 190, Visits: 7 533
Given the following class:

ASComboBox
- OclExpression: String
- display: String
- value: string

I want to create dinamically:
- an ExpressionHandle with Expression = ASComboBox.oclExpression
- an ComboBox with DataSource = the expressionHandle created earlier,  DisplayName = ASComboBox.display and databind the selectedItem with the value attribute

For instance if I have an expressionHandle with Person.AllInstances I would like to save in the value attribute the person selected in the combobox.

I don't know how to do it, so I followed your suggestion and I used the ComboBox.SelectedIndexChanged event to save in the value attribute the IDForObject.

Thanks for your help,

José María Sanmartín

Post #1564
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: HansKarlsen, Jonas Hogstrom, PeterMorris

Permissions Expand / Collapse

All times are GMT +1:00, Time now is 12:03

Powered By InstantForum.NET v4.1.4 © 2012
Execution: 0,203. 11 queries. Compression Disabled.