|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: |
JSP
<table>
<tr><td>
<select id="userPrincipals" multiple="multiple" size="8" name="userPrincipals">
<option value="----" disabled="disabled"> - - Access Assigned to User - - </option>
</select>
</td>
<td>
<table>
<tr><td><input type="button" value="< < add" onclick="javascript:addPrincipal(this.form.principals, this.form.userPrincipals);" />
</td></tr>
<tr><td><input type="button" value="remove > >" onclick="javascript:removePrincipal(this.form.userPrincipals, this.form.principals);" />
</td></tr>
</table>
<td>
<select id="principals" multiple="multiple" size="8">
<option value="----" disabled="disabled">- - Available Operations and Access - - </option>
<option>Adminstrator</option>
<option>Configuration</option>
<option>Group</option>
<option>NCS</option>
<option>NMS</option>
<option>Operator</option>
<option>Operation</option>
</select>
</td></tr>
</table>
JavaScript
<script type="text/javascript">
function save(){
var prinNames = document.getElementById('userPrincipals');
var strUserPrincipals="";
for(var r=1;r<prinNames.options.length;r++){
strUserPrincipals += prinNames.options[r].value+"ยง";
}
document.forms[0].userPrincipalsNames.value=strUserPrincipals;
document.forms[0].submit();
}
function addPrincipal(var1, var2){
moveOptions(var1, var2);
}
function removePrincipal(var1, var2){
moveOptions(var1, var2);
}
function addOption(theSel, theText, theValue){
var newOpt = new Option(theText, theValue);
var selLength = theSel.length;
theSel.options[selLength] = newOpt;
}
function deleteOption(theSel, theIndex){
var selLength = theSel.length;
if(selLength>0) {
theSel.options[theIndex] = null;
}
}
function moveOptions(theSelFrom, theSelTo){
var selLength = theSelFrom.length;
selectedText = new Array();
selectedValues = new Array();
var selectedCount = 0;
var i;
// Find the selected Options in reverse order
// and delete them from the 'from' Select.
for(i=selLength-1; i>=0; i--)
{
if(theSelFrom.options[i].selected){
selectedText[selectedCount] = theSelFrom.options[i].text;
selectedValues[selectedCount] = theSelFrom.options[i].value;
deleteOption(theSelFrom, i);
selectedCount++;
}
}
// Add the selected text/values in reverse order.
// This will add the Options to the 'to' Select
// in the same order as they were in the 'from' Select.
for(i=selectedCount-1; i>=0; i--){
addOption(theSelTo, selectedText[i], selectedValues[i]);
}
}
</script>
Form Bean
private String [] userPrincipals;
public String [] getUserPrinciples() {
System.out.println("Getting userPrinciple's value"+ userPrincipals);
return userPrincipals;
}
public void setUserPrinciples(String [] userPrincipals) {
System.out.println("setting user principle value");
this.userPrincipals = userPrincipals;
}
Action class
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
System.out.println("inside execute of AdduserAction");
AddUserForm userForm = new AddUserForm();
// System.out.println("userform's length"+ userForm.getSelected().length);
System.out.println("userform's length"+ userForm.getUserPrinciples().length);
return mapping.findForward(SUCCESS);
}
|
Advertisement
| Hall of Fame |