Mate you are a genious. Thanks alot. It has solved my silly problem. I should have thought of that before:(.
Thanks once again. Shoaib --- Adam Ruggles <[EMAIL PROTECTED]> wrote: > You can specify an id in the <s:input> tag and it > will override the default. > > Shoaib Gauhar wrote: > > You might be right but the code that is rendered > is > > not in my control. Is it??? There seems to be > problem > > with the inputtransferselect component renderer or > > something. > > > > Still waiting for the solution. > > > > Thanks for the reply > > > > Shoaib > > > > --- Adam Ruggles <[EMAIL PROTECTED]> wrote: > > > > > >> Well I don't know about the javascript piece but > the > >> id on your input is > >> invalid. Your input should look something like > >> this: > >> <input type="text" name="map['ID'].input" > >> id="TestAction_map_ID_input" /> > >> > >> Shoaib Gauhar wrote: > >> > >>> Thanks for the reply. Actually the code which i > >>> > >> have > >> > >>> posted is valid for any other component than > >>> inputtransferselect and maybe other transfer > >>> > >> select > >> > >>> components. When the page is rendered it > generates > >>> > >> the > >> > >>> following code: > >>> > >>> <input type="text" name="map['ID']_input" > >>> id="TestAction_map_'ID'__input"/> > >>> > >>> > >>> </td> > >>> <td valign="middle" align="center"> > >>> <input type="button" > >>> value="->" > >>> > >>> > > > onclick="addOption(document.getElementById('TestAction_map_'ID'__input'), > > > >>> > document.getElementById('TestAction_map_'ID'_'))" > >>> /><br /><br /> > >>> <input type="button" > >>> value="<-" > >>> > >>> > > > onclick="removeOptions(document.getElementById('TestAction_map_'ID'_'))" > > > >>> /><br /><br /> > >>> <input type="button" > >>> value="<<--" > >>> > >>> > > > onclick="removeAllOptions(document.getElementById('TestAction_map_'ID'_'))" > > > >>> /><br /><br /> > >>> </td> > >>> <td> > >>> <label for="rightTitle">ID</label><br /> > >>> <select name="map['ID']" size="5" > >>> id="TestAction_map_'ID'_" multiple="multiple"> > >>> <option value="1"></option> > >>> <option value="2"></option> > >>> > >>> > >>> </select> > >>> <input type="button" > >>> > >>> > >>> > > > onclick="moveOptionDown(document.getElementById('TestAction_map_'ID'_'), > > > >>> 'key', '');" > >>> value="v" > >>> /> > >>> <input type="button" > >>> > >>> > >>> > > > onclick="moveOptionUp(document.getElementById('TestAction_map_'ID'_'), > > > >>> 'key', '');" > >>> value="^" > >>> /> > >>> > >>> It gives a syntax error in javascript. To my > >>> understanding this is caused by the quotes which > i > >>> > >> am > >> > >>> giving in the map (map['ID']). If we change the > >>> map['ID'] to map[ID] it works fine but my > hashmap > >>> implementation doesnt work :(. When the script > >>> generates the code for the onclick() event it > >>> > >> doesnt > >> > >>> change the quotes to legal characters and that > is > >>> > >> the > >> > >>> reason why it generates error and the buttons > >>> > >> doesnt > >> > >>> work. It has nothing to do with setters and > >>> > >> getters of > >> > >>> HashMap. > >>> > >>> Your help will be highly appreciated. > >>> > >>> Thanks in advance > >>> > >>> Shoaib > >>> > >>> --- Dave Newton <[EMAIL PROTECTED]> wrote: > >>> > >>> > >>> > >>>> --- Shoaib Gauhar <[EMAIL PROTECTED]> wrote: > >>>> > >>>> > > > http://www.nabble.com/file/p12876594/Source%2BCode.zip > > > >>> > >>> > >>>>> Source+Code.zip > >>>>> > >>>>> I am attaching my struts.xml, TestAction.java > >>>>> > >> and > >> > >>>>> test.jsp, in which i have implemented > >>>>> InputTransferSelect. It generates a java > script > >>>>> > >>>>> > >>>> error > >>>> > >>>> > >>>>> when the page is rendered. > >>>>> > >>>>> > >>>> What JavaScript error? Why isn't there a getter > >>>> > >> for > >> > >>>> the HashMap? > >>>> > >>>> For those that don't want to download the zip > >>>> > >> file, > >> > >>>> here are the relevant portions of the code: > >>>> > >>>> JSP: > >>>> <s:form action="TestAction.action"> > >>>> <s:inputtransferselect name="map['ID']" > >>>> label="ID" > >>>> value="map['ID']" > >>>> list="#{'1','2'}" > >>>> theme="ajax" > >>>> rightTitle="ID"/> > >>>> </s:form> > >>>> > >>>> Java: > >>>> public class TestAction extends ActionSupport { > >>>> public HashMap map = new HashMap(); > >>>> public TestAction() { > >>>> map.put("ID","1"); > >>>> } > === message truncated === ____________________________________________________________________________________ Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games. http://sims.yahoo.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]