Visualizzazione dei risultati da 1 a 7 su 7
  1. #1
    Utente di HTML.it
    Registrato dal
    May 2004
    Messaggi
    309

    [JAVA]Struts 2 - problema tag fieldset

    Ciao
    stavo cercando di inserire un fieldset in un div di struts ma non mi visualizza niente a meno che non elimino il tag fieldset e legend.
    Non riesco a capire come mai. Se dall'output recupero l'html generato e lo salvo in una pagina statica htm funziona. Ecco il codice :
    codice:
    <s:tabbedPanel id="test2" theme="simple" cssStyle="width: 100%; height: 90%; " doLayout="true">
                <s:div id="left" label="Inserimento manuale" theme="ajax"    >
    
                    <form action="newPratica.action" name="newPratica" method="post">
                        <table width="100%" heigth="100%" border="1">
                            <tr><td><h4>Modulo d'iscrizione asilo nido ddd</h4><hr /></td></tr>
                            <tr><td>
    
    
                                <fieldset>
                                    <legend>Richiedente:</legend>
                                    <table width="100%" height="100%" border="1">
                                        <tr>
                                            <td class="tdLabel">gdsgdfgdf
                                                <label for="newPratica_da" class="label">Da: </label>
                                            </td>
                                            <td>
                                                <input type="text" name="da" value="" id="newPratica_da"/>
                                            </td>
                                            <td></td>
                                            <td></td>
                                            <td></td>
                                            <td></td>
                                            <td></td>
                                            <td></td>
                                        </tr>
                                    </table>
                                </fieldset>
                            </td></tr>
                        </table>
                    </form>
                </s:div >


    ps:
    notare che non ho usato s:form di struts perchè devo mettere i campi del form su più colonne e sembra che i templete esistenti di struts (freemarker) non lo fanno
    tomcat 6.016
    netbeans 6.1

  2. #2
    Utente di HTML.it
    Registrato dal
    Aug 2002
    Messaggi
    8,013
    posso fare un appunto: non formattare con una table (lo so che è più rapido), piuttosto usa un layout in css ad-hoc. Poi quel fieldset dentro un td a me non piace molto... inserirei piuttosto l'intero form nel fieldset.
    <´¯)(¯`¤._)(¯`»ANDREA«´¯)(_.¤´¯)(¯`>
    "The answer to your question is: welcome to tomorrow"

  3. #3
    Utente di HTML.it
    Registrato dal
    May 2004
    Messaggi
    309
    il problema che la form è composta da varie sezioni e volevo fare dei fieldset per le n sezioni.
    l'alternativa a cui pensavo a questo punto è farla su più passaggi.
    mi spiego (ci provo):
    una pratica ha un richiedente e 0 o più persone (nucleo familiare).
    pensavo quindi di far compilare la parte anagrafica del richiedente, poi con un tastino aggiungi pensavo di far apparire la possibilità di aggiungere un nuovo elemento.
    in effetti la tabbella contenitore la posso evitare, è lì anche per le varie prove fatte.

    Ora la soluzione che pensavo è di mettere 3 tasti in basso: aggiungi familiare, avanti e il lolito reset.
    nei primi 2 casi metto in sessione i dati inseriti o li riporto in tag di input non visibili fino alla fine dell'inserimento dati.
    tomcat 6.016
    netbeans 6.1

  4. #4
    Utente di HTML.it
    Registrato dal
    Aug 2002
    Messaggi
    8,013
    Se giustamente volevi dividere in sezioni allora tieni il fieldset dentro il tag form, altrimenti snaturiamo il fieldset... però prova a postare tutto il codice HTML come arriva al browser.
    <´¯)(¯`¤._)(¯`»ANDREA«´¯)(_.¤´¯)(¯`>
    "The answer to your question is: welcome to tomorrow"

  5. #5
    Utente di HTML.it
    Registrato dal
    May 2004
    Messaggi
    309
    eccolo:
    codice:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
       <head>    
           <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>Gestione asili nidi</title>
            <script src="resources/mootools_1_2_1/mootools_core_1_2_1.js" type="text/javascript"></script>
            <script src="resources/mootools_1_2_1/mootools_1_2_1_more.js" type="text/javascript"></script>
            <script src="resources/mootabs1.2.js" type="text/javascript"></script>
            
            <link rel="stylesheet" href="/gestioneNidi/struts/xhtml/styles.css" type="text/css"/>
    <script type="text/javascript">
        // Dojo configuration
        djConfig = {
            baseRelativePath: "/gestioneNidi/struts/dojo",
            isDebug: true,
            bindEncoding: "UTF-8",
            debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes
        };
    </script>
    <script type="text/javascript"  src="/gestioneNidi/struts/dojo/dojo.js"></script>
    <script type="text/javascript" src="/gestioneNidi/struts/simple/dojoRequire.js"> </script><script type="text/javascript" src="/gestioneNidi/struts/ajax/dojoRequire.js"> </script>
    <script type="text/javascript" src="/gestioneNidi/struts/CommonFunctions.js"> </script>
    
            <link href="/gestioneNidi/css/main.css" rel="stylesheet" type="text/css"/>
            <link rel="stylesheet" type="text/css" href="/gestioneNidi/css/displaytag.css">
            <link rel="stylesheet" type="text/css" href="/gestioneNidi/struts/tabs.css">
            <link rel="stylesheet" type="text/css" href="/gestioneNidi/css/alternative.css">
            <script type="text/javaScript">         
                window.moveTo(0,0);
                window.resizeTo(screen.width, screen.height-30);         
          </script>
          <style type="text/css">
             img, div { behavior: url(/gestioneNidi/css/iepngfix.htc) }
          </style>
          
       </head>
       <body id="win">
          <script>         
             var w = document.body.clientWidth; 
             var win = $('win');
             win.style.width=w;
             win.style.left=0;
             document.getElementById("win").style.top=0;     
             var myWidth = 0, myHeight = 0;
             if( typeof( window.innerWidth ) == 'number' ) {
                //Non-IE
                myWidth = window.innerWidth;
                myHeight = window.innerHeight;
             } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
                //IE 6+ in 'standards compliant mode'
                myWidth = document.documentElement.clientWidth;
                myHeight = document.documentElement.clientHeight;
             } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                //IE 4 compatible
                myWidth = document.body.clientWidth;
                myHeight = document.body.clientHeight;
             }          
          </script>
    
          <div  id="header"  >
             [img]img/nidi.png[/img]
             
          </div>
         
        
    <div id="container"  >
        <script type="text/javaScript"> 
            
            var heightBody = myHeight-160; 
            document.getElementById("container").style.height=heightBody;
            var widthBody = myWidth-25;
            document.getElementById("container").style.width=widthBody;
            
            /*/var heightLeggend = myHeight-250; 
            document.getElementById("form").style.height=heightLeggend;
            var widthLeggend = myWidth-40;
            document.getElementById("form").style.width=widthLeggend;*/
    
            function toggleSet(rad) {   
                var type = rad.value;   
                for(var k=0,elm;elm=rad.form.elements[k];k++)     
                    if(elm.className=='item')       
                        elm.style.display = elm.id==type? 'inline':''; 
            } 
        </script> 
        
    <div   id="menu_v" >
        
        <h3 class="titMenu">Pratiche</h3>
        <ul class="menu2">		        		
            <li title="Nuova pratica" onmouseover="this.className='hover';" onmouseout="this.className='';">
                Nuova pratica
            	
            
            <li title="Archivio pratiche" onmouseover="this.className='hover';" onmouseout="this.className='';">
                Archivio pratiche
            [/list]
        
        <h3 class="titMenu">Graduatoria</h3>
        <ul class="menu2">		        		
            <li title="Graduatoria aperta" onmouseover="this.className='hover';" onmouseout="this.className='';">
                Graduatoria aperta
            	
            
            <li title="Archivio graduatoria" onmouseover="this.className='hover';" onmouseout="this.className='';">
                Archivio graduatorie
            [/list]	
        
        <h3 class="titMenu">Gestione</h3>
        <ul class="menu2">		        		
    
            <li title="Gestione nidi" onmouseover="this.className='hover';" onmouseout="this.className='';">
                Gestione nidi
            
            <li title="Tabella ISEE" onmouseover="this.className='hover';" onmouseout="this.className='';">
                Tabella ISEE
            
            <li title="Fattori sociali" onmouseover="this.className='hover';" onmouseout="this.className='';">
                Fattori sociali
            [/list]	
    </div> 
    
       
    
    
        <div  id="body_"  >
            <h2>Nuova pratica</h2>
            <hr />
            
            <script type="text/javascript">
                dojo.require("dojo.widget.TabContainer");
                dojo.require("dojo.widget.LinkPane");
                dojo.require("dojo.widget.ContentPane");
           </script>
    
    <div dojoType="TabContainer"
        style="width: 100%; height: 90%; "    id="test2"    doLayout="true">
                
    <div dojoType="struts:BindDiv" id="left" label="Inserimento manuale"  showError="true">
    
                    <form action="newPratica.action" name="newPratica" method="post">
                        <h4>Modulo d'iscrizione asilo nido ddd</h4><hr />
                        
    
                            <fieldset>
                                <legend>Richiedente:</legend>
                                <table width="100%" height="100%" border="1">
                                    <tr>
                                        <td class="tdLabel">gdsgdfgdf
                                            <label for="newPratica_da" class="label">Da: </label>
                                        </td>
                                        <td>
                                            <input type="text" name="da" value="" id="newPratica_da"/>
                                        </td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                </table>
                            </fieldset>
                    </form>
                </div>
    
                <div dojoType="struts:BindDiv"
      	id="middle"    style="margin-top: 20px;"    label="uoload file"    showError="true">
    
                    			
    <form id="uploadXml" onsubmit="return true;" action="uploadXml" target="" method="post">
    
    <table class="wwFormTable">                                       
    <tr>
        <td class="tdLabel"><label for="uploadXml_fileXml" class="label">Carica file:</label></td>
        <td><input type="file" name="fileXml" value="" id="uploadXml_fileXml"/></td>
    </tr>
    
     <tr><td colspan="2"><hr /></td></tr>
     <tr>
        <td colspan="2">
            <div align="left">
                 <input type="submit" id="uploadXml_inviaFile" name="inviaFile" value="Invia"/>
            </div>
        </td>
    </tr>             
     </table></form>
                </div>
            </div>
            
       </div>    
    </div>
        </body>
    </html>
    tomcat 6.016
    netbeans 6.1

  6. #6
    Utente di HTML.it
    Registrato dal
    Aug 2002
    Messaggi
    8,013
    Strippando tutto il contenuto javascript e css, ovver lasciando solo questo:

    codice:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
       <head>    
           <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>Gestione asili nidi</title>      
       </head>
       <body id="win">
          <div  id="header"  >
             [img]img/nidi.png[/img]         
          </div>
          <div id="container">
            <div id="menu_v">
              <h3 class="titMenu">Pratiche</h3>
              <ul class="menu2">
                      <li title="Nuova pratica" onmouseover="this.className='hover';" onmouseout="this.className='';">Nuova pratica
                      <li title="Archivio pratiche" onmouseover="this.className='hover';" onmouseout="this.className='';">Archivio pratiche[/list]
              
              <h3 class="titMenu">Graduatoria</h3>
              <ul class="menu2">
                <li title="Graduatoria aperta" onmouseover="this.className='hover';" onmouseout="this.className='';">Graduatoria aperta
                <li title="Archivio graduatoria" onmouseover="this.className='hover';" onmouseout="this.className='';">Archivio graduatorie[/list]	
              
              <h3 class="titMenu">Gestione</h3>
                <ul class="menu2">
                  <li title="Gestione nidi" onmouseover="this.className='hover';" onmouseout="this.className='';">Gestione nidi
                  <li title="Tabella ISEE" onmouseover="this.className='hover';" onmouseout="this.className='';">Tabella ISEE
                  <li title="Fattori sociali" onmouseover="this.className='hover';" onmouseout="this.className='';">Fattori sociali[/list]
              </div>
              
              <div  id="body_">
                <h2>Nuova pratica</h2>
                <hr />
                <div dojoType="TabContainer" style="width: 100%; height: 90%;" id="test2" doLayout="true">
                <div dojoType="struts:BindDiv" id="left" label="Inserimento manuale" showError="true">
                    <form action="newPratica.action" name="newPratica" method="post">
                       <h4>Modulo d'iscrizione asilo nido ddd</h4><hr />
    
                       <fieldset>
                         <legend>Richiedente:</legend>
                         <table width="100%" height="100%" border="1">
                           <tr>
                             <td class="tdLabel">gdsgdfgdf <label for="newPratica_da" class="label">Da: </label></td>
                             <td><input type="text" name="da" value="" id="newPratica_da"/></td>
                             <td></td>
                             <td></td>
                             <td></td>
                             <td></td>
                             <td></td>
                             <td></td>
                           </tr>
                         </table>
                       </fieldset>
                    </form>
                </div>
    
                <div dojoType="struts:BindDiv" id="middle" style="margin-top: 20px;" label="uoload file" showError="true">
                  <form id="uploadXml" onsubmit="return true;" action="uploadXml" target="" method="post">
                    <table class="wwFormTable">
                      <tr>
                        <td class="tdLabel"><label for="uploadXml_fileXml" class="label">Carica file:</label></td>
                        <td><input type="file" name="fileXml" value="" id="uploadXml_fileXml"/></td>
                      </tr>
                      <tr>
                        <td colspan="2"><hr /></td>
                      </tr>
                      <tr>
                        <td colspan="2">
                          <div align="left">
                            <input type="submit" id="uploadXml_inviaFile" name="inviaFile" value="Invia"/>
                          </div>
                        </td>
                      </tr>
                    </table>
                  </form>
                </div>
              </div>
            </div>
          </div>
        </body>
    </html>
    il fieldset si vede... quindi possibilmente l'errore risiede in qualcuno di quei file javascript/css... prova ad aprire la console degli errori di Firefox e vedere se trovi qualche errore/warning lì.
    <´¯)(¯`¤._)(¯`»ANDREA«´¯)(_.¤´¯)(¯`>
    "The answer to your question is: welcome to tomorrow"

  7. #7
    Utente di HTML.it
    Registrato dal
    May 2004
    Messaggi
    309
    tranne questa parte:
    codice:
    <script>         
             var w = document.body.clientWidth; 
             var win = $('win');
             win.style.width=w;
             win.style.left=0;
             document.getElementById("win").style.top=0;     
             var myWidth = 0, myHeight = 0;
             if( typeof( window.innerWidth ) == 'number' ) {
                //Non-IE
                myWidth = window.innerWidth;
                myHeight = window.innerHeight;
             } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
                //IE 6+ in 'standards compliant mode'
                myWidth = document.documentElement.clientWidth;
                myHeight = document.documentElement.clientHeight;
             } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                //IE 4 compatible
                myWidth = document.body.clientWidth;
                myHeight = document.body.clientHeight;
             }          
          </script>
    che ho fatto io (che non funge con firefox, e che dovrò correggere) il resto lo piazza struts dentro.
    cmq se prendi l'html che ne esci fuori e lo salvi in una pagina html il fieldset è visibbile... anche con richiami javascript che qomunque non funzioneranno visto i i percorsi poi saranno sbagliati
    tomcat 6.016
    netbeans 6.1

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 © 2025 vBulletin Solutions, Inc. All rights reserved.