You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shoaib Gauhar <sa...@yahoo.com> on 2007/09/25 12:08:59 UTC
InputTransferSelect problem in Struts 2
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. I am posting this mail for the second time because the
first time i didnt get any reply (maybe because i didnt post any code of
mine).
It would be highly appreciable if you could help me in this regard.
Shoaib Ahmad
(PS: I need to pass value through HashMap so please dont ask me to change
it. Thanks)
--
View this message in context: http://www.nabble.com/InputTransferSelect-problem-in-Struts-2-tf4514585.html#a12876594
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: InputTransferSelect problem in Struts 2
Posted by Shoaib Gauhar <sa...@yahoo.com>.
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 <a....@gmail.com> 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 <a....@gmail.com> 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 <ne...@yahoo.com> wrote:
> >>>
> >>>
> >>>
> >>>> --- Shoaib Gauhar <sa...@yahoo.com> 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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: InputTransferSelect problem in Struts 2
Posted by Adam Ruggles <a....@gmail.com>.
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 <a....@gmail.com> 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 <ne...@yahoo.com> wrote:
>>>
>>>
>>>
>>>> --- Shoaib Gauhar <sa...@yahoo.com> 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");
>>>> }
>>>> public String execute() {
>>>> return SUCCESS;
>>>> }
>>>> }
>>>>
>>>> --- Shoaib Gauhar <sa...@yahoo.com> 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. I am posting this mail for the
>>>>> second time because the
>>>>> first time i didnt get any reply (maybe because
>>>>>
>> i
>>
>>>>> didnt post any code of
>>>>> mine).
>>>>>
>>>>> It would be highly appreciable if you could help
>>>>>
>>>>>
>>>> me
>>>>
>>>>
>>>>> in this regard.
>>>>>
>>>>> Shoaib Ahmad
>>>>>
>>>>> (PS: I need to pass value through HashMap so
>>>>>
>>>>>
>>>> please
>>>>
>>>>
>>>>> dont ask me to change
>>>>> it. Thanks)
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>>
>>>>>
>>>>>
> http://www.nabble.com/InputTransferSelect-problem-in-Struts-2-tf4514585.html#a12876594
>
>>>
>>>
>>>>> Sent from the Struts - User mailing list archive
>>>>>
>>>>>
>>>> at
>>>>
>>>>
>>>>> Nabble.com.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
> ---------------------------------------------------------------------
>
>>>
>>>
>>>>> To unsubscribe, e-mail:
>>>>> user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail:
>>>>> user-help@struts.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
> === message truncated ===
>
>
>
>
> ____________________________________________________________________________________
> Need a vacation? Get great deals
> to amazing places on Yahoo! Travel.
> http://travel.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: InputTransferSelect problem in Struts 2
Posted by Shoaib Gauhar <sa...@yahoo.com>.
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 <a....@gmail.com> 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 <ne...@yahoo.com> wrote:
> >
> >
> >> --- Shoaib Gauhar <sa...@yahoo.com> 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");
> >> }
> >> public String execute() {
> >> return SUCCESS;
> >> }
> >> }
> >>
> >> --- Shoaib Gauhar <sa...@yahoo.com> 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. I am posting this mail for the
> >>> second time because the
> >>> first time i didnt get any reply (maybe because
> i
> >>> didnt post any code of
> >>> mine).
> >>>
> >>> It would be highly appreciable if you could help
> >>>
> >> me
> >>
> >>> in this regard.
> >>>
> >>> Shoaib Ahmad
> >>>
> >>> (PS: I need to pass value through HashMap so
> >>>
> >> please
> >>
> >>> dont ask me to change
> >>> it. Thanks)
> >>>
> >>> --
> >>> View this message in context:
> >>>
> >>>
> >
>
http://www.nabble.com/InputTransferSelect-problem-in-Struts-2-tf4514585.html#a12876594
> >
> >>> Sent from the Struts - User mailing list archive
> >>>
> >> at
> >>
> >>> Nabble.com.
> >>>
> >>>
> >>>
> >>>
> >
>
---------------------------------------------------------------------
> >
> >>> To unsubscribe, e-mail:
> >>> user-unsubscribe@struts.apache.org
> >>> For additional commands, e-mail:
> >>> user-help@struts.apache.org
> >>>
> >>>
> >>>
> >>
> >>
>
=== message truncated ===
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: InputTransferSelect problem in Struts 2
Posted by Adam Ruggles <a....@gmail.com>.
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 <ne...@yahoo.com> wrote:
>
>
>> --- Shoaib Gauhar <sa...@yahoo.com> 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");
>> }
>> public String execute() {
>> return SUCCESS;
>> }
>> }
>>
>> --- Shoaib Gauhar <sa...@yahoo.com> 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. I am posting this mail for the
>>> second time because the
>>> first time i didnt get any reply (maybe because i
>>> didnt post any code of
>>> mine).
>>>
>>> It would be highly appreciable if you could help
>>>
>> me
>>
>>> in this regard.
>>>
>>> Shoaib Ahmad
>>>
>>> (PS: I need to pass value through HashMap so
>>>
>> please
>>
>>> dont ask me to change
>>> it. Thanks)
>>>
>>> --
>>> View this message in context:
>>>
>>>
> http://www.nabble.com/InputTransferSelect-problem-in-Struts-2-tf4514585.html#a12876594
>
>>> Sent from the Struts - User mailing list archive
>>>
>> at
>>
>>> Nabble.com.
>>>
>>>
>>>
>>>
> ---------------------------------------------------------------------
>
>>> To unsubscribe, e-mail:
>>> user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail:
>>> user-help@struts.apache.org
>>>
>>>
>>>
>>
>>
> ---------------------------------------------------------------------
>
>> To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> For additional commands, e-mail:
>> user-help@struts.apache.org
>>
>>
>>
>
>
>
>
> ____________________________________________________________________________________
> Yahoo! oneSearch: Finally, mobile search
> that gives answers, not web links.
> http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: InputTransferSelect problem in Struts 2
Posted by Shoaib Gauhar <sa...@yahoo.com>.
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 <ne...@yahoo.com> wrote:
> --- Shoaib Gauhar <sa...@yahoo.com> 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");
> }
> public String execute() {
> return SUCCESS;
> }
> }
>
> --- Shoaib Gauhar <sa...@yahoo.com> 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. I am posting this mail for the
> > second time because the
> > first time i didnt get any reply (maybe because i
> > didnt post any code of
> > mine).
> >
> > It would be highly appreciable if you could help
> me
> > in this regard.
> >
> > Shoaib Ahmad
> >
> > (PS: I need to pass value through HashMap so
> please
> > dont ask me to change
> > it. Thanks)
> >
> > --
> > View this message in context:
> >
>
http://www.nabble.com/InputTransferSelect-problem-in-Struts-2-tf4514585.html#a12876594
> > Sent from the Struts - User mailing list archive
> at
> > Nabble.com.
> >
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> > user-help@struts.apache.org
> >
> >
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
>
>
____________________________________________________________________________________
Yahoo! oneSearch: Finally, mobile search
that gives answers, not web links.
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: InputTransferSelect problem in Struts 2
Posted by Dave Newton <ne...@yahoo.com>.
--- Shoaib Gauhar <sa...@yahoo.com> 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");
}
public String execute() {
return SUCCESS;
}
}
--- Shoaib Gauhar <sa...@yahoo.com> 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. I am posting this mail for the
> second time because the
> first time i didnt get any reply (maybe because i
> didnt post any code of
> mine).
>
> It would be highly appreciable if you could help me
> in this regard.
>
> Shoaib Ahmad
>
> (PS: I need to pass value through HashMap so please
> dont ask me to change
> it. Thanks)
>
> --
> View this message in context:
>
http://www.nabble.com/InputTransferSelect-problem-in-Struts-2-tf4514585.html#a12876594
> Sent from the Struts - User mailing list archive at
> Nabble.com.
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org