Solved

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

Posted on 2004-10-15
2
196 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
  • 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Owning a franchise can be the dream of a lifetime. It provides a chance for economic growth. You can be as successful as you want.  To make your franchise successful, you need to market it successfully. Here are six of the best marketing strategies …
What is Backup? Backup software creates one or more copies of the data on your digital devices in case your original data is lost or damaged. Different backup solutions protect different kinds of data and different combinations of devices. For e…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now