How to iterate using struts 2 ?
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi all,
I am new to struts 2. I have a method which returns arraylist, where as the array list containd collection of VO's.
How to get iterate it in jsp using struts 2 ?
example:
In this example, DataBaseDetails is my VO,which contains variuos fields like portno,database name,etc....
All the database names like mysql,oracle,derby will be populated in the combo box. I need to populate the values like portno,username on clicking the value in the combo box.
[ March 17, 2008: Message edited by: angelin precilla ]
I am new to struts 2. I have a method which returns arraylist, where as the array list containd collection of VO's.
How to get iterate it in jsp using struts 2 ?
example:
In this example, DataBaseDetails is my VO,which contains variuos fields like portno,database name,etc....
All the database names like mysql,oracle,derby will be populated in the combo box. I need to populate the values like portno,username on clicking the value in the combo box.
[ March 17, 2008: Message edited by: angelin precilla ]
posted 17 years ago
So you aren't really talking about iteration as your topic title says. You want to know how you can select a connection in a list and display the connection's properties in a couple of text boxes, right?
Struts 2 has some AJAX functionality that could be used to fetch the values for the text boxes once a select box value is selected.
Another way to do this is to populate several Javascript arrays with the values for port number, user name, etc. and put an onclick action on the select box which populates your text boxes when a value is selected.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
All the database names like mysql,oracle,derby will be populated in the combo box. I need to populate the values like portno,username on clicking the value in the combo box.
So you aren't really talking about iteration as your topic title says. You want to know how you can select a connection in a list and display the connection's properties in a couple of text boxes, right?
Struts 2 has some AJAX functionality that could be used to fetch the values for the text boxes once a select box value is selected.
Another way to do this is to populate several Javascript arrays with the values for port number, user name, etc. and put an onclick action on the select box which populates your text boxes when a value is selected.
angelin precilla
Ranch Hand
Posts: 33
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi,
CAn you send me the sample example relevant to my query.
CAn you send me the sample example relevant to my query.
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Was my diagnosis of your problem correct?
Do you want to use AJAX or JavaScript to solve your problem?
Do you want to use AJAX or JavaScript to solve your problem?
angelin precilla
Ranch Hand
Posts: 33
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
HI,
I have used JSON to populate the textboxes.
But I am getting script error as 'Expected identifier,String or Number'
My code is
I am getting the alert statement correctly.
I am getting script error after the alert statement.
[ March 17, 2008: Message edited by: angelin precilla ]
[ March 17, 2008: Message edited by: angelin precilla ]
I have used JSON to populate the textboxes.
But I am getting script error as 'Expected identifier,String or Number'
My code is
I am getting the alert statement correctly.
I am getting script error after the alert statement.
[ March 17, 2008: Message edited by: angelin precilla ]
[ March 17, 2008: Message edited by: angelin precilla ]
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
You really need to read our FAQ, How To Ask Questions on JavaRanch
You are leaving out vital details about your problem and showing us source code that has nothing to do with your question. The better you frame your question, the more we will be able to help you, and the FAQ will help you do that.
You are leaving out vital details about your problem and showing us source code that has nothing to do with your question. The better you frame your question, the more we will be able to help you, and the FAQ will help you do that.
| I guess everyone has an angle. Fine, what do you want? Just know that you cannot have this tiny ad: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |








