Login Dialog - Keyboard Handling

Hi there,

since I have not found a solution for our little
problem in the forum yet,
I would like to share it with you:

We have implemented a little Dialog to log in.
It has two fields and a submit button. An Adapter is bound to that Dialog.
Our problem is, that the user has to press the submit button every time,
because the keyboard stroke ENTER does not consider the text inside the password field.

Desired Usage:
The User inputs username, then presses tab and then enters the password and then presses ENTER on his keybord.
In our implementation when hitting ENTER the method “getUserPwd” inside the adapter class returns null…

Has anybody a solution for this?

Thanks in advance.

Why don’t you try to validate your fields against your business rules before processing them ? Also by usign "statusprop " property of field you can give warning messages & focus on any field.

The login works fine, when hitting the SUBMIT button.
The moment I am still inside the Password field with cursor,
and hit keyboard’s ENTER key the variable bound to that field is empty.

I tried also the flush with server and screen, but did not work properly.

It seems normal to me.If you don’t want to get null value you should initialize your members. I’m sending sample code , I hope it helps you .

package test;

import com.softwareag.cis.server.Adapter;
import com.softwareag.cis.util.IControlStatusConstants;

public class LoginAdapter extends Adapter {

	private String user;
	private String password;
    private String fieldStatusUser;
    private String fieldStatusPassword;
	public String getPassword() {
		return password;
	public void setPassword(String password) {
		this.password = password;
	public String getUser() {
		return user;
	public void setUser(String user) {
		this.user = user;

    public String getFieldStatusUser()
        return fieldStatusUser;

    public String getFieldStatusPassword()
        return fieldStatusPassword;
	public void setFieldStatusPassword(String fieldStatusPassword) {
		this.fieldStatusPassword = fieldStatusPassword;
	public void setFieldStatusUser(String fieldStatusUser) {
		this.fieldStatusUser = fieldStatusUser;
	public void init() {
	public void reactOnDataTransferStart() {
	public void onEnter(){
		if (! isValid()) return;
	public void onOkButtonPressed(){
		if (! isValid()) return;
	private void logonProcess(){
		//TODO implement your logon process here
	private boolean isValid(){
		if (user == null || user.trim().length() == 0){
			outputMessage("E","User name required");
            return  false;
		if (password == null || password.trim().length() == 0){
			outputMessage("E","Password required");
			return false;
		return true;

Page Code

<?xml version="1.0" encoding="UTF-8"?>
<page model="test.LoginAdapter" translationreference="logonPage" popupwidth="400px" popupheight="250px" immediatedisplay="true">
    <titlebar textid="logonTitle" withclose="false">
    <header withdistance="false">
            <vdist height="10">
                <label textid="user" width="100">
                <field valueprop="user" statusprop="fieldStatusUser" length="32" tabindex="0">
                <label textid="password" width="100">
                <field valueprop="password" flush="screen" statusprop="fieldStatusPassword" length="32" password="true" tabindex="1">
                <coltable0 width="100" takefullheight="true">
                        <button textid="logon" method="onOkButtonPressed" tabindex="3">
            <vdist height="50">
    <statusbar typeprop="messageType" shorttextprop="messageShortText" longtextprop="messageLongText" withdistance="false">
        <hotkey keycode="13" method="onEnter">

Wow thanks!
I think I got it.