Solved

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

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
tomcat users xml 7 119
rebasing and merging used in SCM 1 72
love6 challenge java 31 133
How to Make JSP Pages Responsive ? details are below 3 745
For months I had no idea how to 'discover' the IP address of the other end of a link (without asking someone who knows), and it drove me batty. Think about it. You can't use Cisco Discovery Protocol (CDP) because it's not implemented on the ASAs.…
Knowing where your website is hosted is as important as the features you receive, the monthly fee, and the support you receive. Due diligence should be done when choosing your next hosting provider.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

786 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