Delegate for addNewObjectuiElement? (STV 2.1 beta 2)
Posted 05 July 2011 - 04:43 AM
is it possible to get the add new item event of a SCPropertyTypeArrayOfObjects for customizing?
If want to show an available list of objects. (many-to-many relationship)
Posted 05 July 2011 - 06:37 AM
To get notified when a new item is added to an SCArrayOfObjectsSection, just implement the SCTableViewModelDelegate method called 'tableViewModel:itemAddedForSectionAtIndexPath:item:'.
Hope this helps.
Posted 05 July 2011 - 06:50 AM
Is it possible?
Posted 05 July 2011 - 07:11 AM
Posted 05 July 2011 - 07:21 AM
i have the following classes: Contact, ContactToContactPerson, ContactPerson.
if i edit a contact i want show all contact persons related to a contact expanded in the contact edit view. To add a contact i have to show a list of available contact persons and create a relation object.
I think this is possible with SCPropertyTypeObjectSection, but the objects cannot be expanded in the contact view.
i hope i could clarify my problem.
Posted 06 July 2011 - 10:24 PM
Yes, this can be done using SCPropertyTypeObjectSelection, but I still can't figure out the relationship between this and overriding the add new object view?
Anyways, you can easily override what happens when you tap the "Add" button by setting it's 'action' property to any of your custom methods, instead of having STV take over when it's tapped. Hope this helps.
Posted 11 July 2011 - 07:20 AM
the main problem is, that the Object selection displays all selected items in one cell. And i didn't see a way to display the object selection cell as a section.
Is it possible to add this as a new feature?!
Otherwise i have to use overwrite the add button.
Posted 13 July 2011 - 08:36 AM
i found the SCObjectSelectionSection, so i think it is possible to display many-to-many assingments in a seperate section, right?
i tried to use the expandContentInCurrentView property to show the assignments from a many-to-many relationship but nothing is displayed.
Here the code:
SCClassDefinition *productlineClassDef = [SCClassDefinition definitionWithClass:[FACTS_ContactToProductline class] withPropertyNames:[NSArray arrayWithObject:@"name"]]; SCPropertyDefinition *productlinePropertyDef = [contactClassDef propertyDefinitionWithName:@"toProductlineArray"]; productlinePropertyDef.type = SCPropertyTypeObjectSelection; SCObjectSelectionAttributes *productlineAttributes = [SCObjectSelectionAttributes attributesWithItemsEntityClassDefinition:productlineClassDef allowMultipleSelection:YES allowNoSelection:YES]; productlineAttributes.expandContentInCurrentView = YES; productlinePropertyDef.attributes = productlineAttributes;
thank you for your help
Posted 13 July 2011 - 10:07 AM
Thanks a lot for all your feedback. We're now working really hard on adding this feature out-of-the-box for you before the final 2.1 release. You should be able to have it for testing early next week, I'll keep you updated. Thanks again
Posted 17 August 2011 - 07:13 AM
in the coredatasample app i try to make the category attribute (contained in task) to a many-to-many relationship and set allowMultipleSelection = YES.
The result is, that the detail view will not open.
i tried the same without the core data and have the same problem.
I'm using STV 2.1.1
Posted 17 August 2011 - 01:20 PM
Are you sure the Core Data model was updated correctly? Would you kindly email me the sample project you modified? Thank you very much.
Posted 19 August 2011 - 10:10 PM
SCClassDefinition *taskDef = [SCClassDefinition definitionWithEntityName:@"TaskEntity" withManagedObjectContext:managedObjectContext withPropertyNames: [NSArray arrayWithObjects:@"name", @"desc", @"dueDate", @"active", @"priority", @"categories", @"assignedTo", @"taskSteps", nil]];
Hope this helps.
Posted 22 August 2011 - 05:03 AM
i've tried it but it doesn't work.
Also, i cannot see any difference between the sended code and the snipped from you...
Posted 22 August 2011 - 11:50 AM
It seems that you need to do a clean build. Also, please find attached the TasksViewController.m file that is working at my side. Please tell me if your project works after doing a clean build.
Posted 26 August 2011 - 09:57 AM
I have assignedTo and categories in the table view, but it does nothing by clicking on it!
The aim is to show up a objectselectioncell expanded in a seperate section. With a button at the end to change the assignment. ( many-to-many relationship )
thanks for help!
Posted 26 August 2011 - 09:36 PM
This is super strange! I'll email you now the whole project which is working perfectly on my side. It is needless to say that since that Task required editing mode to be edited, you should tap the 'Edit' button before tapping on the 'Categories' cell.
Please tell me if this works.
Posted 30 August 2011 - 04:44 AM
sorry that was my fault. I forgot to click the edit button. :-/
But if i try:
selectionAttribs.expandContentInCurrentView = YES;
the cell won't be displayed...
thank you for your help
Posted 02 September 2011 - 02:12 AM
This should be working in our STV 2.1.2 release, due in about 48 hours. Thank you very much for all your feedback.
Posted 05 September 2011 - 05:39 AM
i've looked at it and it seems to be a little bit wrong implemented.
Now, if i try extendInCurrentView, i got the whole list of categories and can add and delete them. But it's more complicated because with a many-to-many relationship you have to assign the categories.
i would suggest a section with all assigned categories in the task view. In addition to the assigned items a button that opens a view to change the assignment and edit/add/delete functionality, if not read-only.
What do you think about that?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users