<%@page contentType="text/html;charset=UTF-8"%>
<%--
 ******************************************************************************* 
 * $RCSfile: Wizard15.jsp,v $
 *
 * Description: 
 *
 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
 * Use of this product is subject to license terms.
 *
 *******************************************************************************
 * Source Code Control System - Header
 *
 * $Header: /sgnome/cvsroots/jds/apoc/web/manager/jsp/contexts/Wizard15.jsp,v 1.2 2006/01/20 11:46:46 slewis Exp $
 *******************************************************************************
--%> 
<%@ page language="java" %> 
<%@ page import="com.iplanet.jato.view.ViewBean" %>
<%@taglib uri="/jato.tld" prefix="jato"%> 
<%@taglib uri="/cc.tld" prefix="cc"%>

<!--
  // The wizard framework provides a javascript object instance
  // called WizardWindow_Wizard. This object has methods that
  // allow the pagelet to disable/enable buttons and set the
  // page's initial focus.
  //
  // References to the methods of WizardWindow_Wizard if not conditional
  // during runtime, that must result in effects when the page is displayed
  // must be placed in a Javascript function and that function name
  // must be assigned to WizardWindow_Wizard.pageInit.
  // The framework will call WizardWindow_Wizard.pageInit() after the
  // wizard tag has been rendered.
  //
  // script statements must appear within at least the first
  // <td> element since HTML validation objects to the appearance
  // of <script> betwee the <table> element and the first <tr>
  // element.
-->
<jato:pagelet>

<cc:i18nbundle id="apocBundle"
 baseName="com.sun.apoc.manager.resource" />

 <!-- Legend: required field indicator -->
<cc:legend name="Legend" bundleID="apocBundle"/>

<%-- For now assume we're still presenting the components in a table
     which is output by the framework and components are
     in rows and cells
--%>

 
    <tr>
        <td valign="top" align="left" rowspan="1" colspan="1">
        <script type="text/javascript">
        function wizardPageInit() {
              WizardWindow_Wizard.setFocusElementName("WizardWindow.Wizard.Wizard15View.UserDN");
              verifyRequiredField();
        }
      
        function verifyRequiredField() {
           var f = WizardWindow_Wizard.formName;
           var userDn = ccGetElement(
              "WizardWindow.Wizard.Wizard15View.UserDN", f);

           if (userDn == null) {
               WizardWindow_Wizard.setNextButtonDisabled(false, null);
           } else {
               if (userDn.value.length != 0) {
                   WizardWindow_Wizard.setNextButtonDisabled(false, null);
               } else {
                   WizardWindow_Wizard.setNextButtonDisabled(true, null);             
               }
           }
        } 
        WizardWindow_Wizard.pageInit = wizardPageInit;
        document.onkeypress = onKeyPress;
        function onKeyPress(event){
            if (event.keyCode==13) {
                var f=document.wizWinForm;
                f.elements['WizardWindow.Wizard.nextButton'].click() ;
            }
        }

        var m_OpenerTop = top.opener;
        while (m_OpenerTop.top.opener!=null) {
            m_OpenerTop = m_OpenerTop.top.opener;
        }
        m_OpenerTop = m_OpenerTop.top;

        setInterval("setWindowHandle()", 1000);
        function setWindowHandle() {
            m_OpenerTop.m_ContextWizardWindow= top;
        }        
        </script>
            <cc:label name="UserDNLabel" styleLevel="2"
                elementName="UserDNLabel"
                showRequired="true"
                bundleID="apocBundle"/>
        </td>
        <td valign="top" align="left" rowspan="1" colspan="1">
            <cc:textfield name ="UserDN" onKeyDown="javascript: setTimeout('verifyRequiredField()', 0);" bundleID="apocBundle"/>
        </td>
    </tr>
    <tr>
        <td valign="top" align="left" rowspan="1" colspan="1">
            <cc:label name="PasswordLabel" styleLevel="2"
                elementName="PasswordLabel"
                showRequired="true"
                bundleID="apocBundle"/>
        </td>
        <td valign="top" align="left" rowspan="1" colspan="1">       
            <cc:password name ="Password" onKeyDown="javascript: setTimeout('verifyRequiredField()', 0);" bundleID="apocBundle"/>
        </td>
    </tr>
</jato:pagelet>
