[solved]Detect if a widget is in edit mode

Description
vanliers
Posts: 3
Joined: Wed Sep 12, 2018 12:01 pm

[solved]Detect if a widget is in edit mode

Postby vanliers » Wed Feb 06, 2019 3:05 pm

Hello,

I'm developing a widget in java and want that some functions are only available if the live report is in view mode. When the live report page is edited, these functions have to be disabled.

so my question is: how can I detect, if the page is in edit mode? Is there something like that?

Thank you in advance!
Stefan
Last edited by vanliers on Tue Mar 26, 2019 1:43 pm, edited 1 time in total.

vanliers
Posts: 3
Joined: Wed Sep 12, 2018 12:01 pm

Re: Detect if a widget is in edit mode

Postby vanliers » Tue Mar 26, 2019 1:42 pm

hi,

it's quite simple:

in Java it's something like:

Code: Select all

...
private final RichPageWidgetRenderingContext context;
...


if (context.target().isEditor() ||
    context.target().isPdf() ||
    context.target().isPrint())  {
    // do something...
}



or in velocity on a live report page it's something like:

Code: Select all

$widgetContext.target().isEditor()

$widgetContext.target().isPdf()

$widgetContext.target().isPrint()


Regards,
Stefan


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 9 guests