Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: HashMap Display Default value

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default HashMap Display Default value

    Dear , I m setting in java all the countries in hashMap like this---
    countryName = cnt.getStringProperty("COUNTRY_NAME");
    oid = ""+cnt.getLongProperty("OID");
    countries.put(countryName, oid)

    and displaying the All countries in the drop down like

    <html:select property="country" styleClass="comboStyle" style="width:200px;" >
    <htmlptions collection="countries" property="value" labelProperty="key"/>
    </html:select>

    Now i want to display country "India" in dropdwon as default selected value how can i do it ???


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: HashMap Display Default value

    Is this a javascript question?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: HashMap Display Default value

    Looks like Struts...thread moved from Collections and Generics

    This thread has been cross posted here:

    http://www.java-forums.org/struts/62108-hashmap-display-default-value.html

    Although cross posting is allowed, for everyone's benefit, please read:

    Java Programming Forums Cross Posting Rules

    The Problems With Cross Posting


  4. #4
    Junior Member
    Join Date
    Jul 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: HashMap Display Default value

    i also want to know i have to do make condition in the Putting country and oid in countryName=> countries.put(countryName, oid) ;

    or on the jsp I have to put the condition to show the country "India" By default selected.

    and plz tell me the solution how can i do it??

Similar Threads

  1. Default Dialog box changes size
    By anu21g in forum AWT / Java Swing
    Replies: 3
    Last Post: January 2nd, 2012, 05:46 AM
  2. default Value of char
    By chronoz13 in forum Java Theory & Questions
    Replies: 2
    Last Post: September 12th, 2011, 09:25 AM
  3. [SOLVED] How to choose a different toString() Besides the default one?
    By Hallowed in forum Java Theory & Questions
    Replies: 12
    Last Post: April 8th, 2011, 03:05 PM
  4. question about default of outFile()
    By odine in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: August 18th, 2010, 12:11 PM
  5. Replies: 5
    Last Post: August 5th, 2010, 09:16 PM

Tags for this Thread