users-gd/Blue Print - users.js
// Create "Set Password" dialog
Create "Set Password" dialog
Create " Set Password " dialog
function createPasswordDialog( task, post )
{
    var app = UiApp.createApplication();
    app.setWidth(400);
    app.setHeight(100);
    var labelUsername = app.createLabel('Username');
    app.add(labelUsername);
    var usernameField = app.createTextBox().setId('usernameField').setName("username");
    app.add(usernameField);
    var labelPassword = app.createLabel('Password');
    app.add(labelPassword);
    var passwordField = app.createPasswordTextBox().setId('passwordField').setName("password");
    app.add(passwordField);
    var taskField = app.createTextBox().setId('taskField').setName("task");
    taskField.setVisible(false);
    taskField.setValue( task );
    app.add(taskField);
    var postField = app.createTextBox().setId('postField').setName("post");
    postField.setVisible(false);
    postField.setValue( post );
    app.add(postField);
    var handlerOkBtn = app.createServerHandler("setPassword")
        .addCallbackElement(passwordField)
        .addCallbackElement(usernameField)
        .addCallbackElement(taskField)
        .addCallbackElement(postField);
    var okBtn = app.createButton("OK", handlerOkBtn);
    okBtn.setWidth(60);
    app.add(okBtn);
    var handlerCancelBtn = app.createServerHandler("closePasswordDialog");
    var cancelBtn = app.createButton("Cancel", handlerCancelBtn);
    cancelBtn.setWidth(60);
    app.add( cancelBtn );
    var messageLbl = app.createLabel().setId("warningMessageLbl");
    messageLbl.setStyleAttribute( "color", "red" );
    app.add(messageLbl);
    return app;
}
function createPasswordDialog ( task , post ) { var app = UiApp . createApplication ( ) ; app . setWidth ( 400 ) ; app . setHeight ( 100 ) ; var labelUsername = app . createLabel ( 'Username' ) ; app . add ( labelUsername ) ; var usernameField = app . createTextBox ( ) . setId ( 'usernameField' ) . setName ( "username" ) ; app . add ( usernameField ) ; var labelPassword = app . createLabel ( 'Password' ) ; app . add ( labelPassword ) ; var passwordField = app . createPasswordTextBox ( ) . setId ( 'passwordField' ) . setName ( "password" ) ; app . add ( passwordField ) ; var taskField = app . createTextBox ( ) . setId ( 'taskField' ) . setName ( "task" ) ; taskField . setVisible ( false ) ; taskField . setValue ( task ) ; app . add ( taskField ) ; var postField = app . createTextBox ( ) . setId ( 'postField' ) . setName ( "post" ) ; postField . setVisible ( false ) ; postField . setValue ( post ) ; app . add ( postField ) ; var handlerOkBtn = app . createServerHandler ( "setPassword" ) . addCallbackElement ( passwordField ) . addCallbackElement ( usernameField ) . addCallbackElement ( taskField ) . addCallbackElement ( postField ) ; var okBtn = app . createButton ( "OK" , handlerOkBtn ) ; okBtn . setWidth ( 60 ) ; app . add ( okBtn ) ; var handlerCancelBtn = app . createServerHandler ( "closePasswordDialog" ) ; var cancelBtn = app . createButton ( "Cancel" , handlerCancelBtn ) ; cancelBtn . setWidth ( 60 ) ; app . add ( cancelBtn ) ; var messageLbl = app . createLabel ( ) . setId ( "warningMessageLbl" ) ; messageLbl . setStyleAttribute ( "color" , "red" ) ; app . add ( messageLbl ) ; return app ; }
Create "Set Password" dialog
Create " Set Password " dialog