Alter pane title when screen is displayed?

Hi,
I'm trying to tweak the "View ticket" screen by changing the text on the Messages pane.

I'd like to fire off a SearchEngine and make it display how many messages there are - "Messages (13)".

Does the Pane element support setting the title during one of the screen buildup events?

Frode

Re: Alter pane title when screen is displayed?

Anyone?

By: Frode Lillerud 23 Nov 2011

Re: Alter pane title when screen is displayed?

Seems like the title can only be set at creation time. You could probably create the pane element dynamically within the ejScript code.

Stian

By: Stian Andre Olsen 28 Nov 2011

Re: Alter pane title when screen is displayed?

Thanks Stian, I got it working by changing the Creation Script for the Pane to this;



// Adds the number of messages to the Pane. Example: Messages (4)

Map config = getScreenElementConfig(screenElementIndex);

SearchEngine se;
se.addField("ej_message.ticket_id", "count");
se.addCriteria("ej_message.ticket_id", "OperatorEquals", getCgiVariable("ticketId"), "OperatorAnd", 0);
se.bypassNetServer(true);
se.execute();

config.insert("title", config.get("title") + " (" + se.getField(0) + ")");

addHtmlElement(getScreenElementId(screenElementIndex),
getScreenElementName(screenElementIndex),
getScreenElementType(screenElementIndex),
config);

By: Frode Lillerud 28 Nov 2011

RE: Alter pane title when screen is displayed?

Found this old thread as this is what a customer is asking for. But I can't get it to work, where exactly should the code be placed?

By: Patrik Larsson 12 Apr 2021

RE: Alter pane title when screen is displayed?

Hi Patrick,

You need to add this to the creation script for the pane, like this;

By: Michel Krohn-Dale 12 Apr 2021

RE: Alter pane title when screen is displayed?

Thanks!

Anyting else I need to do? I only get the name I have given the screen under "Web Panels".

By: Patrik Larsson 13 Apr 2021

RE: Alter pane title when screen is displayed?

Hi,

Could you please provide some screenshots for how your screendefinition looks like?

By: Michel Krohn-Dale 13 Apr 2021

RE: Alter pane title when screen is displayed?

Or do I need to use Panes and then Pane?

By: Patrik Larsson 14 Apr 2021

RE: Alter pane title when screen is displayed?

Hi,

The Panes element is a container for one or more Pane elements. So you would need to build it like this;

 

By: Michel Krohn-Dale 14 Apr 2021

RE: Alter pane title when screen is displayed?

I see, thanks! I was under the impression that you could get the number of messages visible in the tab name (marked in the attached image), but that is not the case?

By: Patrik Larsson 19 Apr 2021