You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by angeloimm <an...@libero.it> on 2004/11/09 16:06:03 UTC
Newbie question about fd:multivaluefield
Hi all; i have this form definition piece:
<fd:multivaluefield id="relazioni">
<fd:label>Folder:</fd:label>
<fd:help>Scegliere a quali InfoBean relazionare l'InfoBean che si sta creando</fd:help>
<fd:datatype base="string"/>
<fd:selection-list src="cocoon:/IBlist.list"/>
</fd:multivaluefield>
and this function in my .js file:
function NIB() {
//Definisco le hash tael e gli arraylist utilizzati dal factory
var infoBean = new Packages.java.util.Hashtable();
var infoBeanProp_1 = new Packages.java.util.Hashtable();
var infoBeanProp_2 = new Packages.java.util.Hashtable();
var infoBeanProp_3 = new Packages.java.util.Hashtable();
var infoBeanProp_4 = new Packages.java.util.Hashtable();
var infoBeanPropsArray = new Packages.java.util.ArrayList();
//Form 1 del wizard
var NIBstep1Form = new Form("forms/NIBstep1.xml");
NIBstep1Form.showForm("NIBstep1.jxform");
//Prelevo i campi
var nome = NIBstep1Form.lookupWidget("nome");
var descrizione = NIBstep1Form.lookupWidget("descrizione");
var folder = NIBstep1Form.lookupWidget("folder");
//Salvo nel primo HashTable
infoBean.put( "name_class", nome.getValue() );
infoBean.put( "folder_path_absolute", "" );
infoBean.put( "path_for_folder_open", folder.getValue() );
infoBean.put( "path_form", "C:/hibernate/Nuova Cartella/createHBM/classes/ocm/forms" );
//Secondo step del wizard
var NIBstep2Form = new Form("forms/NIBstep2.xml");
NIBstep2Form.showForm("NIBstep2.jxform");
//Prelevo i dati
var estensione = NIBstep2Form.lookupWidget( "sceltaext" );
var estensioni = NIBstep2Form.lookupWidget( "estensioni" );
var folder_2 = NIBstep2Form.lookupWidget("relazioni");
print( "folder_2: "+ folder_2+" folder_2: "+ folder_2.getDatatype() ) ;
var NIBstep3Form = new Form("forms/NIBstep3.xml");
NIBstep3Form.showForm("NIBstep3.jxform");
var proprieta = NIBstep3Form.lookupWidget("proprieta");
print( "proprietà: "+ proprieta+ " lunghezza: "+ proprieta.length );
for( var i = 0; i < proprieta.length; i++ ){
print( "Riga: "+ i +" Nome: "+ proprieta[i].nome.value+" Descrizione: "+ proprieta[i].descrizione.value );
}
cocoon.sendPage("wizardEnder");
}
How can i have the selction of the list of the form in my function? By using lookupWidget i know that folder_2 is a MultiValueField... but how can i have its value? If i use folder_2.getValue(); i have:
[Ljava.lang.Object;@11067af
Thanks to all
____________________________________________________________
Libero ADSL: navighi gratis a 1.2 Mega, senza canone e costi di attivazione.
Abbonati subito su http://www.libero.it
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Newbie question about fd:multivaluefield
Posted by Jean-Baptiste Quenot <jb...@anyware-tech.com>.
* angeloimm:
> How can i have the selction of the list of the form in my function? By
> using lookupWidget i know that folder_2 is a MultiValueField... but
> how can i have its value? If i use folder_2.getValue(); i have:
> [Ljava.lang.Object;@11067af
The last line means: list of objects. In fact
MultiValueField.getValue() returns a Java array.
--
Jean-Baptiste Quenot
Anyware Technologies
http://www.anyware-tech.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org