• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

Dropdown problem !!

Need help on this line too please.......

out.print("<option>"+ procResult.getString(1) +"--"+ procResult.getString(2) +"--"+ procResult.getString(4) +"</option>");

Its is display in this way:
BIG -- DNS -- V1.0
BIG -- DNS -- V2.0
BIG -- DNS -- V3.0
BIG -- SSS -- V1.0
BIG -- SSS -- V2.0
ABC -- INS -- V4.5
ABC -- INS -- V5.5
ABC -- TTT -- V2.5

How to get the output in this way.
BIG -- DNS -- V1.0
                    V2.0
BIG -- SSS -- V1.0
                    V2.0
ABC -- INS -- V4.5
                    V5.5
ABC -- TTT--  V2.5

Actually I wanted the output to be in such that a dropdown list with only "Family" on select automactily show other dropdown Product menu of related selection and on select automactially show the versions under that.  If this is hard or not possible I would be happy with the above solution. Please help...

DropDownList
BIG
ABC
     <Select anyone>
   if BIG
DNS
SSS
    if ABC
INS
TTT
     <Select any version>
   if DNS
V1.0
V2.0
   if INS
V4.5
V5.5      


Thanks
0
princehyderabad
Asked:
princehyderabad
1 Solution
 
koppchaCommented:
Your first option is certainly possible by including javascript code...
you are looking for drop down menu  or drop down box?
0
 
princehyderabadAuthor Commented:
I'm sorry its DROP DOWN BOX.
0
 
jessegivyDeveloperCommented:
if(Integer.parseInt(procResult.getString(4).substring(1))>1)
   out.print("<option>"+ "              " + procResult.getString(4) +"</option>");
else
   out.print("<option>"+ procResult.getString(1) +"--"+ procResult.getString(2) +"--"+ procResult.getString(4) +"</option>");

if statement above converts the version code into an integer (which truncates anything after the '.') and checks to see if it is greater than 1.  You will have to adjust the spaces in the string, I counted fourteen.

Cheers,

JI
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now