Results 1 to 5 of 5
  1. #1
    kishan's Avatar
    kishan is offline Member
    Join Date
    Apr 2009
    Posts
    57
    Rep Power
    0

    Default Displaying Radio Buttons in JSP

    Hi folks,
    I displaying the radio buttons dynamically by calling data base.
    The radio button list taken as arraylist from database.
    The class applied for the radio button Label in static.
    Plz observe the below code
    Java Code:
    // Radio buttons list coming from database like this
    
    elementData= Object[10]  (id=4096)	
    	[0]= RadioBean  (id=4098)	
    		defaultYN= true	
    		groupName= "Status"	
    		id= "1655"	
    		objectName= "Statusgrp"	
    		value= Open"	
    	[1]= RadioBean  (id=4097)	
    		defaultYN= false	
    		groupName= "Status"	
    		id= "1656"	
    		objectName= "Statusgrp"	
    		value= "Closed"
    and HTML code is
    Java Code:
    //Displaying radio buttons in HTML page
    
    <logic:iterate property="statusResults" id="var" name="ProjectForm">
    	<html:radio property="statusId" value="id" idName="var" />
    	<font class="controlfont"> 
                        <bean:write name="var" property="value" /> 
                </font>
    </logic:iterate>
    but now I have to apply font of the radio button label class dynamically from the data base.The data coming like this
    Java Code:
    //Radio buttons list coming from database With font class.
    
    elementData= Object[10]  (id=4096)	
    	[0]= RadioBean  (id=4098)	
    		defaultYN= true	
    		groupName= "Status"	
    		id= "1655"	
    		objectName= "Statusgrp"	
    		value= "<font class="controlfont"> Open</font>"	
    	[1]= RadioBean  (id=4097)	
    		defaultYN= false	
    		groupName= "Status"	
    		id= "1656"	
    		objectName= "Statusgrp"	
    		value= "<font class="controlfont"> Closed</font>"


    can u people, help me what modification I have to do in HTML ,to apply the font in a dynamic way from database.

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Just set the styleClass dynamically.
    Here is an example using JSF

    Java Code:
    styleClass="#{node.disabled ? 'disabledTextStyle':'normalStyle'}"

  3. #3
    kishan's Avatar
    kishan is offline Member
    Join Date
    Apr 2009
    Posts
    57
    Rep Power
    0

    Default

    thank u for reply but the observe that the font class also coming from database along with the value. Plz check the last coding part of my thread.

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    The design sort of smells. Why is the font being stored in the database?

  5. #5
    kishan's Avatar
    kishan is offline Member
    Join Date
    Apr 2009
    Posts
    57
    Rep Power
    0

Similar Threads

  1. [SOLVED] Radio Buttons
    By dbashby in forum New To Java
    Replies: 2
    Last Post: 04-04-2009, 03:44 PM
  2. Deselect Radio Buttons
    By linux1man in forum AWT / Swing
    Replies: 7
    Last Post: 03-21-2009, 04:01 AM
  3. How to use Radio Buttons
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-25-2008, 02:26 PM
  4. radio buttons and paint
    By gtraylo in forum Java Applets
    Replies: 1
    Last Post: 04-19-2008, 12:43 PM
  5. property for radio buttons
    By swapnanair in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 12-03-2007, 08:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •