qlik-demo-team / qdt-components

React Components to be used with Angular 10, React 16 and Vue 2. Connects with the Capability API and Engine API.
MIT License
92 stars 50 forks source link

Two instances of qdtComponent connecting to two different apps #22

Closed MF0414 closed 6 years ago

MF0414 commented 6 years ago

In a react application is the use of qdt-components restricted to a single qlik sense application?

I created two separate instances of qdtComponent that each have a different appId associated with it. When the app Id's are different only one of the components will render correctly and the other returns "Object not found".

When the app ids are the same they both work. And both configs have been verified to work independently.

fkabinoff commented 6 years ago

Good question. Its designed to work with more than 1 application, with each instance of the QdtComponents class being able to have its own config. But I honestly havent tested it much. Will have to check it out and get back to you when i have a chance.

jonvitale commented 6 years ago

@fkabinoff Any updates on this. I want to make sure I can connect to multiple apps before I dive in, else I'm going to need to back out and do it the standard AngularJS way (boo).

yianni-ververis commented 6 years ago

Are you trying to have 2 different object from 2 different apps on the same page? This will not work.

jonvitale commented 6 years ago

@yianni-ververis In theory that may have been something I wanted to do, but not necessarily. I think the basic use case would be to have have (2+) separate templates that each pull from a different Qlik App. Are there any examples of this with qdt-components?

yianni-ververis commented 6 years ago

Working on it

fkabinoff commented 6 years ago

It should just work? I haven't tested it, but each instance of qdt-components creates its own connections. So you should just be able to have twodifferent configs and do something like var qdtComponents1 = new QdtComponents(config), and var qdtComponents2 = new QdtComponents(config2), something like that. I'll have to test it, just haven't had the chance. Have you given it a try?

yianni-ververis commented 6 years ago

In theory it should be fine but I get Angular errors

jonvitale commented 6 years ago

breaking errors?

On Tue, Jul 24, 2018 at 8:42 AM Yianni Ververis notifications@github.com wrote:

In theory it should be fine but I get Angular errors

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/qlik-demo-team/qdt-components/issues/22#issuecomment-407392701, or mute the thread https://github.com/notifications/unsubscribe-auth/ACIkjFZJOOgepak1NfH1UNSOucHpNRBlks5uJxYcgaJpZM4TcS7X .

yianni-ververis commented 6 years ago

Yes. Requirejs is trying to bootstrap angular twice

yianni-ververis commented 6 years ago

OK i did it with a work around. Let me clean up and commit

yianni-ververis commented 6 years ago

Example: https://webapps.qlik.com/qdt-components/react/index.html#/embed-object-multi-app

Code: https://github.com/qlik-demo-team/qdt-react-website/blob/master/src/components/QdtComponent.jsx

jonvitale commented 6 years ago

Excellent, I look forward to trying it out!