[Carbon-dev] svn commit r23165 - trunk/carbon-components/operation-mgt/org.wso2.carbon.operation.mgt.ui/src/main/resources/web/operation

azeez at wso2.com azeez at wso2.com
Fri Oct 31 09:01:40 PDT 2008


Author: azeez
Date: Fri Oct 31 09:01:40 2008
New Revision: 23165
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=23165

Log:
Adding operation params

Modified:
   trunk/carbon-components/operation-mgt/org.wso2.carbon.operation.mgt.ui/src/main/resources/web/operation/parameters.jsp

Modified: trunk/carbon-components/operation-mgt/org.wso2.carbon.operation.mgt.ui/src/main/resources/web/operation/parameters.jsp
URL: http://wso2.org/svn/browse/wso2/trunk/carbon-components/operation-mgt/org.wso2.carbon.operation.mgt.ui/src/main/resources/web/operation/parameters.jsp?rev=23165&r1=23164&r2=23165&view=diff
==============================================================================
--- trunk/carbon-components/operation-mgt/org.wso2.carbon.operation.mgt.ui/src/main/resources/web/operation/parameters.jsp	(original)
+++ trunk/carbon-components/operation-mgt/org.wso2.carbon.operation.mgt.ui/src/main/resources/web/operation/parameters.jsp	Fri Oct 31 09:01:40 2008
@@ -11,36 +11,62 @@
     List<Parameter> params = client.getOperationParameters(serviceName, opName);
 %>
 <script language="JavaScript">
-    function removeOperationParameter(parameter){
-        location.href= "removeOperation.jsp?serviceName=<%=serviceName%>&opName=<%=opName%>&parameter=" + parameter;
+    function removeOperationParameter(parameter) {
+        location.href = "removeOperation.jsp?serviceName=<%=serviceName%>&opName=<%=opName%>&parameter=" + parameter;
 
         //TODO: Use AJAX Tags code
 
     }
 
-    function addOperationParameter(){
-        
+    function addOperationParameter() {
+
+        var paramName = prompt("Operation parameter name", "");
+        if(document.getElementById(paramName) != null){
+            alert("Operation parameter " + paramName + " already exists");
+            return;
+        }
+
+        // rows = rows + 1;
+
+        //add a row to the rows collection and get a reference to the newly added row
+        var newRow = document.getElementById("paramTable").insertRow(-1);
+
+        //        newRow.className = "even";
+
+        //add 6 cells (<th>) to the new row and set the innerHTML to contain text boxes
+        var oCell = newRow.insertCell(-1);
+        oCell.innerHTML = paramName;
+
+        oCell = newRow.insertCell(-1);
+        oCell.innerHTML = "<textarea rows=\"3\" cols=\"40\"></textarea>";
+
+        oCell = newRow.insertCell(-1);
+        oCell.innerHTML =
+        "<a title='Remove Operation Parameter'" +
+        "onclick=\"removeOperationParameter('"+ paramName +"');return false;\"" +
+        "class='remove_param' href='#'>REMOVE</a>";
     }
 </script>
-<form>
+<form action="TODO">
     <fieldset>
         <legend>Edit operation specific parameters</legend>
-        <table class="emptyTable">
+        <table class="emptyTable" id="paramTable">
             <tbody>
                 <%
                     for (Parameter param : params) {
                 %>
                 <tr style="clear: both;">
-                    <td><label style="width: 25%;"><%= param.getName()%>
-                    </label></td>
+                    <td>
+                        <label id="<%= param.getName()%>"><%= param.getName()%></label>
+                    </td>
                     <td>
                         <textarea rows="3" cols="40">
                             <%= param.getValue()%>
                         </textarea>
                     <td>
-                        <a alt="Remove" title="Remove Operation Parameter"
+                        <a title="Remove Operation Parameter"
                            onclick="removeOperationParameter('<%= param.getName()%>');return false;"
-                           id="enableMTOM" class="remove_param" href="#">
+                           class="remove_param" href="#">
                             REMOVE
                         </a>
                     </td>
@@ -61,8 +87,8 @@
 
 										processOperationParameterConfigUpdate(arrayOfNames,arrayOfValues);
 										return false;
-									" value="update" type="button"><input
-                onclick="javascript:addOperationParameter();return false;" value="add"
-                type="button"></div>
+									" value="update" type="button">
+            <input onclick="addOperationParameter();return false;" value="add" type="button">
+        </div>
     </fieldset>
 </form>
\ No newline at end of file



More information about the Carbon-dev mailing list