?
Solved

<html:radio property="xmlId"....

Posted on 2004-10-15
2
Medium Priority
?
203 Views
Last Modified: 2010-04-01
hi!

can anybody explain what  <html:radio property="xmlId" value="<%= key %>"/> <%= value %> <br/> does from the following code including how html:radio tag works in this code?
-----------------------------

      AssessTestXMLDAO testDAO = new AssessTestXMLDAO();
            String visitId=(String) request.getSession().getAttribute("visitId");
            LinkedHashMap tests = testDAO.selectTitlesAndOrder(visitId, "id");
            
            Iterator testIter = tests.keySet().iterator();
            
            while(testIter.hasNext()) {
               String key = (String) testIter.next();
                 String value = (String) tests.get(key);
      %>
            <html:radio property="xmlId" value="<%= key %>"/> <%= value %> <br/>
        <br>
      <%
-------------------------------

thanks,
0
Comment
Question by:dkim18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 14

Accepted Solution

by:
boonleng earned 500 total points
ID: 12326595
"<html:radio property="xmlId" value="<%= key %>"/> <%= value %>"
The above codes create radio box with the value taken from the map "test" key and use the map value as the label.
Once the iteration finish, it will produce a list of radio box.

Example: assume that the map "test" has the following value.
       tests.put("aa", "AA");
       tests.put("bb", "BB");

The output result will be the following:
       <input type="radio" name="xmlId" value="aa"> AA<br/>
       <input type="radio" name="xmlId" value="aaa"> BB <br/>

Another way of doing this is to store the map in form bean/page attribute, and loop throught using struts logic.
Example:
      <logic:notEmpty name="sampleForm" property="tests">
        <logic:iterate name="sampleForm" property="tests" id="row">
          <html:multibox property="xmlId"><bean:write name="row" property="value"/></html:multibox>
                <bean:write name="row" property="key"/>
        </logic:iterate>
      </logic:notEmpty>

0
 
LVL 14

Expert Comment

by:boonleng
ID: 12326602
sorry, should be the other way :p

          <html:multibox property="xmlId"><bean:write name="row" property="key"/></html:multibox>
          <bean:write name="row" property="value"/> <br />
 
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New style of hardware planning for Microsoft Exchange server.
We are witnesses that everyone is saying that our children shouldn't "play" with a technology because it is dangerous. This article is going to prove that they are wrong.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month11 days, 3 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question