[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Showing application title in the browser tab instead of URL  XML
Forum Index -> Development
Author Message
katsarova



Joined: 12/12/2014 08:32:05
Messages: 3
Offline

How can we set the title of the browser tab when running the application as an applet (s. attached file)?

At the moment the URL is shown in the tab. I tried the t:clientconfig component (property title), but this works fine only when using webstart.
[Thumb - CC_BrowserTitle.png]
 Filename CC_BrowserTitle.png [Disk] Download
 Description
 Filesize 31 Kbytes
 Downloaded:  348 time(s)

CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5525
Offline

Hi,

the title is coming from the HTML page around the applet.

By default it is the "ugly URL" or it is expliclty defined in the title of the HTML page:

Code:
 ...
 <head>
 <title>Some nice title.</title>
 ...
 </head>
 ...
 


Now, the HTML page is created by the servlet behind ".ccapplet".

By default the servlet (name: "AppeltStarter") uses the following template from the serverside webapp-classloader: "org/eclnt/jsfserver/starter/applettemplate.html". But you may define some own template via "<webcontent>/eclntjsfserver/config/system.xml":

Code:
     <starttemplates 
         ...
         ccapplet="org/eclnt/jsfserver/starter/applettemplate.html"
         ...
     />
 


So, the steps are:
1. Create copy of "org/eclnt/jsfserver/starter/applettemplate.html" and place it inside your server side code. (e.g. in "aaa/bbb/applettemplate.html"). In the copy define the HTML-title as desired.
2. Define the page in start.xml:
Code:
     <starttemplates 
         ccapplet="aaa/bbb/applettemplate.html"
     />
 

3. Reload the server

Regards, Björn

Björn Müller, CaptainCasa GmbH
katsarova



Joined: 12/12/2014 08:32:05
Messages: 3
Offline

Thanks for your quick reply!

In my understanding, the servlet AppeltStarter returns this path to the html as default.
Unfortunately, I cannot find this path to copy the html:
"org/eclnt/jsfserver/starter/applettemplate.html"

And I suppose, you mean system.xml, not start.xml?
Is there any possibility to bind the title to a value expression? Some of our customers want to see here a special title defined by the customer itself which is usually provided by an external system (e. g. SAP).

Thx!
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5525
Offline

Hi,

"org/eclnt/jsfserver/starter/applettemplate.html" is part of eclntjsfserver.jar

The loading of the template is done through the class loader. That's why you have to place your copy of the template into your Java classes/packages as well.

@"Is there any possibility to bind the title to a value expression?"
Well, so far not. But...: we could open up. And just say that you may e.g. pass "?title=Hello Kitty" to the ".ccapplet". (In this case you would not have to create any template on your own.) Would this be an option for you?

Regards, Björn


Björn Müller, CaptainCasa GmbH
katsarova



Joined: 12/12/2014 08:32:05
Messages: 3
Offline

Hi!

Worked well with the html so far, many thanks!
But it's not exactly what we are looking for because the title is still "hard coded".

Using a parameter ?title=Hello Kitty isn't that nice (we use the url in e-mail notifications and don't want to set the title this way). Apart from that, it's not quite clear which steps we need, to make only the title to appear in the tab.

Actually, we need something like this in the html:

<title>@@title@@</title>

We tried the following workaround: we extended the AppletStarter-Servlet, referred to our new servlet class in the web.xml and tried to identify our own parameter @@title@@, but this didn't work as expected.

So, maybe we can get access to the sources of the AppletStarter class or you could provide us a way how to use own parameters in the html in the same way as you do for parameters like @@pagename@@ etc. Then we can implement a servlet which comunicates with some other system, get all the information we need and map it to our own parameter(s).

What do you think about that?
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5525
Offline

...took some time to respons, sorry!
Because of the AppletServlet-servlet => I did send you some mail...
Regards, Björn


Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team