/* Copyright 2009 Palm, Inc.  All rights reserved. */

var ServicemessageAssistant = Class.create({
    initialize: function(message) {
    	QDLogger.log( "Servicemessage::initialize", message);
		this.appControl = Mojo.Controller.getAppController();
		this.updateFields(message);
		this.windowName = "servicemessage";
    },
    
    setup: function(){
		this.controller.get('cancel_button').addEventListener(Mojo.Event.tap, this.onCancel.bindAsEventListener(this));
		this.renderScene();
    },
    
	updateFields: function(message) {
		this.message = message;
	},
	
	renderScene: function(){
        QDLogger.log( "Servicemessage::renderScene");
		this.controller.get('service_message').update(this.message);
    },
	
	
    onCancel: function() {
		this.closeWindow();
	},
    
    
	closeWindow: function() {
		this.appControl.closeStage(this.windowName);
	},
	
});

