Solved

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

Posted on 2004-10-15
2
201 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 125 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Learn why we support net neutrality and why the topic is important to all internet users.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

696 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