We can't reproduce either of the issues you reported on the 18th. File add uploads appear to be working fine, as does disabling a MultiFileItem. This was tested with today's 3.1p build (2/20). Please try your use case with that same build and if you still see problems, please show a standalone test case (the Showcase Upload -> Multi File sample probably would make a great start point)
Announcement
Collapse
No announcement yet.
X
-
Hi,
I've downloaded yesterday Isomorphic SmartClient/SmartGWT Framework (v8.3p_2013-02-20/PowerEdition Deployment 2013-02-20) and since then been testing it extensively.
Just switching the library didn't resolve the problem, I was getting the aforementioned "this.picker is undefined".
I've made some tests using a blank form using the exact same Datasource as in my application with only the MultiFileItem on it and was able to save attachments without problems.
I went back to my application and started to comment out code to isolate the problem. Turns out that when I commented the creation of two StaticTextItem containing numeric values on my form the upload started to work.
Then I've tested saving the form without attachment and got on every attempt the "this.picker is undefined" error:
Code:10:34:23.810 [ERROR] [br.gov.funasa.fiscalizacao.Fiscalizacao] 10:34:23.792:XRP5:WARN:Log:TypeError: this.picker is undefined Stack from error.stack: unnamed(isc_MultiFileItem_saveDataCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Forms.js:1798 unnamed(isc_MultiFileItem_formSave) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Forms.js:1798 unnamed(.formSavedComplet) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1499 unnamed(.$49) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1499 unnamed(anonymou) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:63 unnamed(isc_c_Class_fireCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:256 unnamed(isc_Class_fireCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:311 unnamed(isc_DataSource_fireResponseCallback) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:639 unnamed(isc_DataSource__completeResponseProcessin) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:637 unnamed(isc_DataSource__handleSCServerRepl) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1663 unnamed(isc_c_Class_fireCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:256 unnamed(isc_Class_fireCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:311 unnamed(isc_c_RPCManager_fireReplyCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1217 unnamed($wnd.isc.RPCManager.fireReplyCallbac) @ :241 unnamed(isc_c_RPCManager_fireReplyCallback) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1220 unnamed(isc_c_RPCManager_performOperationRepl) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1217 unnamed(isc_c_RPCManager__performTransactionRepl) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1211 unnamed(isc_c_RPCManager_performTransactionRepl) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1177 unnamed(anonymou) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:63 unnamed(isc_c_Class_fireCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:256 unnamed(isc_c_Comm_performXmlTransactionRepl) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:919 unnamed(anonymou) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:63 unnamed(isc_c_Class_fireCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:256 unnamed(isc_c_Comm__fireXMLCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:901 unnamed(isc_c_Comm_sendXmlHttpRequest/_1) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:906 unnamed() @ com.smartgwt.client.core.JsObject$SGWT_WARN: 10:34:23.792:XRP5:WARN:Log:TypeError: this.picker is undefined Stack from error.stack: unnamed(isc_MultiFileItem_saveDataCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Forms.js:1798 unnamed(isc_MultiFileItem_formSave) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Forms.js:1798 unnamed(.formSavedComplet) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1499 unnamed(.$49) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1499 unnamed(anonymou) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:63 unnamed(isc_c_Class_fireCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:256 unnamed(isc_Class_fireCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:311 unnamed(isc_DataSource_fireResponseCallback) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:639 unnamed(isc_DataSource__completeResponseProcessin) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:637 unnamed(isc_DataSource__handleSCServerRepl) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1663 unnamed(isc_c_Class_fireCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:256 unnamed(isc_Class_fireCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:311 unnamed(isc_c_RPCManager_fireReplyCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1217 unnamed($wnd.isc.RPCManager.fireReplyCallbac) @ :241 unnamed(isc_c_RPCManager_fireReplyCallback) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1220 unnamed(isc_c_RPCManager_performOperationRepl) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1217 unnamed(isc_c_RPCManager__performTransactionRepl) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1211 unnamed(isc_c_RPCManager_performTransactionRepl) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_DataBinding.js:1177 unnamed(anonymou) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:63 unnamed(isc_c_Class_fireCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:256 unnamed(isc_c_Comm_performXmlTransactionRepl) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:919 unnamed(anonymou) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:63 unnamed(isc_c_Class_fireCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:256 unnamed(isc_c_Comm__fireXMLCallbac) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:901 unnamed(isc_c_Comm_sendXmlHttpRequest/_1) @ br.gov.funasa.fiscalizacao.Fiscalizacao/sc/modules/ISC_Core.js:906 unnamed() @ at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) at java.lang.Thread.run(Thread.java:662)
I've then made a test with a minimal example, the same I've used to test the upload:
Code:private void testeUpload2() { final DynamicForm form = new DynamicForm(); form.setDataSource(DataSource.get(Constantes.DS_REL_MENSAL)); form.setItems(criaMultiFileItem(Constantes.DS_ANEXO_ENSAIO_REL_MENSAL, "documentoEnsaio", "Attachments")); Map initialValues = new HashMap(); initialValues.put("codProjeto", "50639"); initialValues.put("numProjeto", "GO1207113569"); form.editNewRecord(initialValues); IButton button = new IButton("Salvar"); button.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { form.saveData(new DSCallback() { @Override public void execute(DSResponse response, Object rawData, DSRequest request) { SC.say("Done saving!"); } }); } }); VLayout layout = new VLayout(); layout.setMembers(form, button); layout.draw(); } public static MultiFileItem criaMultiFileItem(String datasource, String nome, String titulo) { MultiFileItem multiFilePicker = new MultiFileItem(nome); multiFilePicker.setAttribute("dataSource", datasource); multiFilePicker.setTitle(titulo); multiFilePicker.setTitleOrientation(TitleOrientation.TOP); multiFilePicker.setWidth("100%"); multiFilePicker.setColSpan(3); multiFilePicker.setEditButtonPrompt("Adicionar arquivos"); multiFilePicker.setRemoveButtonPrompt("Excluir arquivos"); multiFilePicker.setPickerAddAnotherFileButtonTitle("Adicionar outro"); multiFilePicker.setPickerCancelButtonTitle("Cancelar"); multiFilePicker.setPickerUploadButtonTitle("Salvar"); return multiFilePicker; }
Testing more I've found that when you click on the "+" icon and the picker shows up, click on "Cancel", data is saved normally.
Looks like if you don't create the picker things don't work. Could have a look?
Comment
Comment