Problem Sumitting Struts Form containing a drop down list <html:optionsCollection>

View: New views
9 Messages — Rating Filter:   Alert me  

Problem Sumitting Struts Form containing a drop down list <html:optionsCollection>

by Hanen Ben Rhouma :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Please, I need your help: I've spent more than one week on trying to figure
out how to submit a struts 1 form containing a drop down list (using
optionsCollection). The problem is that the items in the optionsCollection
refer to the action assigned to the form while I need that same action to
submit my form and trigger the forward to another jsp page.


I'm loosing my cool temper in front of such futility, any ideas PLEASE???

RE: Problem Sumitting Struts Form containing a drop down list <html:optionsCollection>

by Kawczynski, David :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'd love to be able to help but am confused with what you are having
trouble with.  I think I heard something about wanting to modify the
action of a form based on the value selected in a drop-down.  I also
heard something about forwarding to another jsp page.  If you can
clarify your intent you may end up with a good pointer or two.
:)

> -----Original Message-----
> From: Hanen Ben Rhouma [mailto:hanen105@...]
> Sent: Monday, November 09, 2009 12:49 PM
> To: Struts Users Mailing List
> Subject: Problem Sumitting Struts Form containing a drop down
> list <html:optionsCollection>
>
> Please, I need your help: I've spent more than one week on trying to
figure out how to submit a struts 1 form containing a drop down list
(using optionsCollection). The problem is that the items in the
optionsCollection refer to the action assigned to the form while I need
that same action to submit my form and trigger the forward to another
jsp page.  I'm loosing my cool temper in front of such futility, any
ideas PLEASE???
Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: Problem Sumitting Struts Form containing a drop down list <html:optionsCollection>

by Hanen Ben Rhouma :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Morning,

If I give code details, no one will show interest with so much details and with only the description of my requirement no one also could understand, that's pretty complicated you know!!

Well, let me represent it with another approach, by screeshots maybe is better (please take a look at my jsp page shown in the attached screeshot). By selecting one change ID I'd like to forward my form to another jsp page representing the details of the selected change (description, change number, creation date, user, workspace...).

The problem is that I'm either using dojo to code the drop down list from user side (and the mapping between simple <input> parameters and a struts form <html:form> isn't that trivial to do), or I've tried also to code it from server side (eventhough it's too slow) by using a struts form <html:form action="someAction"> containing <html:optionsCollection> to represent the dynamic drop down list (here the problem is that <html:optionsCollection> will make use of the struts action "someAction" to retrieve the data necessary to fill the drop down list and not to code the form's behavior after submitting it.

Hope that my point is clearer this time, I'll be really grateful if someone got a clue to all this headache :(((

Regards,
Hanen


On Mon, Nov 9, 2009 at 7:06 PM, Kawczynski, David <david_kawczynski@...> wrote:
I'd love to be able to help but am confused with what you are having
trouble with.  I think I heard something about wanting to modify the
action of a form based on the value selected in a drop-down.  I also
heard something about forwarding to another jsp page.  If you can
clarify your intent you may end up with a good pointer or two.
:)

> -----Original Message-----
> From: Hanen Ben Rhouma [mailto:hanen105@...]
> Sent: Monday, November 09, 2009 12:49 PM
> To: Struts Users Mailing List
> Subject: Problem Sumitting Struts Form containing a drop down
> list <html:optionsCollection>
>
> Please, I need your help: I've spent more than one week on trying to
figure out how to submit a struts 1 form containing a drop down list
(using optionsCollection). The problem is that the items in the
optionsCollection refer to the action assigned to the form while I need
that same action to submit my form and trigger the forward to another
jsp page.  I'm loosing my cool temper in front of such futility, any
ideas PLEASE???
Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...

Re: Problem Sumitting Struts Form containing a drop down list <html:optionsCollection>

by Paweł Wielgus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Hanen,
firstly I see no attachements, maybe because they are deleted by
mailing list itself.
Secondly, if the problem You have is hard to explain,
then maybe You have trouble to understand it.

If You want to understand your problem better You need to shrink it to
minimum size,
best if this will be one action, one jsp, and one form.
Then keep in mind that Struts is based on HTTP, that give some restrictions,
and also remember how Struts workflow is done.
Ajax is also based on HTTP and the same restrictions apply.

Then try to describe your problem again,
but before sending it give it to someone else who will read it for You
and check if there is anything thats important.

These all are just general best practises to write a post on mailing list.
Keep in mind that if people doesn't understand your post they simply
tend to skip it,
or if some one like David have more time or more good will they ask
for more details.

At the end, i read your question two times,
and i don't understand what You are trying to achieve,
maybe that's me who is not bright enought,
but that's definitively your problem You want to solve.

Best greetings,
Paweł Wielgus.


2009/11/10 Hanen Ben Rhouma <hanen105@...>:

