Visualizzazione dei risultati da 1 a 10 su 10
  1. #1
    Moderatore di Server Apache L'avatar di marketto
    Registrato dal
    Sep 2001
    Messaggi
    5,858

    [XUL] refresh del datasource

    ciao, ho visto che è possibile effettuare un refresh del datasource caricato dentro un template...

    qualcuno ha mai provato??

    ho trovato questo ma nn riesco a farlo andare:
    http://www.xulplanet.com/tutorials/m...srcdetails.php
    http://xulplanet.com/downloads/rdfds/
    http://www.maubi.net/~waterson/mozil...s/refresh.html


    think simple think ringo

  2. #2
    Moderatore di Server Apache L'avatar di marketto
    Registrato dal
    Sep 2001
    Messaggi
    5,858
    forse ho trovato:
    http://xulfr.org/wiki/ApplisWeb/ExemplePhpRdf

    xò è in francese
    think simple think ringo

  3. #3
    Utente di HTML.it L'avatar di kuarl
    Registrato dal
    Oct 2001
    Messaggi
    1,093
    l'ultimo link che hai postato mi sembra faccia quello che ti serve, che errore ti da? lo esegui come chrome o dal browser?

  4. #4
    Moderatore di Server Apache L'avatar di marketto
    Registrato dal
    Sep 2001
    Messaggi
    5,858
    si si, funziona...lo eseguo dal browser, xò il mio datasource è leggermente più complesso, in quanto ha delle voci annidate...
    hai presente l'esempio degli animali su xulplanet.com?? una cosa simile...

    think simple think ringo

  5. #5
    Utente di HTML.it L'avatar di kuarl
    Registrato dal
    Oct 2001
    Messaggi
    1,093
    Originariamente inviato da marketto
    si si, funziona...lo eseguo dal browser, xò il mio datasource è leggermente più complesso, in quanto ha delle voci annidate...
    hai presente l'esempio degli animali su xulplanet.com?? una cosa simile...

    cioé carichi il datasource in un tree?

    posta un po' di codice

  6. #6
    Moderatore di Server Apache L'avatar di marketto
    Registrato dal
    Sep 2001
    Messaggi
    5,858
    eccolo

    dati.xul
    codice:
    <?xml version="1.0"?>
    
    <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
    
    <window id="example-window" title="Example 6.8.2"
            xmlns:html="http://www.w3.org/1999/xhtml"
            xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    
    <tree flex="1" width="200" height="200"
          datasources="dati.rdf" ref="http://www.badessa.it/tutti-artisti">
    
      <treecols>
        <treecol id="aritsta" label="Artista" primary="true" flex="1"/>
        <treecol id="durata" label="Durata" flex="1"/>
      </treecols>
    
      <template>
        <rule>
          <treechildren>
           <treeitem uri="rdf:*">
             <treerow>
               <treecell label="rdf:http://www.badessa.it/rdf#artista"/>
               <treecell label="rdf:http://www.badessa.it/rdf#durata"/>
             </treerow>
           </treeitem>
          </treechildren>
        </rule>
    
      </template>
    </tree>
    </window>

    dati.rdf (ho dovuto inserire uno spazio prima e dopo i : altrimenti il forum faceva casini)
    codice:
    <RDF : RDF xmlns : RDF="http : //www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns : ARTISTI="http : //www.badessa.it/rdf#">
    	<RDF : Description RDF : about="http : //www.badessa.it/2">
    		<ARTISTI : artista>Francesco De Gregori</ARTISTI : artista>
    	</RDF : Description>
    		<RDF : Description RDF : about="http : //www.badessa.it/2/5" ARTISTI : specimens="0">
    			<ARTISTI : artista>Amore nel pomeriggio</ARTISTI : artista>
    			<ARTISTI : durata>100</ARTISTI : durata>
    		</RDF : Description>
    		<RDF : Description RDF : about="http : //www.badessa.it/2/6" ARTISTI : specimens="0">
    			<ARTISTI : artista>Rimmel</ARTISTI : artista>
    			<ARTISTI : durata>110</ARTISTI : durata>
    		</RDF : Description>
    	<RDF : Description RDF : about="http : //www.badessa.it/1">
    		<ARTISTI : artista>Pink Floyd</ARTISTI : artista>
    	</RDF : Description>
    		<RDF : Description RDF : about="http : //www.badessa.it/1/1" ARTISTI : specimens="0">
    			<ARTISTI : artista>Dark side of the moon</ARTISTI : artista>
    			<ARTISTI : durata>100</ARTISTI : durata>
    		</RDF : Description>
    		<RDF : Description RDF : about="http : //www.badessa.it/1/3" ARTISTI : specimens="0">
    			<ARTISTI : artista>The final cut</ARTISTI : artista>
    			<ARTISTI : durata>90</ARTISTI : durata>
    		</RDF : Description>
    		<RDF : Description RDF : about="http : //www.badessa.it/1/2" ARTISTI : specimens="0">
    			<ARTISTI : artista>The wall</ARTISTI : artista>
    			<ARTISTI : durata>120</ARTISTI : durata>
    		</RDF : Description>
    		<RDF : Description RDF : about="http : //www.badessa.it/1/4" ARTISTI : specimens="0">
    			<ARTISTI : artista>Wish you were here</ARTISTI : artista>
    			<ARTISTI : durata>60</ARTISTI : durata>
    		</RDF : Description>
    	<RDF : Seq RDF : about="http : //www.badessa.it/tutti-artisti">
    	 <RDF : li>
    	  <RDF : Seq RDF : about="http : //www.badessa.it/2">
    		  <RDF : li RDF : resource="http : //www.badessa.it/2/5"/>
    		  <RDF : li RDF : resource="http : //www.badessa.it/2/6"/>
    	  </RDF : Seq>
    	 </RDF : li>
    	 <RDF : li>
    	  <RDF : Seq RDF : about="http : //www.badessa.it/1">
    		  <RDF : li RDF : resource="http : //www.badessa.it/1/1"/>
    		  <RDF : li RDF : resource="http : //www.badessa.it/1/3"/>
    		  <RDF : li RDF : resource="http : //www.badessa.it/1/2"/>
    		  <RDF : li RDF : resource="http : //www.badessa.it/1/4"/>
    	  </RDF : Seq>
    	 </RDF : li>
    	</RDF : Seq>
    </RDF : RDF>
    think simple think ringo

  7. #7
    Moderatore di Server Apache L'avatar di marketto
    Registrato dal
    Sep 2001
    Messaggi
    5,858
    ho provato ad aggiungere questo, però ottengo un errore:
    A script from "http://localhost" was denied UniversalXPConnect privileges

    codice:
    <?xml version="1.0"?>
    
    <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
    
    <window id="example-window" title="Example 6.8.2"
            xmlns:html="http://www.w3.org/1999/xhtml"
            xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    
    <script type="application/x-javascript"><![CDATA[
      var tree;
      var out;
      var datasource;
    
      var Observer = {
          onBeginLoad: function(aSink) { out.label = 'Begin refresh';},
          onInterrupt: function(aSink) { out.label = 'Refresh interrupted!';},
          onResume: function(aSink) { out.label = 'Refresh resume!';},
          onEndLoad: function(aSink) { tree.builder.rebuild(); out.label = 'Refresh done'; },
          onError: function(aSink, aStatus, aErrorMsg) { alert('Error! ' + aErrorMsg); }
      };
    
      function reloadTree(treeId)
      {
        try {
          netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
          var sink = datasource.QueryInterface(Components.interfaces.nsIRDFXMLSink);
          sink.addXMLSinkObserver(Observer);
          datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource).Refresh(false);
          tree = document.getElementById(treeId);
        }
        catch(e) {
          alert(e);
        }
      }
      ]]></script>
    
    <button label="Refresh" oncommand="reloadTree('tree')" />
    
    <tree id="tree" flex="1" width="200" height="200"
          datasources="dati.rdf" ref="http://www.badessa.it/tutti-artisti">
    
      <treecols>
        <treecol id="aritsta" label="Artista" primary="true" flex="1"/>
        <treecol id="durata" label="Durata" flex="1"/>
      </treecols>
    
      <template>
        <rule>
          <treechildren>
           <treeitem uri="rdf:*">
             <treerow>
               <treecell label="rdf:http://www.badessa.it/rdf#artista"/>
               <treecell label="rdf:http://www.badessa.it/rdf#durata"/>
             </treerow>
           </treeitem>
          </treechildren>
        </rule>
    
      </template>
    </tree>
    <statusbar flex="1"><statusbarpanel flex="1" id="out" label=""/></statusbar>
    
    </window>
    think simple think ringo

  8. #8
    Utente di HTML.it L'avatar di kuarl
    Registrato dal
    Oct 2001
    Messaggi
    1,093
    prova ad eseguirlo da chrome:

    firefox -chrome="tuoFileXul.xul"

    altrimenti ti consiglio di postare sul forum ufficiale o di iscriverti alla mailing list italiana di xul, li c'è gente competente

  9. #9
    Originariamente inviato da kuarl
    altrimenti ti consiglio di postare sul forum ufficiale o di iscriverti alla mailing list italiana di xul, li c'è gente competente
    Sarebbe bello portare anche qui qualche competenza in merito.
    Are you alive?
    No, but I was written with LOVE. A new scripting language.
    www.frequenze.it

  10. #10
    Moderatore di Server Apache L'avatar di marketto
    Registrato dal
    Sep 2001
    Messaggi
    5,858
    Originariamente inviato da Mutato
    Sarebbe bello portare anche qui qualche competenza in merito.
    purtroppo la documentazione italiana è ancora scarsa
    think simple think ringo

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.