Out of sync and Ignoring variable change for non-existent component error

Hello,
In my application i’m getting
Out of sync
error in a red error box and also in logs it’s saying that
Warning: Ignoring variable change for non-existent component, VAR_PID=PID_ScommonPassword

I investigated a bit in the forums and that i know that it’s because of component removed from server and not removed in the client, and this error occurs when client tries to send data to the server.

My application needs to be logged in to use it, so users enter their username and password to log in and use the application.
And in the application users can change ui language and i’m handling changing language via request parameters by adding ?lang=en, etc… at the end of url.

Above error occurs only in the following situation.
User enters his/her username and password to login, assume he/she logs in successfully then if he/she changes the language, the above error occurs. (No errors in the next changing language actions). Shortly the error occurs only in the first language change attempt after logging in successfully.

Technically, i have a login view and there are username and password fields. After login button is clicked, i check if username and password are correct or not, then if username and password are both correct, i remove all the components of main window and add my dashboard view to the main window.
The error occurs because of the password field, as you can see in the above error message, it is related to the component with id VAR_PID=PID_ScommonPassword and i’m giving that id my password field.
And if i remove my password field in the login view i’m getting no error.

I added the password field related code below.


final TextField pwField = new TextField( CommonUtils.getText( "common/password" ) );
pwField.setRequired( true );
pwField.setRequiredError( CommonUtils.getText( "loginLogout/passwordCantBeEmpty" ) );
pwField.setSecret( true );
pwField.setDebugId( ComponentIdentifier.COMMON_PASSWORD.getName() );
loginFormLayout.addComponent( pwField );

....

if( eMailField.isValid() && pwField.isValid() ){
String pw = ( String )pwField.getValue();
......
}

if i remove above code block in my application, i’m getting no error.

any ideas?
thx in advance.

I don’t see anything wrong in your code example. I suspect there’s something wrong in your ParameterHandler.

Btw. TextField.setSecret is deprecated and you should use PasswordField, however that’s irrelevant to this problem your are having.

Hello Johannes,

I was using vaadin version 6.4.4 and in that there is no PasswordField.
I upgraded vaadin to 6.7.1 and used PasswordField instead of TextField with setSecret.

Then the issue gone away :S

Thanks for your reply.