> Morning,
>
> If I give code details, no one will show interest with so much details and
> with only the description of my requirement no one also could understand,
> that's pretty complicated you know!!
>
> Well, let me represent it with another approach, by screeshots maybe is
> better (please take a look at my jsp page shown in the attached screeshot).
> By selecting one change ID I'd like to forward my form to another jsp page
> representing the details of the selected change (description, change number,
> creation date, user, workspace...).
>
> The problem is that I'm either using dojo to code the drop down list from
> user side (and the mapping between simple <input> parameters and a struts
> form <html:form> isn't that trivial to do), or I've tried also to code it
> from server side (eventhough it's too slow) by using a struts form
> <html:form action="someAction"> containing <html:optionsCollection> to
> represent the dynamic drop down list (here the problem is that
> <html:optionsCollection> will make use of the struts action "someAction" to
> retrieve the data necessary to fill the drop down list and not to code the
> form's behavior after submitting it.
>
> Hope that my point is clearer this time, I'll be really grateful if someone
> got a clue to all this headache :(((
>
> Regards,
> Hanen
>
>
> On Mon, Nov 9, 2009 at 7:06 PM, Kawczynski, David
> <david_kawczynski@...> wrote:
>>
>> I'd love to be able to help but am confused with what you are having
>> trouble with.  I think I heard something about wanting to modify the
>> action of a form based on the value selected in a drop-down.  I also
>> heard something about forwarding to another jsp page.  If you can
>> clarify your intent you may end up with a good pointer or two.
>> :)
>>
>> > -----Original Message-----
>> > From: Hanen Ben Rhouma [mailto:hanen105@...]
>> > Sent: Monday, November 09, 2009 12:49 PM
>> > To: Struts Users Mailing List
>> > Subject: Problem Sumitting Struts Form containing a drop down
>> > list <html:optionsCollection>
>> >
>> > Please, I need your help: I've spent more than one week on trying to
>> figure out how to submit a struts 1 form containing a drop down list
>> (using optionsCollection). The problem is that the items in the
>> optionsCollection refer to the action assigned to the form while I need
>> that same action to submit my form and trigger the forward to another
>> jsp page.  I'm loosing my cool temper in front of such futility, any
>> ideas PLEASE???
>> Notice:  This e-mail message, together with any attachments, contains
>> information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New
>> Jersey, USA 08889), and/or its affiliates Direct contact information for
>> affiliates is available at http://www.merck.com/contact/contacts.html) that
>> may be confidential, proprietary copyrighted and/or legally privileged. It
>> is intended solely for the use of the individual or entity named on this
>> message. If you are not the intended recipient, and have received this
>> message in error, please notify us immediately by reply e-mail and then
>> delete it from your system.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@...
>> For additional commands, e-mail: user-help@...
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


RE: Problem Sumitting Struts Form containing a drop down list <html:optionsCollection>

by Kawczynski, David :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I believe I understand what you are trying to accomplish:
Ignoring the details (dojo, struts <html:form>, etc) for now... at a
high level, you want to render a page containing a list of items.  You
want to enable a user to get low-level details on any one of those
items.  
So far so good?  
While there are plenty of ways to accomplish this, I don't want to
confuse you further so I'll only cover the simplest scenario:
Assuming each of these items has single unique identifier that can be
used to retrieve the details (your "change number"?) and a single simple
small description that will give the use a clue what that item refers to
(your "description"?)...
 
You want two pages:

*
        one that will render the entire list of items (but only this
simple small description for each item)
*
        one that will render all the low-level details for only one item

 
You want two different DAO methods:

*
        one that retrieves a List of all items' change number and
description.  
*
        one that retrieves one item's details (description, creation
date, user, workspace...) given the item's change number

You want two struts actions:

*
        one that calls the DAO's list method, puts the List into the
httprequest, and renders the list page
*
        one that calls the DAO's details method, puts those details into
a single object and puts that object into the httprequest, and renders
the details page

On the list page: create a <form> whose action points to the struts
details action.  
Create a <select> element, and populate its options from the list in the
http request.  
Make each <option>'s value = the item's change number
Make each <option>'s text = the item's description.
On the details page, render attributes of the details object (found in
the http request).  
 
If you follow this approach, chances are any problem you run into will
be one that can be described in a clear and concise manner.  Once you
get this working correctly, you have the building blocks to do more
advanced things like ajax interactions.  But if you don't have a firm
grasp on the basics you'll only end up frustrating yourself and wasting
a lot your time.  
 
Good luck,
-dave
 

________________________________

        From: Hanen Ben Rhouma [mailto:hanen105@...]
        Sent: Tuesday, November 10, 2009 4:00 AM
        To: Struts Users Mailing List
        Subject: Re: Problem Sumitting Struts Form containing a drop
down list <html:optionsCollection>
       
       
        Morning,
       
        If I give code details, no one will show interest with so much
details and with only the description of my requirement no one also
could understand, that's pretty complicated you know!!
       
        Well, let me represent it with another approach, by screeshots
maybe is better (please take a look at my jsp page shown in the attached
screeshot). By selecting one change ID I'd like to forward my form to
another jsp page representing the details of the selected change
(description, change number, creation date, user, workspace...).
       
        The problem is that I'm either using dojo to code the drop down
list from user side (and the mapping between simple <input> parameters
and a struts form <html:form> isn't that trivial to do), or I've tried
also to code it from server side (eventhough it's too slow) by using a
struts form <html:form action="someAction"> containing
<html:optionsCollection> to represent the dynamic drop down list (here
the problem is that <html:optionsCollection> will make use of the struts
action "someAction" to retrieve the data necessary to fill the drop down
list and not to code the form's behavior after submitting it.
       
        Hope that my point is clearer this time, I'll be really grateful
if someone got a clue to all this headache :(((
       
        Regards,
        Hanen
       
       
       
        On Mon, Nov 9, 2009 at 7:06 PM, Kawczynski, David
<david_kawczynski@...> wrote:
       

                I'd love to be able to help but am confused with what
you are having
                trouble with.  I think I heard something about wanting
to modify the
                action of a form based on the value selected in a
drop-down.  I also
                heard something about forwarding to another jsp page.
If you can
                clarify your intent you may end up with a good pointer
or two.
                :)
               

                > -----Original Message-----
                > From: Hanen Ben Rhouma [mailto:hanen105@...]
                > Sent: Monday, November 09, 2009 12:49 PM
                > To: Struts Users Mailing List
                > Subject: Problem Sumitting Struts Form containing a
drop down
                > list <html:optionsCollection>
                >
                > Please, I need your help: I've spent more than one
week on trying to
                figure out how to submit a struts 1 form containing a
drop down list
                (using optionsCollection). The problem is that the items
in the
                optionsCollection refer to the action assigned to the
form while I need
                that same action to submit my form and trigger the
forward to another
                jsp page.  I'm loosing my cool temper in front of such
futility, any
                ideas PLEASE???
               
                Notice:  This e-mail message, together with any
attachments, contains information of Merck & Co., Inc. (One Merck Drive,
Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct
contact information for affiliates is available at
http://www.merck.com/contact/contacts.html) that may be confidential,
proprietary copyrighted and/or legally privileged. It is intended solely
for the use of the individual or entity named on this message. If you
are not the intended recipient, and have received this message in error,
please notify us immediately by reply e-mail and then delete it from
your system.
               
               
       
---------------------------------------------------------------------
                To unsubscribe, e-mail:
user-unsubscribe@...
                For additional commands, e-mail:
user-help@...
               
               



Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.

Re: Problem Sumitting Struts Form containing a drop down list <html:optionsCollection>

by Hanen Ben Rhouma :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for your reply Davidn but please guys try to stop talking to me as if
I'm an idiot stubborn girl who doesn't know what she wants or even what
she's talking about. I'm working with struts for almost 6 months now and I'm
still finding some difficulties not because of my stupidity but because of
the lack of support I've noticed on the web. Either they give you some peace
of code which you don't find a clue how to plug it into your solution or
they just keep turning around your precise requirement to stick with their
struts/java knowledge.

I'm not confused about my requirement sir, I know what I want but the way to
achieve it on struts way is still clueless for me. You've understood one
side of my requirement but you didn't touch my blocking point.

Here is a tutorial I've followed for coding the first part consisting of
rendering a dynamic drop down list with data assembled into a collection
http://www.laliluna.de/download/struts-html-optionscollection-en.pdf

If you got time, check it out and tell me how can I render my description
page into "example" action while it's configured to maintain the business
logic of the data rendered into that drop down list (supposed to be an entry
point and not a resulting page for our form behavior).

I know I'm not good enough in english to explain myself the way it should be
but it hasn't any relationship with my understanding of my requirement and
the logical way to get it done (reaching this state of seeing illogical
things made me wonder how come that no body has encountered such problem
before and how were they submitting their dynamic drop down lists
classicaly).

Regards,
Hanen

On Tue, Nov 10, 2009 at 3:59 PM, Kawczynski, David <
david_kawczynski@...> wrote:

> I believe I understand what you are trying to accomplish:
> Ignoring the details (dojo, struts <html:form>, etc) for now... at a
> high level, you want to render a page containing a list of items.  You
> want to enable a user to get low-level details on any one of those
> items.
> So far so good?
> While there are plenty of ways to accomplish this, I don't want to
> confuse you further so I'll only cover the simplest scenario:
> Assuming each of these items has single unique identifier that can be
> used to retrieve the details (your "change number"?) and a single simple
> small description that will give the use a clue what that item refers to
> (your "description"?)...
>
> You want two pages:
>
> *
>        one that will render the entire list of items (but only this
> simple small description for each item)
> *
>        one that will render all the low-level details for only one item
>
>
> You want two different DAO methods:
>
> *
>        one that retrieves a List of all items' change number and
> description.
> *
>        one that retrieves one item's details (description, creation
> date, user, workspace...) given the item's change number
>
> You want two struts actions:
>
> *
>        one that calls the DAO's list method, puts the List into the
> httprequest, and renders the list page
> *
>        one that calls the DAO's details method, puts those details into
> a single object and puts that object into the httprequest, and renders
> the details page
>
> On the list page: create a <form> whose action points to the struts
> details action.
> Create a <select> element, and populate its options from the list in the
> http request.
> Make each <option>'s value = the item's change number
> Make each <option>'s text = the item's description.
> On the details page, render attributes of the details object (found in
> the http request).
>
> If you follow this approach, chances are any problem you run into will
> be one that can be described in a clear and concise manner.  Once you
> get this working correctly, you have the building blocks to do more
> advanced things like ajax interactions.  But if you don't have a firm
> grasp on the basics you'll only end up frustrating yourself and wasting
> a lot your time.
>
> Good luck,
> -dave
>
>
> ________________________________
>
>        From: Hanen Ben Rhouma [mailto:hanen105@...]
>         Sent: Tuesday, November 10, 2009 4:00 AM
>         To: Struts Users Mailing List
>         Subject: Re: Problem Sumitting Struts Form containing a drop
> down list <html:optionsCollection>
>
>
>        Morning,
>
>        If I give code details, no one will show interest with so much
> details and with only the description of my requirement no one also
> could understand, that's pretty complicated you know!!
>
>        Well, let me represent it with another approach, by screeshots
> maybe is better (please take a look at my jsp page shown in the attached
> screeshot). By selecting one change ID I'd like to forward my form to
> another jsp page representing the details of the selected change
> (description, change number, creation date, user, workspace...).
>
>        The problem is that I'm either using dojo to code the drop down
> list from user side (and the mapping between simple <input> parameters
> and a struts form <html:form> isn't that trivial to do), or I've tried
> also to code it from server side (eventhough it's too slow) by using a
> struts form <html:form action="someAction"> containing
> <html:optionsCollection> to represent the dynamic drop down list (here
> the problem is that <html:optionsCollection> will make use of the struts
> action "someAction" to retrieve the data necessary to fill the drop down
> list and not to code the form's behavior after submitting it.
>
>        Hope that my point is clearer this time, I'll be really grateful
> if someone got a clue to all this headache :(((
>
>        Regards,
>        Hanen
>
>
>
>        On Mon, Nov 9, 2009 at 7:06 PM, Kawczynski, David
> <david_kawczynski@...> wrote:
>
>
>                I'd love to be able to help but am confused with what
> you are having
>                trouble with.  I think I heard something about wanting
> to modify the
>                action of a form based on the value selected in a
> drop-down.  I also
>                heard something about forwarding to another jsp page.
> If you can
>                clarify your intent you may end up with a good pointer
> or two.
>                :)
>
>
>                > -----Original Message-----
>                > From: Hanen Ben Rhouma [mailto:hanen105@...]
>                > Sent: Monday, November 09, 2009 12:49 PM
>                > To: Struts Users Mailing List
>                > Subject: Problem Sumitting Struts Form containing a
> drop down
>                > list <html:optionsCollection>
>                >
>                > Please, I need your help: I've spent more than one
> week on trying to
>                figure out how to submit a struts 1 form containing a
> drop down list
>                (using optionsCollection). The problem is that the items
> in the
>                optionsCollection refer to the action assigned to the
> form while I need
>                that same action to submit my form and trigger the
> forward to another
>                jsp page.  I'm loosing my cool temper in front of such
> futility, any
>                ideas PLEASE???
>
>                Notice:  This e-mail message, together with any
> attachments, contains information of Merck & Co., Inc. (One Merck Drive,
> Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct
> contact information for affiliates is available at
> http://www.merck.com/contact/contacts.html) that may be confidential,
> proprietary copyrighted and/or legally privileged. It is intended solely
> for the use of the individual or entity named on this message. If you
> are not the intended recipient, and have received this message in error,
> please notify us immediately by reply e-mail and then delete it from
> your system.
>
>
>
> ---------------------------------------------------------------------
>                To unsubscribe, e-mail:
> user-unsubscribe@...
>                For additional commands, e-mail:
> user-help@...
>
>
>
>
>
> Notice:  This e-mail message, together with any attachments, contains
> information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New
> Jersey, USA 08889), and/or its affiliates Direct contact information for
> affiliates is available at http://www.merck.com/contact/contacts.html)
> that may be confidential, proprietary copyrighted and/or legally privileged.
> It is intended solely for the use of the individual or entity named on this
> message. If you are not the intended recipient, and have received this
> message in error, please notify us immediately by reply e-mail and then
> delete it from your system.
>

Re: Problem Sumitting Struts Form containing a drop down list <html:optionsCollection>

by Paul Benedict-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hanen,

I think your response to Dave is outrageous and over-the-top. I didn't
see anything offensive in his email.

Paul

On Tue, Nov 10, 2009 at 9:36 AM, Hanen Ben Rhouma <hanen105@...> wrote:

> Thanks for your reply Davidn but please guys try to stop talking to me as if
> I'm an idiot stubborn girl who doesn't know what she wants or even what
> she's talking about. I'm working with struts for almost 6 months now and I'm
> still finding some difficulties not because of my stupidity but because of
> the lack of support I've noticed on the web. Either they give you some peace
> of code which you don't find a clue how to plug it into your solution or
> they just keep turning around your precise requirement to stick with their
> struts/java knowledge.
>
> I'm not confused about my requirement sir, I know what I want but the way to
> achieve it on struts way is still clueless for me. You've understood one
> side of my requirement but you didn't touch my blocking point.
>
> Here is a tutorial I've followed for coding the first part consisting of
> rendering a dynamic drop down list with data assembled into a collection
> http://www.laliluna.de/download/struts-html-optionscollection-en.pdf
>
> If you got time, check it out and tell me how can I render my description
> page into "example" action while it's configured to maintain the business
> logic of the data rendered into that drop down list (supposed to be an entry
> point and not a resulting page for our form behavior).
>
> I know I'm not good enough in english to explain myself the way it should be
> but it hasn't any relationship with my understanding of my requirement and
> the logical way to get it done (reaching this state of seeing illogical
> things made me wonder how come that no body has encountered such problem
> before and how were they submitting their dynamic drop down lists
> classicaly).
>
> Regards,
> Hanen
>
> On Tue, Nov 10, 2009 at 3:59 PM, Kawczynski, David <
> david_kawczynski@...> wrote:
>
>> I believe I understand what you are trying to accomplish:
>> Ignoring the details (dojo, struts <html:form>, etc) for now... at a
>> high level, you want to render a page containing a list of items.  You
>> want to enable a user to get low-level details on any one of those
>> items.
>> So far so good?
>> While there are plenty of ways to accomplish this, I don't want to
>> confuse you further so I'll only cover the simplest scenario:
>> Assuming each of these items has single unique identifier that can be
>> used to retrieve the details (your "change number"?) and a single simple
>> small description that will give the use a clue what that item refers to
>> (your "description"?)...
>>
>> You want two pages:
>>
>> *
>>        one that will render the entire list of items (but only this
>> simple small description for each item)
>> *
>>        one that will render all the low-level details for only one item
>>
>>
>> You want two different DAO methods:
>>
>> *
>>        one that retrieves a List of all items' change number and
>> description.
>> *
>>        one that retrieves one item's details (description, creation
>> date, user, workspace...) given the item's change number
>>
>> You want two struts actions:
>>
>> *
>>        one that calls the DAO's list method, puts the List into the
>> httprequest, and renders the list page
>> *
>>        one that calls the DAO's details method, puts those details into
>> a single object and puts that object into the httprequest, and renders
>> the details page
>>
>> On the list page: create a <form> whose action points to the struts
>> details action.
>> Create a <select> element, and populate its options from the list in the
>> http request.
>> Make each <option>'s value = the item's change number
>> Make each <option>'s text = the item's description.
>> On the details page, render attributes of the details object (found in
>> the http request).
>>
>> If you follow this approach, chances are any problem you run into will
>> be one that can be described in a clear and concise manner.  Once you
>> get this working correctly, you have the building blocks to do more
>> advanced things like ajax interactions.  But if you don't have a firm
>> grasp on the basics you'll only end up frustrating yourself and wasting
>> a lot your time.
>>
>> Good luck,
>> -dave
>>
>>
>> ________________________________
>>
>>        From: Hanen Ben Rhouma [mailto:hanen105@...]
>>         Sent: Tuesday, November 10, 2009 4:00 AM
>>         To: Struts Users Mailing List
>>         Subject: Re: Problem Sumitting Struts Form containing a drop
>> down list <html:optionsCollection>
>>
>>
>>        Morning,
>>
>>        If I give code details, no one will show interest with so much
>> details and with only the description of my requirement no one also
>> could understand, that's pretty complicated you know!!
>>
>>        Well, let me represent it with another approach, by screeshots
>> maybe is better (please take a look at my jsp page shown in the attached
>> screeshot). By selecting one change ID I'd like to forward my form to
>> another jsp page representing the details of the selected change
>> (description, change number, creation date, user, workspace...).
>>
>>        The problem is that I'm either using dojo to code the drop down
>> list from user side (and the mapping between simple <input> parameters
>> and a struts form <html:form> isn't that trivial to do), or I've tried
>> also to code it from server side (eventhough it's too slow) by using a
>> struts form <html:form action="someAction"> containing
>> <html:optionsCollection> to represent the dynamic drop down list (here
>> the problem is that <html:optionsCollection> will make use of the struts
>> action "someAction" to retrieve the data necessary to fill the drop down
>> list and not to code the form's behavior after submitting it.
>>
>>        Hope that my point is clearer this time, I'll be really grateful
>> if someone got a clue to all this headache :(((
>>
>>        Regards,
>>        Hanen
>>
>>
>>
>>        On Mon, Nov 9, 2009 at 7:06 PM, Kawczynski, David
>> <david_kawczynski@...> wrote:
>>
>>
>>                I'd love to be able to help but am confused with what
>> you are having
>>                trouble with.  I think I heard something about wanting
>> to modify the
>>                action of a form based on the value selected in a
>> drop-down.  I also
>>                heard something about forwarding to another jsp page.
>> If you can
>>                clarify your intent you may end up with a good pointer
>> or two.
>>                :)
>>
>>
>>                > -----Original Message-----
>>                > From: Hanen Ben Rhouma [mailto:hanen105@...]
>>                > Sent: Monday, November 09, 2009 12:49 PM
>>                > To: Struts Users Mailing List
>>                > Subject: Problem Sumitting Struts Form containing a
>> drop down
>>                > list <html:optionsCollection>
>>                >
>>                > Please, I need your help: I've spent more than one
>> week on trying to
>>                figure out how to submit a struts 1 form containing a
>> drop down list
>>                (using optionsCollection). The problem is that the items
>> in the
>>                optionsCollection refer to the action assigned to the
>> form while I need
>>                that same action to submit my form and trigger the
>> forward to another
>>                jsp page.  I'm loosing my cool temper in front of such
>> futility, any
>>                ideas PLEASE???
>>
>>                Notice:  This e-mail message, together with any
>> attachments, contains information of Merck & Co., Inc. (One Merck Drive,
>> Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct
>> contact information for affiliates is available at
>> http://www.merck.com/contact/contacts.html) that may be confidential,
>> proprietary copyrighted and/or legally privileged. It is intended solely
>> for the use of the individual or entity named on this message. If you
>> are not the intended recipient, and have received this message in error,
>> please notify us immediately by reply e-mail and then delete it from
>> your system.
>>
>>
>>
>> ---------------------------------------------------------------------
>>                To unsubscribe, e-mail:
>> user-unsubscribe@...
>>                For additional commands, e-mail:
>> user-help@...
>>
>>
>>
>>
>>
>> Notice:  This e-mail message, together with any attachments, contains
>> information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New
>> Jersey, USA 08889), and/or its affiliates Direct contact information for
>> affiliates is available at http://www.merck.com/contact/contacts.html)
>> that may be confidential, proprietary copyrighted and/or legally privileged.
>> It is intended solely for the use of the individual or entity named on this
>> message. If you are not the intended recipient, and have received this
>> message in error, please notify us immediately by reply e-mail and then
>> delete it from your system.
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: Problem Sumitting Struts Form containing a drop down list <html:optionsCollection>

by Hanen Ben Rhouma :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, that's your point and I respect it. Sorry for engendering all this mess
in your rows. I take back my thread.


On Tue, Nov 10, 2009 at 5:06 PM, Paul Benedict <pbenedict@...> wrote:

> Hanen,
>
> I think your response to Dave is outrageous and over-the-top. I didn't
> see anything offensive in his email.
>
> Paul
>
> On Tue, Nov 10, 2009 at 9:36 AM, Hanen Ben Rhouma <hanen105@...>
> wrote:
> > Thanks for your reply Davidn but please guys try to stop talking to me as
> if
> > I'm an idiot stubborn girl who doesn't know what she wants or even what
> > she's talking about. I'm working with struts for almost 6 months now and
> I'm
> > still finding some difficulties not because of my stupidity but because
> of
> > the lack of support I've noticed on the web. Either they give you some
> peace
> > of code which you don't find a clue how to plug it into your solution or
> > they just keep turning around your precise requirement to stick with
> their
> > struts/java knowledge.
> >
> > I'm not confused about my requirement sir, I know what I want but the way
> to
> > achieve it on struts way is still clueless for me. You've understood one
> > side of my requirement but you didn't touch my blocking point.
> >
> > Here is a tutorial I've followed for coding the first part consisting of
> > rendering a dynamic drop down list with data assembled into a collection
> > http://www.laliluna.de/download/struts-html-optionscollection-en.pdf
> >
> > If you got time, check it out and tell me how can I render my description
> > page into "example" action while it's configured to maintain the business
> > logic of the data rendered into that drop down list (supposed to be an
> entry
> > point and not a resulting page for our form behavior).
> >
> > I know I'm not good enough in english to explain myself the way it should
> be
> > but it hasn't any relationship with my understanding of my requirement
> and
> > the logical way to get it done (reaching this state of seeing illogical
> > things made me wonder how come that no body has encountered such problem
> > before and how were they submitting their dynamic drop down lists
> > classicaly).
> >
> > Regards,
> > Hanen
> >
> > On Tue, Nov 10, 2009 at 3:59 PM, Kawczynski, David <
> > david_kawczynski@...> wrote:
> >
> >> I believe I understand what you are trying to accomplish:
> >> Ignoring the details (dojo, struts <html:form>, etc) for now... at a
> >> high level, you want to render a page containing a list of items.  You
> >> want to enable a user to get low-level details on any one of those
> >> items.
> >> So far so good?
> >> While there are plenty of ways to accomplish this, I don't want to
> >> confuse you further so I'll only cover the simplest scenario:
> >> Assuming each of these items has single unique identifier that can be
> >> used to retrieve the details (your "change number"?) and a single simple
> >> small description that will give the use a clue what that item refers to
> >> (your "description"?)...
> >>
> >> You want two pages:
> >>
> >> *
> >>        one that will render the entire list of items (but only this
> >> simple small description for each item)
> >> *
> >>        one that will render all the low-level details for only one item
> >>
> >>
> >> You want two different DAO methods:
> >>
> >> *
> >>        one that retrieves a List of all items' change number and
> >> description.
> >> *
> >>        one that retrieves one item's details (description, creation
> >> date, user, workspace...) given the item's change number
> >>
> >> You want two struts actions:
> >>
> >> *
> >>        one that calls the DAO's list method, puts the List into the
> >> httprequest, and renders the list page
> >> *
> >>        one that calls the DAO's details method, puts those details into
> >> a single object and puts that object into the httprequest, and renders
> >> the details page
> >>
> >> On the list page: create a <form> whose action points to the struts
> >> details action.
> >> Create a <select> element, and populate its options from the list in the
> >> http request.
> >> Make each <option>'s value = the item's change number
> >> Make each <option>'s text = the item's description.
> >> On the details page, render attributes of the details object (found in
> >> the http request).
> >>
> >> If you follow this approach, chances are any problem you run into will
> >> be one that can be described in a clear and concise manner.  Once you
> >> get this working correctly, you have the building blocks to do more
> >> advanced things like ajax interactions.  But if you don't have a firm
> >> grasp on the basics you'll only end up frustrating yourself and wasting
> >> a lot your time.
> >>
> >> Good luck,
> >> -dave
> >>
> >>
> >> ________________________________
> >>
> >>        From: Hanen Ben Rhouma [mailto:hanen105@...]
> >>         Sent: Tuesday, November 10, 2009 4:00 AM
> >>         To: Struts Users Mailing List
> >>         Subject: Re: Problem Sumitting Struts Form containing a drop
> >> down list <html:optionsCollection>
> >>
> >>
> >>        Morning,
> >>
> >>        If I give code details, no one will show interest with so much
> >> details and with only the description of my requirement no one also
> >> could understand, that's pretty complicated you know!!
> >>
> >>        Well, let me represent it with another approach, by screeshots
> >> maybe is better (please take a look at my jsp page shown in the attached
> >> screeshot). By selecting one change ID I'd like to forward my form to
> >> another jsp page representing the details of the selected change
> >> (description, change number, creation date, user, workspace...).
> >>
> >>        The problem is that I'm either using dojo to code the drop down
> >> list from user side (and the mapping between simple <input> parameters
> >> and a struts form <html:form> isn't that trivial to do), or I've tried
> >> also to code it from server side (eventhough it's too slow) by using a
> >> struts form <html:form action="someAction"> containing
> >> <html:optionsCollection> to represent the dynamic drop down list (here
> >> the problem is that <html:optionsCollection> will make use of the struts
> >> action "someAction" to retrieve the data necessary to fill the drop down
> >> list and not to code the form's behavior after submitting it.
> >>
> >>        Hope that my point is clearer this time, I'll be really grateful
> >> if someone got a clue to all this headache :(((
> >>
> >>        Regards,
> >>        Hanen
> >>
> >>
> >>
> >>        On Mon, Nov 9, 2009 at 7:06 PM, Kawczynski, David
> >> <david_kawczynski@...> wrote:
> >>
> >>
> >>                I'd love to be able to help but am confused with what
> >> you are having
> >>                trouble with.  I think I heard something about wanting
> >> to modify the
> >>                action of a form based on the value selected in a
> >> drop-down.  I also
> >>                heard something about forwarding to another jsp page.
> >> If you can
> >>                clarify your intent you may end up with a good pointer
> >> or two.
> >>                :)
> >>
> >>
> >>                > -----Original Message-----
> >>                > From: Hanen Ben Rhouma [mailto:hanen105@...]
> >>                > Sent: Monday, November 09, 2009 12:49 PM
> >>                > To: Struts Users Mailing List
> >>                > Subject: Problem Sumitting Struts Form containing a
> >> drop down
> >>                > list <html:optionsCollection>
> >>                >
> >>                > Please, I need your help: I've spent more than one
> >> week on trying to
> >>                figure out how to submit a struts 1 form containing a
> >> drop down list
> >>                (using optionsCollection). The problem is that the items
> >> in the
> >>                optionsCollection refer to the action assigned to the
> >> form while I need
> >>                that same action to submit my form and trigger the
> >> forward to another
> >>                jsp page.  I'm loosing my cool temper in front of such
> >> futility, any
> >>                ideas PLEASE???
> >>
> >>                Notice:  This e-mail message, together with any
> >> attachments, contains information of Merck & Co., Inc. (One Merck Drive,
> >> Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct
> >> contact information for affiliates is available at
> >> http://www.merck.com/contact/contacts.html) that may be confidential,
> >> proprietary copyrighted and/or legally privileged. It is intended solely
> >> for the use of the individual or entity named on this message. If you
> >> are not the intended recipient, and have received this message in error,
> >> please notify us immediately by reply e-mail and then delete it from
> >> your system.
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >>                To unsubscribe, e-mail:
> >> user-unsubscribe@...
> >>                For additional commands, e-mail:
> >> user-help@...
> >>
> >>
> >>
> >>
> >>
> >> Notice:  This e-mail message, together with any attachments, contains
> >> information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
> New
> >> Jersey, USA 08889), and/or its affiliates Direct contact information for
> >> affiliates is available at http://www.merck.com/contact/contacts.html)
> >> that may be confidential, proprietary copyrighted and/or legally
> privileged.
> >> It is intended solely for the use of the individual or entity named on
> this
> >> message. If you are not the intended recipient, and have received this
> >> message in error, please notify us immediately by reply e-mail and then
> >> delete it from your system.
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
>

RE: Problem Sumitting Struts Form containing a drop down list <html:optionsCollection>

by Kawczynski, David :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> how can I render my description page into "example" action
> while it's configured to maintain the business logic of the
> data rendered into that drop down list

That example action is a tutorial designed to demonstrate how
the optionsCollection tag works.  It is not meant to be a
starting point for you to develop the functionality you speak
of.  You are trying to do too many things at once.  You need
2 very different pieces of data...
- a list of high-level details
- a group of low-level details
Breaking down the steps allows you to focus your efforts on a
specific issue.  The 2-action class approach I described
allows you to do that.

>(supposed to be an entry point and not a resulting page for
> our form behavior).
This sounds like you want AJAX-like functionality.  If you do
what is described below, enabling AJAX is made easy because
you only have to call details action and render its results
AJAX-style.  

Good luck!


> -----Original Message-----
> From: Hanen Ben Rhouma [mailto:hanen105@...]
> Sent: Tuesday, November 10, 2009 10:36 AM
> To: Struts Users Mailing List
> Subject: Re: Problem Sumitting Struts Form containing a drop
> down list <html:optionsCollection>
>
> Thanks for your reply Davidn but please guys try to stop
> talking to me as if
> I'm an idiot stubborn girl who doesn't know what she wants or
> even what
> she's talking about. I'm working with struts for almost 6
> months now and I'm
> still finding some difficulties not because of my stupidity
> but because of
> the lack of support I've noticed on the web. Either they give
> you some peace
> of code which you don't find a clue how to plug it into your
> solution or
> they just keep turning around your precise requirement to
> stick with their
> struts/java knowledge.
>
> I'm not confused about my requirement sir, I know what I want
> but the way to
> achieve it on struts way is still clueless for me. You've
> understood one
> side of my requirement but you didn't touch my blocking point.
>
> Here is a tutorial I've followed for coding the first part
> consisting of
> rendering a dynamic drop down list with data assembled into a
> collection
> http://www.laliluna.de/download/struts-html-optionscollection-en.pdf
>
> If you got time, check it out and tell me how can I render my
> description
> page into "example" action while it's configured to maintain
> the business
> logic of the data rendered into that drop down list (supposed
> to be an entry
> point and not a resulting page for our form behavior).
>
> I know I'm not good enough in english to explain myself the
> way it should be
> but it hasn't any relationship with my understanding of my
> requirement and
> the logical way to get it done (reaching this state of seeing
> illogical
> things made me wonder how come that no body has encountered
> such problem
> before and how were they submitting their dynamic drop down lists
> classicaly).
>
> Regards,
> Hanen
>
> On Tue, Nov 10, 2009 at 3:59 PM, Kawczynski, David <
> david_kawczynski@...> wrote:
>
> > I believe I understand what you are trying to accomplish:
> > Ignoring the details (dojo, struts <html:form>, etc) for now... at a
> > high level, you want to render a page containing a list of
> items.  You
> > want to enable a user to get low-level details on any one of those
> > items.
> > So far so good?
> > While there are plenty of ways to accomplish this, I don't want to
> > confuse you further so I'll only cover the simplest scenario:
> > Assuming each of these items has single unique identifier
> that can be
> > used to retrieve the details (your "change number"?) and a
> single simple
> > small description that will give the use a clue what that
> item refers to
> > (your "description"?)...
> >
> > You want two pages:
> >
> > *
> >        one that will render the entire list of items (but only this
> > simple small description for each item)
> > *
> >        one that will render all the low-level details for
> only one item
> >
> >
> > You want two different DAO methods:
> >
> > *
> >        one that retrieves a List of all items' change number and
> > description.
> > *
> >        one that retrieves one item's details (description, creation
> > date, user, workspace...) given the item's change number
> >
> > You want two struts actions:
> >
> > *
> >        one that calls the DAO's list method, puts the List into the
> > httprequest, and renders the list page
> > *
> >        one that calls the DAO's details method, puts those
> details into
> > a single object and puts that object into the httprequest,
> and renders
> > the details page
> >
> > On the list page: create a <form> whose action points to the struts
> > details action.
> > Create a <select> element, and populate its options from
> the list in the
> > http request.
> > Make each <option>'s value = the item's change number
> > Make each <option>'s text = the item's description.
> > On the details page, render attributes of the details
> object (found in
> > the http request).
> >
> > If you follow this approach, chances are any problem you
> run into will
> > be one that can be described in a clear and concise manner.
>  Once you
> > get this working correctly, you have the building blocks to do more
> > advanced things like ajax interactions.  But if you don't
> have a firm
> > grasp on the basics you'll only end up frustrating yourself
> and wasting
> > a lot your time.
> >
> > Good luck,
> > -dave
> >
> >
> > ________________________________
> >
> >        From: Hanen Ben Rhouma [mailto:hanen105@...]
> >         Sent: Tuesday, November 10, 2009 4:00 AM
> >         To: Struts Users Mailing List
> >         Subject: Re: Problem Sumitting Struts Form containing a drop
> > down list <html:optionsCollection>
> >
> >
> >        Morning,
> >
> >        If I give code details, no one will show interest
> with so much
> > details and with only the description of my requirement no one also
> > could understand, that's pretty complicated you know!!
> >
> >        Well, let me represent it with another approach, by
> screeshots
> > maybe is better (please take a look at my jsp page shown in
> the attached
> > screeshot). By selecting one change ID I'd like to forward
> my form to
> > another jsp page representing the details of the selected change
> > (description, change number, creation date, user, workspace...).
> >
> >        The problem is that I'm either using dojo to code
> the drop down
> > list from user side (and the mapping between simple <input>
> parameters
> > and a struts form <html:form> isn't that trivial to do), or
> I've tried
> > also to code it from server side (eventhough it's too slow)
> by using a
> > struts form <html:form action="someAction"> containing
> > <html:optionsCollection> to represent the dynamic drop down
> list (here
> > the problem is that <html:optionsCollection> will make use
> of the struts
> > action "someAction" to retrieve the data necessary to fill
> the drop down
> > list and not to code the form's behavior after submitting it.
> >
> >        Hope that my point is clearer this time, I'll be
> really grateful
> > if someone got a clue to all this headache :(((
> >
> >        Regards,
> >        Hanen
> >
> >
> >
> >        On Mon, Nov 9, 2009 at 7:06 PM, Kawczynski, David
> > <david_kawczynski@...> wrote:
> >
> >
> >                I'd love to be able to help but am confused with what
> > you are having
> >                trouble with.  I think I heard something
> about wanting
> > to modify the
> >                action of a form based on the value selected in a
> > drop-down.  I also
> >                heard something about forwarding to another jsp page.
> > If you can
> >                clarify your intent you may end up with a
> good pointer
> > or two.
> >                :)
> >
> >
> >                > -----Original Message-----
> >                > From: Hanen Ben Rhouma [mailto:hanen105@...]
> >                > Sent: Monday, November 09, 2009 12:49 PM
> >                > To: Struts Users Mailing List
> >                > Subject: Problem Sumitting Struts Form containing a
> > drop down
> >                > list <html:optionsCollection>
> >                >
> >                > Please, I need your help: I've spent more than one
> > week on trying to
> >                figure out how to submit a struts 1 form containing a
> > drop down list
> >                (using optionsCollection). The problem is
> that the items
> > in the
> >                optionsCollection refer to the action assigned to the
> > form while I need
> >                that same action to submit my form and trigger the
> > forward to another
> >                jsp page.  I'm loosing my cool temper in
> front of such
> > futility, any
> >                ideas PLEASE???
> >
> >                Notice:  This e-mail message, together with any
> > attachments, contains information of Merck & Co., Inc. (One
> Merck Drive,
> > Whitehouse Station, New Jersey, USA 08889), and/or its
> affiliates Direct
> > contact information for affiliates is available at
> > http://www.merck.com/contact/contacts.html) that may be
> confidential,
> > proprietary copyrighted and/or legally privileged. It is
> intended solely
> > for the use of the individual or entity named on this
> message. If you
> > are not the intended recipient, and have received this
> message in error,
> > please notify us immediately by reply e-mail and then delete it from
> > your system.
> >
> >
> >
> >
> ---------------------------------------------------------------------
> >                To unsubscribe, e-mail:
> > user-unsubscribe@...
> >                For additional commands, e-mail:
> > user-help@...
> >
> >
> >
> >
> >
> > Notice:  This e-mail message, together with any
> attachments, contains
> > information of Merck & Co., Inc. (One Merck Drive,
> Whitehouse Station, New
> > Jersey, USA 08889), and/or its affiliates Direct contact
> information for
> > affiliates is available at
> http://www.merck.com/contact/contacts.html)
> > that may be confidential, proprietary copyrighted and/or
> legally privileged.
> > It is intended solely for the use of the individual or
> entity named on this
> > message. If you are not the intended recipient, and have
> received this
> > message in error, please notify us immediately by reply
> e-mail and then
> > delete it from your system.
> >
>
Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...