Screen agent - simple samples?

Hi,

I have tried to play around with the screen agent feature in 6.3 RC2 - but have not really managed to figure it out, as it is not possible to directly copy the login screen in Studio.

Are there any simple sample projects available, which uses the feature?

Br,

Torben

Are there no sample projects at the moment which demonstrates the agent feature?

Hi,

Currently there is no support for custom agents of loginWindow and mainWindow in Studio, but it is already supported by CUBA 6.3.

You can create two login windows from your IDE:

  1. Extend login window in Studio.

  2. Copy your loginWindow xml and Java files created from Studio to another package, say com.company.agents.web.loginWindow_phone".

  3. Register new screen in web-screens.xml:


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<screen-config xmlns="http://schemas.haulmont.com/cuba/screens.xsd">
    <include file="com/company/agents/screens.xml"></include>
    <screen id="loginWindow"
            template="com/company/agents/web/loginwindow/ext-loginwindow.xml"></screen>
    <screen id="loginWindow"
            agent="PHONE"
            template="com/company/agents/web/loginwindow_phone/ext-loginwindow-phone.xml"></screen>
</screen-config>
  1. Open this newly created screen in Studio and change the layout.

And now CUBA will use agent=“PHONE” screen for phones only. Take a look at sample project I’ve attached, it shows two login windows with different agents (without agent and with PHONE).

sample-agents.zip (24.4K)

Thanks for the sample and the explanation - I will try that.