[forge-dev] UIInputMany - Multiple file section

George Gastaldi ggastald at redhat.com
Wed Aug 19 01:19:56 EDT 2015


This definitely looks like a bug. Can you open an issue in our JIRA? I'll
have a look asap.
Em 18/08/2015 22:10, "Rafael Pestano" <rmpestano at gmail.com> escreveu:

> About setting values of UiInputMany I'm trying to add files to
> an UIInputMany from a DirectoryResource but UIInputMany is not updated, see
> example:
>
>
>     @Inject
>     @WithAttributes(label = "Select Files")
>     private UIInputMany<FileResource<?>> files;
>
>     @Inject
>     @WithAttributes(label = "Select dir")
>     private UIInput<DirectoryResource> dir;
>
>     UIOutput out;
>
>
>         @Override
> public void initializeUI(UIBuilder uiBuilder) throws Exception {
>
> dir.addValueChangeListener(new ValueChangeListener() {
>
> @Override
> public void valueChanged(ValueChangeEvent event) {
> List<FileResource<?>> fileList = (List<FileResource<?>>) files.getValue();
> DirectoryResource selectedDir = (DirectoryResource) event.getNewValue();
> for (Resource<?>  resource : selectedDir.listResources()) {
> FileResource<?> fileToAdd = resource.reify(FileResource.class);
> if(fileToAdd != null && fileToAdd.exists() &&
> !fileList.contains(fileToAdd)){
> fileList.add(fileToAdd);
> }
> }
> //files.setValue(fileList);
> for (FileResource<?> fileResource : ((List<FileResource<?>>)
> files.getValue())) {
> out.out().println(fileResource.getName());
> }
>
> }
>
> });
> uiBuilder.add(dir).add(files);
> }
>
> Although file names are printed in the console the UI is not updated.
>
> Also files are not added to fileList until I add a file using UIInputMany,
> see this 30sec video: http://youtu.be/waJRpyGXIcw
>
>
>
>
>
> 2015-08-18 20:04 GMT-03:00 Rafael Pestano <rmpestano at gmail.com>:
>
>> Also in Eclipse (mars) i just can add a file at a time in UIInputMany.
>>
>> 2015-08-18 15:36 GMT-03:00 George Gastaldi <ggastald at redhat.com>:
>>
>>> Yes, you can call UIInputMany.setValues or setDefaultValues in the
>>> initializeUI method. I'll have a look at the UI behavior
>>>
>>> On Tue, Aug 18, 2015 at 3:30 PM, Rafael Pestano <rmpestano at gmail.com>
>>> wrote:
>>>
>>>> I'm using forge  2.17.0
>>>>
>>>> 2015-08-18 15:29 GMT-03:00 Rafael Pestano <rmpestano at gmail.com>:
>>>>
>>>>> Another question, can I feed/initialize the UIInputMany with values on
>>>>> initializeUI method?
>>>>>
>>>>> 2015-08-18 15:24 GMT-03:00 Rafael Pestano <rmpestano at gmail.com>:
>>>>>
>>>>>> Hi George,
>>>>>>
>>>>>> I'm on Intellij
>>>>>>
>>>>>> 2015-08-18 15:07 GMT-03:00 George Gastaldi <ggastald at redhat.com>:
>>>>>>
>>>>>>> Yes, that's how it should work. What UI are you using? Eclipse?
>>>>>>>
>>>>>>> On Tue, Aug 18, 2015 at 3:00 PM, Rafael Pestano <rmpestano at gmail.com
>>>>>>> > wrote:
>>>>>>>
>>>>>>>> Hi guys,
>>>>>>>>
>>>>>>>> there is a way to select multiple files *at once *using
>>>>>>>> UIInputMany?
>>>>>>>>
>>>>>>>> Here the way way i'm using it:
>>>>>>>>
>>>>>>>> @Inject
>>>>>>>> @WithAttributes(label = "Select Files")
>>>>>>>> private UIInputMany<FileResource<?>> files;
>>>>>>>>
>>>>>>>>
>>>>>>>> it promps the filesystem wizard to pick files but i can only select
>>>>>>>> a single file at a time.
>>>>>>>>
>>>>>>>> --
>>>>>>>> <http://www.advancedit.com.br/>Att,
>>>>>>>>
>>>>>>>> Rafael M. Pestano
>>>>>>>>
>>>>>>>> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do
>>>>>>>> Sul
>>>>>>>> http://rpestano.wordpress.com/
>>>>>>>> @realpestano <https://twitter.com/realpestano>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> forge-dev mailing list
>>>>>>>> forge-dev at lists.jboss.org
>>>>>>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> *George Gastaldi | Senior Software Engineer*
>>>>>>>
>>>>>>> JBoss Forge Team
>>>>>>> T: +55 11 3524-6169
>>>>>>> M: +55 47 9711-1000
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> forge-dev mailing list
>>>>>>> forge-dev at lists.jboss.org
>>>>>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> <http://www.advancedit.com.br/>Att,
>>>>>>
>>>>>> Rafael M. Pestano
>>>>>>
>>>>>> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>>>>>> http://rpestano.wordpress.com/
>>>>>> @realpestano <https://twitter.com/realpestano>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> <http://www.advancedit.com.br/>Att,
>>>>>
>>>>> Rafael M. Pestano
>>>>>
>>>>> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>>>>> http://rpestano.wordpress.com/
>>>>> @realpestano <https://twitter.com/realpestano>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> <http://www.advancedit.com.br/>Att,
>>>>
>>>> Rafael M. Pestano
>>>>
>>>> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>>>> http://rpestano.wordpress.com/
>>>> @realpestano <https://twitter.com/realpestano>
>>>>
>>>> _______________________________________________
>>>> forge-dev mailing list
>>>> forge-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>>>
>>>
>>>
>>>
>>> --
>>> *George Gastaldi | Senior Software Engineer*
>>>
>>> JBoss Forge Team
>>> T: +55 11 3524-6169
>>> M: +55 47 9711-1000
>>>
>>> _______________________________________________
>>> forge-dev mailing list
>>> forge-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>>
>>
>>
>>
>> --
>> <http://www.advancedit.com.br/>Att,
>>
>> Rafael M. Pestano
>>
>> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>> http://rpestano.wordpress.com/
>> @realpestano <https://twitter.com/realpestano>
>>
>
>
>
> --
> <http://www.advancedit.com.br/>Att,
>
> Rafael M. Pestano
>
> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
> http://rpestano.wordpress.com/
> @realpestano <https://twitter.com/realpestano>
>
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20150819/40f9919f/attachment-0001.html 


More information about the forge-dev mailing list