Trying to dynamically populate html:options

I am using iframe.
on the first frame the user inputs letters and the database is searched for anything that starts with those letters.
<html:text property="usersInput"/>
<html:submit value="search" onclick="middle.document.forms[0].property='list'"/>
the second frame "middle" is suppose to display the results of the search.
html:select property="list">
<html:options property="list"/>
</html:select>
of course with this code the second frame "middle" gives an err msg, because list is null.
Is there anyway to get around this so that initially the select list that appears on the pages is empty and then when the search is done (button is clicked) the list will populate with the results?

I guess there must be something wrong with my question :( no one is helping me. Well let me ask this...
With formbeans and iframes...
Is the information process while in the <html:form>...</html:form> or once it leaves the form? because now I'm doing the search in one frame and then onclick="..." I'm calling another frame to display the results of the search using <html:select><html:options>...</html:select>, but I keep getting an err msg "null pointer".
It seems like the information from the first iframe, either has not been "processed" or got "deleted" by the formbean, when the second frame tries to access it.
Can someone please give me an idea of what's going on. I'VE HIT A WALL!!!!

Similar Messages

  • Trying to dynamic include HTML into a JSP

    All,
    I am trying to include an HMTL file into a JSP file. I wish to do this dymanically. So, the following is not an option:
    <%@ include file="relativeURL" %>
    So, I am forced to resort to such measures as the following:
    <jsp:include page="<%=myPath%>"/>
    However, I get the following error:
    java.lang.IllegalStateException: Response has already been committed
         at java.lang.Throwable.fillInStackTrace(Native Method)
         at java.lang.Throwable.fillInStackTrace(Compiled Code)....
    I tried it like this:
    <jsp:include page="<%=myPath%>" flush="true"/>
    I encoutered the same result. I have JSP 1.2 running Tomcat 3.1 with Apache 1.3.14, all on SunOS. Thanks in advance for any help.
    Nicholas

    One of the worst error messages you can get is the IllegalStateException. It simply means that an attempt has been made to forward or include but only a portion of the include was sent. In a situation like this the best way to handle the dynamic page content is to include it from a Servlet by sending the information you need through beans. Including the Servlet rather than the dynamic path would clear those errors right up. One thing to keep in consideration is that you can't just get the page and display it, you have to buffer it in so the state can be kept alive without timing out like it does with the dynamic include.
    Hope that helps. Been there, done that, I know how frustrating the error was.

  • Populate html combo with database

    Hi all, I´m trying to use that example of Multi-select-Combobox , but i must populate the options of the combo with the database select result, not static values,..
    that is the code for the options i´m using at the moment:
    <div class="examples">
    <label class="examples">Second Example of MultiSelect (with width options)</label>
    <select id="methods" name="methods" multiple="multiple" size="4" title="Four" class="arc90_multiselect fieldwidth-20em valuewidth-600px">
         <option value="flex">OPTION1</option>
         <option value="ajax">OPTION2</option>
         <option value="iframes">OPTION3</option>
    </select>
    </div>     
    how can I populate this with my table values?
    that is the site where i get the multiselect - if anyone need it. http://lab.arc90.com/tools/multiselect/
    tnks for help.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta name="generator" content="HTML Tidy for Java (vers. 26 Sep 2004), see www.w3.org" />
    <title></title>
    <title>arc90 lab | tools: MultiSelect</title>
    <style type="text/css">
    /*<![CDATA[*/
                            @import "http://lab.arc90.com/tools/c/css/tool_global.css";     /* Style for this page */
                            .a9multiselect {
                                    width: 9.9em;
                                    font-family: Arial, Helvetica, sans-serif;
                                    position: relative;
                                    height: 22px;
                                    padding: 0;
                                    margin: -.05em 0 1em 0;
                                    border: 0;
                            .a9multiselect .expcol-click, .a9multiselect .expcol-click-open {
                                    background-color: #fff;
                                    border: 1px solid #999;
                                    padding: 0;
                                    margin: 0;
                                    cursor: default;
                                    min-width: 9.8em;
                            .a9multiselect div.expcol-click {
                                    position: absolute;
                                    z-index: 104;
                                    height: 20px;
                            .a9multiselect div.expcol-click-open {
                                    border-bottom: 1px solid #fff;
                            .a9multiselect .title {
                                    font-size: .8em;
                                    height: 1.3em;
                                    line-height: 1.2em;
                                    overflow: hidden;
                                    padding: .3em 1.1em .1em .5em;
                                    background: white url(images/multiselect.gif) no-repeat top right;
                            .a9multiselect .title:hover {
                                    background: white url(images/multiselect-hover.gif) no-repeat top right;
                            .expcol-body {
                                    position: absolute;
                                    z-index: 106;
                                    min-height: 1em;
                                    background: #e9f3f8;
                                    padding: .1em;
                                    display: block;
                                    font-size: 75%;
                                    display: none;
                                    margin-top: -1px;
                                    border: 1px solid #999;
                            .expcol-body ul {
                                    overflow: auto;
                                    min-height: 1em;
                                    min-width: 20em;
                                    margin: 0;
                                    padding: 0;
                            .expcol-body li { margin: 0 0 .2em 0; list-style:none; }
                            .expcol-body li:hover {
                                    background: #ddd;
                            .arc90_multiselect {
                                    width: 12.5em;
                                    height: 1.35em;
                                    visibility: hidden;
                            .a9selectall {
                                    border-bottom: 1px solid #ccc;
                            /* Styles for page layout */
                            DIV.examples {
                                    margin: 0 0 2em 0;
                                    width: 17em;
                                    border: 1px solid #e9e9e9;
                                    padding: .3em;
                            DIV.examples LABEL.examples {
                                    display: block;
                                    margin: 0 0 .2em 0;
                    /*]]>*/
    </style>
    </head>
    <body>That is the .js file: ---------------------------------------------------------
    var a$ = {}; // arc90 namespace functions
    a$.c = 0;
    a$.openSelect = null;
    a$.NO_SELECTION     = 'No selection';
    a$.SELECTED          = 'Options selected';
    a$.SELECT_ALL     = 'Select All';
    a$.SelectAllMin     = 6;
    a$.WhenToUse     = 'class'; // class: based on class arc90_multiselect existing | multiple: based on multiple attributte exists | all: both single and multiple
    a$.msSeparator     = '|';
    a$.appName = navigator.appVersion.toLowerCase();
    a$.isIE = document.all && a$.appName.indexOf('msie') >= 0;
    a$.isSafari = a$.appName.indexOf('safari') >= 0;
    a$.msBodyTimer = null;
    a$.multiSelectCreate = function(o) {
    // can be called directly with the id or object passed in as the first argument
    //  or if a$.WhenToUse is set to class or multiple
         var S = null;
         if (o != null)
              S = [a$.isString(o)? a$.e(o): o];
         else
              S = document.getElementsByTagName('select');
         for (var i = 0, l = 1; i < l; i++) { //S.length
              var s = S;
              if (s != null && ((a$.WhenToUse == 'class' && s.className.indexOf('arc90_multiselect') >= 0) || (a$.WhenToUse == 'multiple' && s.multiple) || (a$.WhenToUse == 'all'))) {
                   var title = s.title, id = s.id, name = s.name;
                   var div = a$.newNode('div', 'a9multiselect-'+ id, 'a9multiselect');
                   var span = a$.newNode('div', 'a9multiselect-'+ id +'-title', 'title');
                   span.setAttribute('title', title);
                   var expcol = a$.newNode('div', 'a9multiselect-click-'+ id, 'expcol-click', '', span, div);
                   var ul = a$.newNode('ul');
                   if (a$.isIE)
                        ul.style.width = '20em';
                   var expbody = a$.newNode('div', 'a9multiselect-body-'+ id, 'expcol-body', '', ul);
                   expbody.style.display = 'none';
                   // Timer Events to auto-close the drop-down when not being used
                   a$.newEvent(div, 'mouseout', function(event) { a$.msBodyTimer = setTimeout('a$.closeSelect("'+ id +'")', 1500); });
                   a$.newEvent(div, 'mouseover', function(event) { clearTimeout(a$.msBodyTimer); a$.msBodyTimer = null; });
                   a$.newEvent(expbody, 'mouseout', function(event) { a$.msBodyTimer = setTimeout('a$.closeSelect("'+ id +'")', 1500); });
                   a$.newEvent(expbody, 'mouseover', function(event) { clearTimeout(a$.msBodyTimer); a$.msBodyTimer = null; });
                   a$.newEvent(ul, 'mouseout', function(event) { clearTimeout(a$.msBodyTimer); a$.msBodyTimer = null; });
                   a$.newEvent(ul, 'mouseover', function(event) { clearTimeout(a$.msBodyTimer); a$.msBodyTimer = null; });
                   if (a$.isIE)
                        var hidden = a$.newNode('<input type="hidden" name="'+ name +'" title="'+ title +'" />', name, '', '', null, div);
                   else {
                        var hidden = a$.newNode('input', name, '', '', null, div);
                        hidden.setAttribute('type', 'hidden');
                        hidden.setAttribute('name', name);
                        hidden.setAttribute('title', title);
                   // insert select all option
                   var m = s.options.length;
                   if (s.multiple && m >= a$.SelectAllMin) {
                        var alli = a$.newNode('li', 'a9selectall-'+ id, 'a9selectall', '', null, ul);
                        if (a$.isIE) {
                             var allbx = a$.newNode('<input type="checkbox" name="a$-'+ a$.c +'" id="a$-'+ a$.c +'" alt="'+ id +'" />', 'a$-'+ (a$.c++), '', '', null, alli);
                             var allbl = a$.newNode('<label for="'+ allbx.id +'" />', '', '', a$.SELECT_ALL, null, alli);
                        } else {
                             var allbx = a$.newNode('input', 'a$-'+ a$.c++, '', '', null, alli);
                             allbx.setAttribute('type', 'checkbox');
                             allbx.setAttribute('alt', id);     
                             var allbl = a$.newNode('label', '', '', a$.SELECT_ALL, null, alli);
                             allbl.setAttribute('for', allbx.id);
                        // call to function to get every checkbox under 'a9multiselect-'+ id a$.T('input', a$.e('a9multiselect-'+ id))
                        eval("a$.newEvent(allbx, 'click', function () { a$.selectAll(a$.e('"+ allbx.id +"')); a$.chk(a$.e('"+ allbx.id +"')); });");
                   var sel = 0;
                   for (var j = 0; j < m; j++) {
                        var value = s.options[j].value, text = s.options[j].text;
                        var li = a$.newNode('li', 'a9-li-'+ a$.c, '', '', null, ul);
                        var d = a$.newNode('div', '', '', '', null, li);
                        var chkType = s.multiple? 'checkbox': 'radio';
                        if (a$.isIE) {
                             var checked = '', onclick = '';
                             if (s.options[j].selected == true) {
                                  checked = ' checked="checked"';
                                  // needed to allow checked entries to be imeadiately activated, but won't work when actually clicked
                                  onclick = " onclick=\"a$.multiSelect(this, '"+ value +"', 'a9multiselect-"+ id +"');\"";
                                  sel++;
                             var chkbx = a$.newNode('<input title="'+ s.options[j].text +'" name="a9multiselect-options-'+ id +'" alt="'+ id +'" type="'+ chkType +'"'+ checked + onclick +' value="'+ value +'" />', 'a$-'+ a$.c++, '_a9checkbox', '', null, li);
                        } else {
                             var chkbx = a$.newNode('input', 'a$-'+ a$.c++, '_a9checkbox', '', null, li);
                             chkbx.setAttribute('type', chkType);
                             chkbx.setAttribute('value', value);
                             chkbx.setAttribute('alt', id);
                             chkbx.setAttribute('title', s.options[j].text);
                             chkbx.setAttribute('name', 'a9multiselect-options-'+ id);
                             if (s.options[j].selected == true) {
                                  chkbx.checked = true;
                                  // needed to allow checked entries to be imeadiately activated, but won't work when actually clicked
                                  chkbx.onclick = "a$.multiSelect(this, '"+ value +"', 'a9multiselect-"+ id +"');";
                                  sel++;
                        a$.newEvent(chkbx, 'click', function(event) {
                             a$.cancelbubble(event); // cancel so li event doesn't get activated
                             if (a$.isIE) // IE has trouble with 'this' being used here
                                  var t = a$.e(document.activeElement.id);
                             else
                                  var t = this;
                             a$.multiSelect(t, t.value, 'a9multiselect-'+ t.alt);
                             a$.chk(t);
                             // uncheck the select all
                             allbx = a$.t('input', a$.e('a9selectall-'+ t.alt));
                             if (allbx) a$.chk(allbx, (allbx.checked = false));
                        a$.newEvent(li, 'click', function() {
                             var t = a$.e('a$-'+ this.id.slice('a9-li-'.length));
                             t.checked = !t.checked;
                             a$.multiSelect(t, t.title, 'a9multiselect-'+ t.alt);
                             a$.chk(t);
                        if (a$.isIE)
                             var label = a$.newNode('<label onclick="a$.cancelbubble(event);" for="'+ chkbx.id +'" />', '', '', text, null, li);
                        else {
                             var label = a$.newNode('label', '', '', text, null, li);
                             label.setAttribute('for', chkbx.id);
                             a$.newEvent(label, 'click', function(event) { a$.cancelbubble(event); }); // cancel so li event doesn't get activated
                        // Hide Radio Buttons for Firefox
                        if (chkType == 'radio' && !a$.isIE) {
                             chkbx.style.visibility = 'hidden';
                             label.style.marginLeft = '-18px';
                   if (sel == m && allbx != null)
                        allbx.setAttribute('checked', true);
                   else if (sel == 0)
                        span.innerHTML = a$.NO_SELECTION;
                   var bs = a$.node_before(s);
                   bs.appendChild(div);
                   bs.appendChild(expbody);
                   // check the className of s to look for fieldwidth- and valuewidth-
                   // if a value is specified without format it's default is pixels
                   // options are value: dynamic, 30, 30px, 30em, etc...
                   // dynamic will only have a min-width value set
                   // if valuewidth is missing, then it's min-width is set to fieldswidths (either default or specified using a$.getStyle)
                   var fieldwidth = s.className.toLowerCase().indexOf('fieldwidth-');
                   var valuewidth = s.className.toLowerCase().indexOf('valuewidth-');
                   if (fieldwidth >= 0) {
                        var q = s.className.slice(fieldwidth);
                        fieldwidth = (q.slice(0, q.indexOf(' ') < 0? q.length: q.indexOf(' '))).slice('fieldwidth-'.length);
                        fieldwidth = parseFloat(fieldwidth) == fieldwidth? fieldwidth+'px': fieldwidth;
                   } else fieldwidth = '';
                   if (valuewidth >= 0) {
                        var q = s.className.slice(valuewidth);
                        valuewidth = (q.slice(0, q.indexOf(' ') < 0? q.length: q.indexOf(' '))).slice('valuewidth-'.length);
                        valuewidth = parseFloat(valuewidth) == valuewidth? valuewidth+'px': valuewidth;
                   } else valuewidth = '';
                   if (fieldwidth != 'dynamic') {
                        expcol.style.width = fieldwidth;
                        div.style.width = fieldwidth;
                   if (valuewidth != 'dynamic')
                        expbody.style.width = valuewidth;
                   expbody.style.minWidth = a$.getStyle(expcol, 'width');
                   if (a$.isIE || a$.isSafari)
                        expbody.style.marginTop = '-1.4em';
                   // remove original select
                   s.parentNode.removeChild(s);
                   // when done perform prep functions
                   a$.expcol(div);
                   a$.multiSelectPrep(div);
    a$.selectAll = function(o) {
         var I = a$.T('input', a$.e('a9multiselect-body-'+ o.getAttribute('alt')));
         for (var i = 0, m = I.length; i < m; i++) {
              var c = I[i];
              if (c.type == 'checkbox' && c.className == '_a9checkbox') {
                   c.checked = o.checked;
                   a$.multiSelect(c.id, c.value, 'a9multiselect-'+ c.getAttribute('alt'));
                   a$.chk(c);
    a$.multiSelect = function(chk, value, parent) {
         var pid = parent.slice('a9multiselect-'.length);
         var to = a$.e(pid);
         chk = a$.isString(chk)? a$.e(chk): chk;
         if (chk.checked) {
              chk.type == 'checkbox'? to.value += a$.msSeparator + value: to.value = value;
         } else
              eval("to.value = to.value.replace(/"+ value +"/g, '');");
         var title = a$.e(parent+'-title');
         // cleans up clogged pipes
         to.value = to.value.replace(/\|{3}/g, a$.msSeparator);
         to.value = to.value.replace(/\|{2}/g, a$.msSeparator);
         to.value = to.value.replace(/^\|(.*)/g, '$1');
         to.value = to.value.replace(/(.*)\|$/g, '$1');
         var cbs = a$.T('input', a$.e('a9multiselect-body-'+ pid)), x = '', v = a$.NO_SELECTION;
         var vals = '', c = 0;
         for (var i = 0, l = cbs.length; i < l; i++)
              if (cbs[i].className == '_a9checkbox' && cbs[i].checked) {
                   vals += cbs[i].title +' | ';
                   c++;
                   if (x == 0) {
                        v = cbs[i].title;
                   } else {
                        v = (x+1) +' '+ a$.SELECTED;
                   x++;
         vals = c > 1? vals.slice(0, vals.length-3): v;
         title.innerHTML = v;
         t = a$.e(pid).title;
         title.title = t == ''? vals: t +' : '+ vals;
    a$.multiSelectPrep = function(parent) {
         if (parent == null) parent = document;
         var pid = parent.id.slice('a9multiselect-'.length);
         var P = a$.T('input', a$.e('a9multiselect-body-'+ pid)), toObj = a$.e(parent.id.slice('a9multiselect-'.length)), to = toObj.value, newto = '';
         for (var i = 0, l = P.length; i < l; i++) {
              if (P[i].type != null && P[i].className == '_a9checkbox') {
                   a$.chk(P[i], false);
                   if (P[i].checked == true) {
                        a$.chk(P[i]);
                        // autoselect and populate the value for default checked items
                        var val = P[i].value;
                        a$.multiSelect(P[i], val, parent.id);
         if (to != '') { // remove any duplicates when reloading with firefox
              to = to.split(a$.msSeparator).sort();
              for (var i = 1, l = to.length; i < l; i++)
                   if (to[i] == to[i-1])
                        to[i-1] = null;
              to = to.toString().replace(/,,/g, ',').replace(/,/g, a$.msSeparator);
              toObj.value = to.indexOf(a$.msSeparator) == 0? to.slice(1): to.length > 1 && to.lastIndexOf(a$.msSeparator) == to.length-1? to.slice(0, to.length-1): to;
    a$.chk = function(c, force) {
         var n = a$.node_after(c);
         if (n != null && n.style) {
              if ((force != null && force) || c.checked) {
                   n.style.fontWeight = 'bold';
                   if (c.type == 'radio') {
                        var R = c.form[c.name];
                        for (var i = 0, l = R.length; i < l; i++) {
                             var r = R[i];
                             if (r.id != c.id)
                                  a$.node_after(r).style.fontWeight = 'normal';
                        a$.expcolclick('a9multiselect-click-'+ c.alt);
              } else {
                   n.style.fontWeight = 'normal';
    a$.closeSelect = function(id) {
         clearTimeout(a$.msBodyTimer);
         a$.msBodyTimer = null;
         var obj = a$.e('a9multiselect-body-'+ id);
         var vis = a$.getStyle(obj, 'display');
         if (vis == 'block') {
              //obj.style.display = 'none';
              a$.expcolclick(a$.e('a9multiselect-click-'+ id));
    a$.is_ignorable = function(nod) {
    return (nod.nodeType == 8) || // A comment node
    ((nod.nodeType == 3) && !(/[^\t\n\r ]/.test(nod.data))); // a text node, all ws
    a$.node_before = function(sib) {
         if (a$.isString(sib))
              sib = a$.e(sib);
         while ((sib = sib.previousSibling)) {
              if (!a$.is_ignorable(sib)) return sib;
         return null;
    a$.node_after = function(sib) {
         while (sib != null && (sib = sib.nextSibling)) {
              if (!a$.is_ignorable(sib)) return sib;
         return null;
    a$.expcol = function(parent) {
         var x = a$.T("div", parent);
         for (var i = 0, l = x.length; i < l; i++)
              if (x[i].className.indexOf("-click") >= 0) x[i].onclick = a$.expcolclick;
    a$.expcolclick = function(o, force) {
         var c = null;
         if (a$.isIE)
              var t = this.id? this: a$.isString(o)? a$.e(o): o;
         else
              var t = this.toString().toLowerCase().indexOf('element') >= 0? this: a$.isString(o)? a$.e(o): o;
         c = a$.e('a9multiselect-body-'+ t.id.slice('a9multiselect-click-'.length));
         c.style.position = 'absolute';
         if (c != null && c.style && c.style.display != "block") {
              if (t.className.indexOf("-open") > 0) return;
              t.className = t.className +"-open";
              c.style.display = "block";
              if (force == null || force == false) {
                   if (a$.openSelect && a$.openSelect.id != t.id)
                        a$.expcolclick(a$.openSelect, true);
                   a$.openSelect = t;
         } else if (c != null && c.style) {
              t.className = t.className.substr(0, t.className.length-5);
              c.style.display = "none";
              if (force == null || force == false) {
                   a$.openSelect = null;
    a$.isString = function(o) { return (typeof(o) == "string"); }
         tp: type (eg 'div')
         id: id
         cs: class OR style (if a : exists it is a style (color: pink; display: block;), not a class)
         tx: text to display inside the node
         cd: any child node with which to place inside
         p: parent node to attach to
    a$.newNode = function(tp, id, cs, tx, cd, p) {
         var node = document.createElement(tp);
         if (tx != null && tx != '')
              node.appendChild(document.createTextNode(tx));
         if (id != null && id != '')
              node.id = id;
         if (cs != null && cs != '' && cs.indexOf(':') < 0)
              node.className = cs;
    // inline styles removed to limit code to this specific task
    //     else if (cs != null && cs != '' && cs.indexOf(':') > 0)
    //          a$.setStyles(node, cs);
         if (cd != null)
              node.appendChild(cd);
         if (p != null && p != '')
              (a$.isString(p)? a$.e(p): p).appendChild(node);
         return node;
    // specific element via id
    a$.e = function(id, source) {
         if (source != null)
              return source.getElementById(id);
         return document.getElementById(id);
    // all elements with tag
    a$.T = function(tag, source) {
         if (source != null)
              return source.getElementsByTagName(tag);
         return document.getElementsByTagName(tag);
    // the first element with tag
    a$.t = function(tag, source) {
         if (source != null)
              var T = source.getElementsByTagName(tag);     
         else T = document.getElementsByTagName(tag);
         if (T.length > 0)
              return T[0];
    // all elements with class
    a$.C = function(classname, source) {
         if (source != null)
              return source.getElementsByClassName(classname);
         return document.getElementsByClassName(classname);
    a$.getStyle = function(obj, styleIE, styleMoz) {
         if (styleMoz == null) styleMoz = styleIE;
         if (a$.isString(obj)) obj = a$.e(obj);
         var s = '';
         if (window.getComputedStyle)
              s = document.defaultView.getComputedStyle(obj, null).getPropertyValue(styleMoz);
         else if (obj.currentStyle)
              s = obj.currentStyle[styleIE];
         if (s == 'auto')
              switch (styleIE) {
              case 'top':          return obj.offsetTop;          break;
              case 'left':     return obj.offsetLeft;          break;
              case 'width':     return obj.offsetWidth;          break;
              case 'height':     return obj.offsetHeight;     break;
         else
              return s;
    a$.newEvent = function(e, meth, func, cap) {
         if (a$.isString(e))     e = a$.e(e);
         if (e.addEventListener){
              e.addEventListener(meth, func, cap);
         return true;
         }     else if (e.attachEvent)
              return e.attachEvent("on"+ meth, func);
         return false;
    // Start things off
    a$.newEvent(window, 'load', function () {
         var x = a$.T('select');
         for (var i = 0, l = x.length; i < l; i++) {
              a$.multiSelectCreate(x[i]);
    a$.cancelbubble = function(e) {
         if (a$.isIE) e = event;
         if (e) e.cancelBubble = true;
    function noop() {
         return null;     
    Edited by: brugo on 07/12/2009 10:47
    Edited by: brugo on 07/12/2009 10:49
    Edited by: brugo on 07/12/2009 10:50
    Edited by: brugo on 07/12/2009 10:51
    Edited by: brugo on 07/12/2009 11:03

  • How to add a value(text) from javascript to html:option tag .....

    How to populate the <html:option> tag dynamically
    I have a tree view, in tree view tag ( <layout:maeuItem> tag i have written "onclick " event )
    <layout:menuItem key="${agrovoc.AGURI}" link="#"
                                       onClick="return copyVal(this)">
    <script language="javascript" type="text/javascript">
                   function copyVal(obj){
                   str= obj.innerHTML; 
                   l = str.length-4;
                   xyz= str.substring(12,l);
                   document.getElementById('agrovoc').value =document.getElementById('agrovoc').value + xyz+'\n';
                   </script>Here "xyz" contains the Term ( the term clicked in the tree view) now i want add these terms ( clicked in tree view) into <html: option> tag.... how to do this.. plz give me some ideas
    <html:select  property="agrovocbuffer" size="10" >
                        <html:option value="" styleId="agrovoc1"></html:option>
                        </html:select>

    Hi,
    i have tried with this, it's works fine... but when i click on the next page ( i mean 2 or 3 page etc ) the content of <html:option> are erasing (deleting).. i wanted those terms wht i have selected in the 1st page to remain in <html:option> when i click on 2 nd page also...
    Tree view code
    <layout:menuItem key="${agrovoc.AGURI}" link="#"
                                       onClick=" copyVal(this)">JavaScript
    <script language="javascript" type="text/javascript">
                    var i=0;     
                    var myArray=new Array();
                   function copyVal(obj){
                        var flag=0;     
                   str= obj.innerHTML; 
                   l = str.length-4;
                   xyz= str.substring(12,l);
                   while (xyz != null) {
                   for( var l=0;l<myArray.length;l++){
                   if( myArray[l]==xyz){flag=1;alret("The Term is already selected.");}
                   if(flag!=1){
                   document.getElementById('agrovoc').options[i] =new Option(xyz,xyz);
                   myArray=xyz;
                   i++;
                   //alert(i);
                   xyz=null;
                   function del(){
                                  var oc=document.getElementById('agrovoc').options;
                                  //alert(oc.length);
                                  firstBox = document.getElementById('agrovoc');
                                  selectedOption = firstBox.options[firstBox.selectedIndex].value;
                                  selected = firstBox.options[firstBox.selectedIndex].index;
                                  //alert(selected);
                                  for( var l=0;l<myArray.length;l++){
                   if( myArray[l]==selectedOption){myArray[l]="";}
                                  firstBox.options[firstBox.selectedIndex] = null;
                                  var oc=document.getElementById('agrovoc').options;
                                  //alert(oc.length);
                                  for(var x=selected;x<oc.length;x++,selected++)
                                  document.getElementById('agrovoc').options[x] =new Option(firstBox.options[selected].value);
                                  i=oc.length;
                   </script>
    <html:select> code<div align="left" id="hopt">     
                   <td valign="top">
                   <logic:present name="hcount">
                        <html:select property="agrovocbuffer" size="15" styleId="agrovoc" multiple="true" style="width:200px;" >
                        <html:option value="" ></html:option>
                        </html:select><html:button property="button" onclick="del()"> DEL</html:button>
                   </logic:present>
                   </td>
                   </div>
    And all the above code is in <html:form> tag & i have written a custom pagination page
    Now i want  all terms which are in <html:option> remain  in options when i goto 2 nd page..
    how to do this? In the DOM inspector i'm getting the options, but when see the source HTML there are no <html:options>.. when click on the 2 page link the terms which are in <html:option> are not going to the "Action" class ..  :(
    how to do this .. any idea plz..?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • ITS 620 - how to create a service file for SAPGUI for HTML option

    Hi,
    We have the following configuration :
    ITS 620 installed
    IIS webserver
    NTLM Authentication on webserver
    SAP 46C
    We have some reports that use the IACs option of creating ITS reports and we are able to create the service files using webstudio where we can save a service id and password so that when the ITS page is called, it logs on the user directly into the system.
    Now, we are trying to create a new ITS page for a custom Z transaction and would like to use the SAPGUI for HTML option so that we do not have to use Webstudio to create and modify the HTML pages.
    When I call the ITS page for the new transaction, it brings up the logon screen for the user, which we want to avoid. If I create a new service file for this Z transaction without any HTML pages then I get an error.
    Is there a way to copy the WEBGUI.SRVC file to a custome SRVC file, I tried to create to copy it to a test file called ZTEST.SRVC for my test transaction called ZTEST and now I get an error.
    thanks in advance
    N.S.

    Hello N.S.
    You can create a service file, like ZSERVICE.SRVC.  The parameters should be:
    ~webgui 1
    ~transaction ztransaction
    ~client  001
    ~login   username
    ~password  password
    ~language  EN
    The "~webgui 1" allows the ITS to use the Webgui to dynamically generate the page (no IAC needed.)
    The "~transaction" is the transaction code of your service.
    The "~client" is the client number.
    The "~login" is the username.
    The "~password" is the user's password.
    the "~language" is the language for the users.
    Note that the last four are required for automatic logon.  If end users use a variety of languages though the ~language can be prepended to the URL to support different languages.  (Leave it blank in the srvc file then.)
    Edgar

  • Dynamic Text - HTML

    I have created a Dynamic text box and selected the "Render
    text as HTML" option. Right now all I am trying to do is get the
    bold tag to work, so in my test text box I have the following:
    <b>Bold</b>
    Not Bold
    When I do a ctrl-enter I don't get an HTML representation I
    just get the text as it is pasted here. This is a new empty
    document and is using Flash CS3 Professional.

    I saw this tutorial, thouht it may help:
    http://www.smartwebby.com/Flash/html_textbox.asp
    Sean

  • Populate html:select with List of Strings

    Hello everyone,
    I need to populate an html:select with a List of Strings. The list I receive is not composed of objects, only Strings. I want each of these Strings to be an option of the select.
    I've tried this way:
                    <html:select property="tamanho" >
                       <html:options collection="gradeTamanho"/>
                    </html:select>Didn't work. Does anyone know how?
    thanks

    Does anyone know how to do this? There has to be someway that I can populate an Option List with a list of contentIDs in a folder. Maybe using CMIS?

  • Best approach to store collection for html:options

    I am using struts to develop my web application. I am trying to figure out the best way to store a Collection for html:options inside a html:select element.
    My JSP page has a html:select statement which lists all the groups in a system. I have a member variable called getGroupNames() in my ActionForm class. When the JSP page is first requested, I populate the groupNames attribute of ActionForm class with a list of names. The html:options reads the groupNames attribute and lists all the group names.
    The problem: Once the user selects a group name and then submits, if there is any validation problems in other fields in the JSP, I build ActionErrors object and forward the request back to the same JSP. However, now I get an error saying the groupNames is NULL.
    Option1: One way to avoid this error is to AGAIN populate the groupNames list if there is a validation problem.
    Option 2: Another way is to store the list of groupnames in a seperate bean (and NOT as an attrib of the ActionForm) and store it in the REQUEST scope. This way I think the I don't have reload the groupName list in case of a validation failure.
    Could someone please help me in deciding which will be the right approach.
    Thanks

    Hi,
    1,2 billion rows and each row of 50 bytes - approximately 56 GB around. Huge segment. As you stated it's an OLTP database, can you check across what is the percentage or maximum number of queries with developers - important column which they are querying across and application dealt with.
    Based on the input of the above question we can check how best we can partition and columns we are dealing. Perhaps you have stated across historical data. From this kindly verify across what is the % of users check or go-back to historical information - based on that we can estimate the number of partitions we can create on segment and looking forward, you must estimate the % of increase of new/incoming data and day/month wise. so that you might be plan what can we do the old historical data.
    HTH
    Note- Part of Performance dealt with writing efficient tuned queries
    - Pavan Kumar N

  • List of Map objects with html:options collection

    Hello All,
    I'm trying to get an arraylist of map objects to display dynamically as a dropdown select with html:options collection. I've spent hours on this and I haven't been able to get it working. Any ideas as to how this is done?
    Thanks,
    James

    An arraylist of Map objects?
    What is it that you want to show up in the dropdown box - all the name value pairs included in all the maps of the list?
    Assuming with a Map the "key" is what you want submitted and the "value" is what to display to the user
    Definitely sounds like a double loop structure is required. One to loop through all the maps. Another to generate all the options in each map.
    This one does it at the basic level of things
    <c:forEach var="map" items="${listOfMaps}">
      <c:forEach var="entry" items="${map}">
        <html:option value="${entry.key}">${entry.value}</html:option>
      </c:forEach>
    </c:forEach>The following might also work.
    <c:forEach var="map" items="${listOfMaps}">
      <html:options collection="map" property="key" labelProperty="value"/>
    </c:forEach>Cheers,
    evnafets

  • Dynamically Populate a Panel Dashboard in a Fragment

    I am working with a customized Panel Dashboard in a fragment (jsff).  The user can customize the dashboard (re-order panel boxes, define number of columns, add/remove panel boxes, etc.) and our goal is to persist these customizations so they are available across different sessions.  To achieve this, I created several database tables for these customizations and tied them to the user table.  When the user opens the application, the dashboard fragment is the first fragment to display.  I am loading the information from the database then constructing the Panel Dashboard.  The dashboard starts out with a static set of Panel Boxes (as seen in main_dashboard.jsff below), then based on the data, I re-order them and set rendered equal to false for panel boxes which the user removed.
    My problem is I need to do this before the page is rendered.  To do this, I am calling the customization method from the constructor of my backing bean.  The RichPanelDashboard which I bind the UI Component to is not yet available.  I have tried several things which did not work, including:
    - Adding the @PostConstruct annotation to my customization method.
    - Pulling the component from the View Root: RichPanelDashboard mainDashboard = ( RichPanelDashboard )FacesContext.getCurrentInstance().getViewRoot().findComponent( "mainDash" );
    - Added a "preRenderComponent" event to the page: <f:event type="preRenderComponent" listener="#{main_dashboard.setupCustomDashboard}"/> (after a web search, it appears the f:event tag is not supported in ADF Fragments).
    I've encountered this problem in the past with different UI Components.  Most notably, I needed to populate a SelectOneListBox before the page is rendered.  I solved the problem by adding a <f:selectItems> child to the <af:selectOneListBox> and setting the value of that tag to a List of SelectItems in my backing bean and populating that list on bean instantiation.  Is there a similar option for a Panel Dashboard and a List of Panel Boxes?  The thought of using an <af:forEach> tag had crossed my mind to populate the panel dashboard with panel boxes, but as you can see in my code below, I am already using <af:forEach> to dynamically populate the first panel box with command links.  Unless there is a way to dynamically populate a panel dashboard with dynamically populated panel boxes in the fragment, I don't think the for each approach will work (there doesn't appear to be a way to dynamically populate the panel boxes with UI components in the backing bean either).
    Sample code is below.  Any suggestions are greatly appreciated.
    main_dashboard.jsff
    {code}
                    <af:panelDashboard id="mainDash" columns="2" rowHeight="250px" styleClass="AFStretchWidth"  inlineStyle="height:1000px;"
                                       dropListener="#{main_dashboard.handleReorder}" binding="#{main_dashboard.panelDashboard}">
                        <!--f:event listener="#{main_dashboard.setupCustomDashboard}" type="preRenderComponent"/-->
                        <af:panelBox id="openedBox" text="Recently Opened">
                            <af:componentDragSource/>
                            <af:forEach var="item" items="#{main_dashboard.openedCommandLinks}">
                                <af:commandLink text="#{item.text}" partialSubmit="true"
                                                actionListener="#{main_dashboard.editorFiredFromDashboard}"/>
                            </af:forEach>
                        </af:panelBox>
                        <af:panelBox id="editedBox" text="Recently Edited">
                            <af:componentDragSource/>
                            <af:outputText value="Recently Edited" id="ot2"/>
                        </af:panelBox>
                        <af:panelBox id="openCPsBox" text="My Open Config Packages">
                            <af:componentDragSource/>
                            <af:outputText value="My Open Config Packages" id="ot3"/>
                        </af:panelBox>
                        <af:panelBox id="testBox" text="Test Panel Box">
                            <af:componentDragSource/>
                            <af:outputText value="For Testing Purposes Only" id="ot4"/>
                        </af:panelBox>
                    </af:panelDashboard>
    {code}
    MainDashboardBackingBean (main_dashboard)
    {code}
        private RichPanelDashboard panelDashboard;
        public MainDashboardBackingBean() {
            setupCustomDashboard();
        // Using @PostConstruct annotation did not work
        // @PostConstruct
        public void setupCustomDashboard() {
            // Set custom column count
            Integer selectedColumnCount = customDashboardDcl.getColumnCount();
            // Pulling from FacesContext did not work
            // RichPanelDashboard mainDashboard = ( RichPanelDashboard )FacesContext.getCurrentInstance().getViewRoot().findComponent( "mainDash" );
            // mainDashboard.setColumns( selectedColumnCount );
            // Null Pointer happens here
            panelDashboard.setColumns( selectedColumnCount );
            // Create the new ordered list
            if( customDashboardMap != null ) {
                List<String> reorderedIdList = new ArrayList<String>( customDashboards.size() );
                for( Integer key : customDashboardMap.keySet() ) {
                    String customId = customDashboardMap.get( key );
                    for( UIComponent currChild : panelDashboard.getChildren() ) {
                        String currId = currChild.getId();
                        if( customId == currId ) {
                            reorderedIdList.add( currId );
                            break;
                // Unused Panel Boxes must still be added, but not rendered
                for( UIComponent currChild : panelDashboard.getChildren() ) {
                    String currId = currChild.getId();
                    if( !reorderedIdList.contains( currId ) ) {
                        currChild.setRendered( false );
                        reorderedIdList.add( currId );
                // Apply the changes
                ComponentChange change = new ReorderChildrenComponentChange( reorderedIdList );
                change.changeComponent( panelDashboard );
            AdfFacesContext.getCurrentInstance().addPartialTarget( panelDashboard );
        public RichPanelDashboard getPanelDashboard() {
            return panelDashboard;
        public void setPanelDashboard(RichPanelDashboard panelDashboard) {
            this.panelDashboard = panelDashboard;
    {code}

    Hi,
    I did actually populate my panelDashboard with a forEach over a list of dashboard items.
              <af:panelDashboard id="pd1" columns="2" rowHeight="#{pageFlowScope.myDashboard.rowHeight}"
                                 binding="#{pageFlowScope.myDashboard.dashboard}"
                                 dropListener="#{pageFlowScope.myDashboard.move}">
                <af:forEach items="#{pageFlowScope.myDashboard.dashboardItems}"
                            var="panels">
                    <af:panelBox text="#{panels.localizedTitel}"
                                 id="${panels.id}" background="medium" showDisclosure="false">
                      <af:region value="#{panels.regionTaskflow}"
                                 id="r2"/>
                      <af:componentDragSource/>
                    </af:panelBox>
                </af:forEach>
              </af:panelDashboard>
    All my panels are rendered as regions that are dynamically filled with single page task flows which are bound to the page containing the dashboard.
    My DashboardItem class creates the RegionModel from the task flow binding
            public RegionModel getRegionTaskflow() {
                String regionBinding = "#{bindings." + taskflow + ".regionModel}";
                RegionModel model = (RegionModel)JSFUtils.resolveExpression(regionBinding);
                return model;
    I don't know if that's a good practice but it works.
    Hope that helps,
    Achim

  • html:option tag with jbo:RowSetIterate

    Hi
    I am trying to build a list box using the following code.
    <html:select property="providerTypeId">
    <html:option value=""> </html:option>
    <jbo:RowsetIterate datasource="PModule.ProviderTypeLuVO">
    <html:option value="<jbo:ShowValue datasource='PModule.ProviderTypeLuVO' dataitem='ProviderTypeId' />"> <jbo:ShowValue datasource="PModule.ProviderTypeLuVO" dataitem="ProviderType" />-<jbo:ShowValue datasource="PModule.ProviderTypeLuVO" dataitem="ProviderTypeDesc" /> </html:option>
    </jbo:RowsetIterate>
    </html:select>
    -- The list box builds like this
    <option value="<jbo:ShowValue datasource="P.ProviderTypeLuVO" dataitem="ProviderTypeId" />">10-PHYSICIAN, M.D</option>
    The value is not retrieved from the ShowValue tag.
    Can some one help on this issue.
    Thanks

    Do you have the taglib correct at the top of the page ?
    i.e.
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    Rather than the ShowValue tag I tend to use the Row tag to have the row as an object on which I can call the getAttribute method to then populate the combo / list box.
    e.g.
    <select name="recallPriorityCode">
    <option value="">
    </option>
    <jbo:RowsetIterate datasource="spds">
    <jbo:Row id="sprow" datasource="spds" action="Current" />
    <%
    String priorityCode = sprow.getAttribute("PriorityCode").toString();
    String priorityDescription = sprow.getAttribute("PriorityDescription").toString();
    %>
    <option value="<%= priorityCode %>">
    <%= priorityDescription %>
    </option>
    </jbo:RowsetIterate>
    </select>
    Hope this helps.

  • html:option tag in STRUTS

    How can I put a "selected" attribute in the <html:option> tag in STRUTS? In regular HTML, I can say:
    <select name="test">
    <option name="opt1" selected>Option 1</option>
    </selected>
    But I can't use the "selected" key word in the STRUTS tag:
    <html:select property="myList">
    <logic:equal name="myListElement" value="Hello World">
    <html:option value="opt1" selected>Option 1</html:option>
    </logic:equal>
    <logic:notEqual name="myListElement" value="Hello World">
    <html:option value="other opts">Other opts</html:option>
    </logic:notEqual>
    </html:select>
    How can I get the following to work?
    Thanks,
    Dylan

    DavidHymes wrote:
    He is trying to pre-select an option, not determine which option is selected. I have the same question, anyone know the answer?Ugh! Why're you replying to a thread from over 4 years ago?? Couldn't you start your own topic?
    Take a look at this topic from yesterday: http://forum.java.sun.com/thread.jspa?threadID=5223675

  • How to dynamically populate a listbox with the values in the database

    Hi,
    How do dynamically populate the list box with the values in the oracle database. I want to load the list box at run time.Plz anybody help me out to find a solution for this problem.
    Thanks in advance...
    Regards,
    Shiva.

    u can wite code like this..on jsp page
    <%
    ResultSet rs = stmt.executeQuery("select vender_name from vendors");
    %>
    <select name = "vendorlist">
    <%
    while(rs.next()){
    String vname = rs.getString(1);
    %>
    <option value="<%=vname%>"><%=vname%></option%>
    <%
    rs.close();
    %>

  • Html options

    Hi,
    I am using following code to display a drop down in jsp.
    <logic:present name="ALLBRANDS" scope="request">
         <html:select property="selBrand" styleId="brandBox" >
              <html:options collection="ALLBRANDS" property="strBrandDesc"/>
         </html:select>
    </logic:present>     
    ALLBRANDS is of type java.util.ArrayLIst which contains object of type Brand
    Brand has just two properties strBrandId and strBrandDesc.
    I am using property strBrandDesc to display elements in drop down.
    Up to this, every thing is working ok.
    What I want to do is:
    Whenever a user selects some value, on onchange I want to call a java script method and I want to pass strBrandId to java script function.
    I can't use bean write here..I son't want to retrieve strBrandDesc
    I tried different things but couldn't succeed.
    Can any one help me in this?
    Thanks
    nmadhava.

    I am sorry for asking simple question. Anyways I got it now.
    <logic:present name="ALLBRANDS" scope="request">
                                                      <html:select property="selBrand" styleId="brandBox" styleClass="tdDisplayDropDownText">
                                                                <logic:iterate id="brands" name="ALLBRANDS" type="com.archway.core.bean.MFBrand" scope="request">
                                                                     <html:option value=" <%= brands.getStrBrandId()%> ">
                                                                <bean:write name="brands" property="strBrandDesc"/>
                                                      </html:option>
                                                                </logic:iterate>
                                                      </html:select>
                                                      </logic:present>
    From java script we can access it using
    document.form.brandBox.value which gets id value not description.
    nmadhava

  • Change the style of a html:option element

    I have the following problem: I�m trying to add style to some <html:option> inside a <html:select> element but it only works in FireFox, in Internet Explorer doesn�t work.
    My code:
    <html:select property="filtroEntrada.formato" name="consultaEntradaForm" styleId="formato" >
                                       <logic:iterate name="consultaEntradaForm" property="filtroEntrada.listaFormato" id="nodoLista" length="${filtroEntrada.listaFormato.length}">
                                                                          <!-- Si el formato tiene la propiedada activo a 1 -->
                                            <logic:equal value="1" name="nodoLista" property="activo">
                                                                                         <html:option value="idFormato" style="font-weight:bold"><bean:write name="nodoLista" property="idFormato"/></html:option>
                                                                                    </logic:equal>
                                            <!-- Si el formato no tiene la propiedada activo a 1 -->
                                            <logic:notEqual value="1" name="nodoLista" property="activo">
                                                                               <html:option value="idFormato"><bean:write name="nodoLista" property="idFormato"/></html:option>
                                                                          </logic:notEqual>
                                       </logic:iterate>
                                  </html:select>
    I tried with styleClass and with style, but none of them worked. I also tried <span>...
    Thanks

    I was able to set the font in Internet Explorer on the html:select statement
    <html:select style="font-family:monospace;font-size: 1.2em;" >
    In Firefox, I had to put it on the html:option statement
    By putting on both statements, it worked in both I.E. and Firefox.

Maybe you are looking for