Skip to content

Encapsulating and Encapsulated Scenes: complex object sharing and TableView #2

@barmat80

Description

@barmat80

Hi.
I've two questions about Encapsulating and Encapsulated Scenes with complex objects.

My Scenario:
In the encapsulating scene I've a TableView with a bunch of record backed by a complex object (for example a Product with id, name, unit of measure attributes and so on).
By clicking on a button, you can add a new element or edit the selected one: a new encapsulated scene will open and, in editing mode, I need to share data between the two scenes.
Then, in both cases, when the user click on save button, the TableView needs to be updated with the new/updated data.

  1. You wrote an example passing a simple string property between the two scenes, but I can't make it work passing the Product object as an ObjectProperty in the encapsulating controller constructor: the data are not shown or are not editable, depending on if I bind it or not to the encapsulating model.
    I've solved it now by passing the object property to the getView method of the encapsulating scene, but I think that this way I'm breaking up the pattern.
    Can you give me any suggestions?

  2. After model persisting onto the database, how can I achieve the updating of the TableView without doing again the lookup?

Thank you

Mattia

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions