Solved

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

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

Suggested Solutions

Title # Comments Views Activity
tomcat users xml 7 139
HTML5 vs JSP - REST based application development 4 1,353
eclipse buid path vs tomcat lib path 10 38
how to debug htl and js pages 8 57
Read  the original post  on Monitis Blog. Hi.  My name is Erik Dietrich, and this is the first time I’ve posted on the Monitis blog.  By way of introduction, I thought it would make sense to talk about my initial experience with Monitis.   Befo…
In order to fulfill our mission of inspiring learning in the technology community, Experts Exchange is launching a Course of the Month program. Premium and Team Account members will have access to one course per month as a part of their membership, …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 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