• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Is there any event gets invoked in Panel when a new Project is Opened?

Participant ,
Nov 29, 2016 Nov 29, 2016

Copy link to clipboard

Copied

Hi All,

We have used the setExtensionPersistent function to make our panel persistent in windows platforms.

So even when a new project is opened there is no onload events happening for the HTML5 page inside the panel.

Is there any events that can be used to identify that a new project is opened? so that in the event handler

we can do the changes for the panel when loading a new project.

Does any of the sample panel examples use any of these features?

Thanks and Regards,

Anoop NR

TOPICS
SDK

Views

537

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Nov 29, 2016 Nov 29, 2016

Since  we haven´t found such an event, we´re polling every 5 secs for the app.project.documentID using setInterval. If the ID has changed, we know that a new project has been opened.

I wish there was a more elegant solution.

Thomas

Votes

Translate

Translate
Participant ,
Nov 29, 2016 Nov 29, 2016

Copy link to clipboard

Copied

Since  we haven´t found such an event, we´re polling every 5 secs for the app.project.documentID using setInterval. If the ID has changed, we know that a new project has been opened.

I wish there was a more elegant solution.

Thomas

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 30, 2016 Nov 30, 2016

Copy link to clipboard

Copied

Hi Thomas,

That should work for us too..

So when the new project tab is opened from the File>New>Project, there will not be any active project/document,

and app.project.documentID

will not be having proper value in it, So how is it handled?

Thanks and Regards,

Anoop NR

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 30, 2016 Nov 30, 2016

Copy link to clipboard

Copied

LATEST

Not sure if that´s what you mean:

try{

  $.writeln(app.project.documentID);

}

catch(err) {

  $.writeln("nothing");

}

Wrap it in a try/catch!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines