<%@ page import="com.novell.webaccess.common.JSPConduit"%>
<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" %>
<%@ taglib uri="/WEB-INF/iman.tld" prefix="iman" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>

<iman:stringtable bundle="FwResources"/>
<iman:stringtable bundle="DevResources"/>


<%
   JSPConduit c = JSPConduit.getJSPConduit(request);

   /*======== default values =========*/
   if(c.var("Task.displayName").equals(""))  c.set("Task.displayName", c.var("Task.defaultDisplayName"));
   if(c.var("TC.controlName").equals(""))    c.set("TC.controlName", "eDir$target");
   if(c.var("Task.initialValue").equals("")) c.set("Task.initialValue", c.var("eDir$target"));
   if(c.var("Task.nextMerge").equals(""))    c.set("Task.nextMerge", c.var("nextMerge"));

   if(c.var("Task.Icon.name").equals(""))
   {
      c.set("Task.Icon.name", c.var("Task.DefaultIcon.name"));
      c.set("Task.Icon.alt", c.var("Task.DefaultIcon.alt"));
   }
%>

<HTML>
<HEAD>
   <SCRIPT src="<c:out value="${ContextPath}" />/portal/modules/fw/javascripts/Studio.js"></SCRIPT>
   <iman:eMFrameScripts/>
   <iman:stylesheet/>

   <SCRIPT>
      function onExit()
      {
         document.form.eDir$target.value = document.getElementById("targets").value;
         document.form.submit();
      }
   </SCRIPT>
</HEAD>

<BODY>
<FORM name="form">

   <INPUT type=hidden name="taskId"            value="<%= c.var("taskId") %>">
   <INPUT type=hidden name="error"             value="dev.GenErr">
   <INPUT type=hidden name="nextState"         value="<%= c.var("Task.nextState") %>">
   <INPUT type=hidden name="eDirCommand"       value="read">
   <INPUT type=hidden name="merge"	           value="<%= c.var("Task.nextMerge") %>">
   <INPUT type=hidden name="eDirSearch"        value="<%= c.var("eDirSearch") %>">
   <INPUT type=hidden name="eDir$target"       value="">


   <%
      c.set("taskHeaderTitle", c.var("Task.displayName"));
      if (c.var("Task.Icon.name").equals("") == false)
      {
         c.set("taskHeaderIconUrl", c.var("Task.Icon.name"));
      }

      if (c.var("Task.Icon.alt").equals("") == false)
      {
         c.set("taskHeaderIconAlt", c.var("Task.Icon.alt"));
      }

      if (c.var("Task.helpFile").equals("") == false)
      {
         c.set("taskHeaderHelpFile", c.var("Task.helpFile"));
      }
   %>

   <iman:taskHeader title="${taskHeaderTitle}" iconUrl="${taskHeaderIconUrl}" iconAlt="${taskHeaderIconAlt}" helpFile="${taskHeaderHelpFile}"/><BR>
   <iman:messagebar/>


   <SPAN class="mediumtext"><iman:string key="ListTC.objects"/></SPAN><BR>
   <SELECT id="targets" size="10" style="WIDTH: 250px">
      <c:forEach items="${targets}" var="item" >
         <OPTION value="<c:out value="${item}"/>"><c:out value="${item}"/>
      </c:forEach>
   </SELECT>

   <BR><BR>
   <iman:bar/>
   <iman:button key="OK" onClick="onExit();"/>
   <iman:cancelBtn/>

</FORM>
</BODY>
</HTML>
