Skip to content

Option to allow more than one embed-root per page #241

@wimbarelds

Description

@wimbarelds

Is your feature request related to a problem? Please describe.
The application I am working on embeds Pega views onto a non-pega portal page. One of the things we want to be able to do is have more than 1 embedded view on a pega (For example: a task list and a task-detail), however this appears not to be possible.

Describe the solution you'd like
As I understand it, the way the SDK works is generally placing "everything" in a global context. PCore is added as a property of window, and PCore has a single store/context.

Ideally, PCore (and all underlying context/state) would be something we can import as an es-module, and multiple indepdendant instances of it could be created (that all work/manage state/events/requests independant from other instances).

However, that seems like it would mean a potentially huge change spanning more than just this SDK. It might be possible to instead mount a (separate) store to instances of Mashup API (ie: PCore.getMashupApi()). Instances of the component created with createPConnectComponent could be passed an instance of that mashup-api-instance (ie: <PConnectObj {...props} mashupApi={mashupApiInstance} />.

Describe alternatives you've considered

I have tried to consider alternatives, such as the target context, possible with React portals; however that seems like it has a low chance of a working and would introduce complexity and make it llikely for future updates to the SDK to break our 'custom' solution.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions