Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Nov 2006
    Messaggi
    79

    JSP selezione S/N con html:radio

    Salve ragazzi aiutatemi per favore a risolvere il seguente problema
    sto utilizzando STRUTS e jstl
    su ogni riga di una table devo emettere una scelta SI/NO con radio button,
    e con il codice sotto riportato mi viene visualizzato la richiesta.
    quello che non riesco a risolvere, è mettere a "checked" uno dei due bottoni secondo un campo di data base "${riga.commercialeSN}" che vale S/N
    codice:
        <td class='td08'><c:out value="${riga.spedizioniNumero}"/></td>
        <td class='td08'><c:out value="${riga.qtaSpedita}"/></td>
         <td class='td08'><c:out value="${riga.percentualeSpedizioni}"/></td>
    </tr>
    <tr>
       <td>
           Conferma:
            <html:radio property="commercialeSN" value="S"/>Si
             <html:radio property="commercialeSN" value="N"/>No
         </td>
     </tr>

    Grazie anticipatamente per l'aiuto

  2. #2
    Utente di HTML.it
    Registrato dal
    Aug 2002
    Messaggi
    8,013
    non uso struts però onestamente non mi piace come vengono gestiti la maggior parte degli elementi di un form dalla maggior parte delle tag libraries che ho visto in giro (ossia, i form li scrivo a mano). Detto ciò, visto che la domanda pertiene struts:

    http://www.mail-archive.com/struts-u.../msg22579.html

    [...]
    So for set of radio buttons...
    codice:
    <html:radio property="propertyname" value="1">
    <html:radio property="propertyname" value="2">
    you'd preselect the first radio button by having your "getPropertyName()"
    method in your ActionForm return a "1" by default. So you'd want to set the
    value that is returned by "getPropertyName()" to "1" at the constructor
    level and the reset level (I was only doing it in the reset method).
    Se può esserti utile.
    <´¯)(¯`¤._)(¯`»ANDREA«´¯)(_.¤´¯)(¯`>
    "The answer to your question is: welcome to tomorrow"

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.