Un floatingPane è una particolare dialog di Geoweb, basato su un componente Dojo, che ha la caratteristica di essere ridimensionabile dall'utente. Può essere aperto invocando la generica function openFloatingPane() con il corretto set di argomenti. Essa può essere usata direttamente, ma è anche invocata internamente a tutte le function semplificate che aprono schede di tipi specifici usando un minore set di parametri o settandone alcuni default (es: openGwClassDetailFloatingPane())
La funzione restituisce il widget dojo che di fatto rappresenta il floatingPane aperto, e che può esporre tutte le API generali (come gwRefresh(), gwReload(), etc..), se implementate, e API specifiche, che dipendono di volta in volta dalla tipologia di del contenuto del floatingPane (per esempio le API js di dettaglio di classe).
Ad ogni floatingPane viene assegnato, in fase di prima apertura, un id univoco (floatingPaneId) (dojo si assicura con non possa essere usato più volte). Esso è rilevante, in quanto, in caso di successive invocazioni della function openFloatingPane(), con lo stesso floatingPaneId, Geoweb in caso trovasse già aperto un floatingPane con lo stesso identificativo, lo ri-porterebbe semplicemente in primo piano (Anche se esistono parametri per forzare il refresh). E' buona prassi generare floatingPaneId utilizzando sempre le stesse metodologie per aprire tipi di contenuto simili.
codice minimale href GET
var params = { href: gwContextPath+'/rest/myURL?parma1=1¶m2=two' }; var floatingPane = openFloatingPane(params);
Codice minimale href POST:
var params = { href: gwContextPath+'/rest/myURL?parma1=1¶m2=two', method: 'POST', postData: { param3: 3, param4: 'four' }, }; var floatingPane = openFloatingPane(params);
Codice minimale content String:
var params = { content: '<div style="color: red;">Red Content</div>' }; var floatingPane = openFloatingPane(params);
Codice minimale content Object widget dojo:
var content = new dijit.layout.ContentPane({href: gwContextPath+'/rest/myURL?parma1=1¶m2=two', dummyProp: 'dummyVlaue'}); content.startup(); var params = { content: content }; var floatingPane = openFloatingPane(params);
Codice href GET con parametri inizializzati ai default:
var params = { floatingPaneId: 'floatingPaneId', href: gwContextPath+'/rest/myURL?parma1=1¶m2=two', preventCache: true, sync: false, forceRefresh: false, method: 'GET', modal: false, useCookie: false, title: 'title', dimensions: {w: 800, h: 600}, callback: null, callbackParams: [], props: {} }; var floatingPane = openFloatingPane(params);
Codice href versione POST con parametri inizializzati ai default:
var params = { floatingPaneId: 'floatingPaneId', href: gwContextPath+'/rest/myURL?parma1=1¶m2=two', preventCache: true, sync: false, forceRefresh: false, method: 'POST', postData: { param3: 3, param4: 'four' }, modal: false, useCookie: false, title: 'title', dimensions: {w: 800, h: 600}, callback: null, callbackParams: [], props: {} }; var floatingPane = openFloatingPane(params);
var floatingPane = openFloatingPane(); .. //simply hide the floatingPane: it ca be re-shown floatingPane.hide(); .. //re-shown the floatingPane floatingPane.show(); .. //definitelly close the floatingPane: cannot recall .show() on it floatingPane.close();