2 Replies Latest reply: Feb 14, 2013 10:27 AM by Gustavo.Recio RSS

    Retrive map value

    951022
      Hi all,

      i want to retrive the map value. what droplet used for this?

      Thanks in advance
        • 1. Re: Retrive map value
          RMishra
          i want to retrive the map value. what droplet used for this?
          you can you ForEach droplet.
          For more information you can go through:
          http://docs.oracle.com/cd/E23095_01/Platform.93/PageDevGuide/html/s1316foreach01.html
          Example:
          <dsp:droplet name="ForEach">
                <dsp:param name="array" bean="/a/b/Student.myMap"/>
                <dsp:oparam name="output">
                        Key is <dsp:valueof param ="key"/>    value is <dsp:valueof param ="element"/>
                 </dsp:oparam>
          </dsp:droplet>
          -RMishra

          Edited by: RMishra on Feb 12, 2013 6:37 PM
          • 2. Re: Retrive map value
            Gustavo.Recio
            If you already know the key that you want to retrieve, you can just use it plainly. So assuming your map is in a parameter named 'map', and your key is 'city', you could use:

            <dsp:valueof param="map.city" />