Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-877

Support new @Page CDI scope in the client IOC

    Details

    • Type: Feature Request
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Rejected
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: ErraiCDI
    • Labels:
      None

      Description

      Often with Errai I create a main page that contains all the necessary page layout such as header , navigation, content and footer and then include static inner classes that define possible subpage states. An example of this is a Wizard with multiple steps where there is enough in common between the steps that it makes sense to have one page instead of multiple pages. Often this pattern requires tight coupling between the parent layout composite and child sub content since the sub content may need to update the state defined in the parent content.

      Ideally this tight coupling would be resolved with dependency injection. However due to the circular dependencies the page template would need to be defined in a normal scope such as @ApplicationScope. However the application scope with a singleton nature would not be appropriate for temporary view pages.

      I would like to propose that Errai support a new @Page scope. This would be similar to the JSF view scope but it would be tied to an Errai navigation Page composite. Any CDI dependency injection requests for an injected property annotated with a @Page scope annotation would first be retrieved from the page context and if it did not exist it would be created. This would solve circular dependency problems for tightly coupled injected composites.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mbarkley Max Barkley
                Reporter:
                aanderson1776 Aaron Anderson
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: