What is use of ‘Is collection’ checkbox in Dynamic attribute screen? I was hoping that it would allow creation of multi-valued field instead of singleton value.
Thank you for the question.
This checkbox will allow you to select multiple values in a field, but there’s a bug for now, see the corresponding YouTrack issue. The fix will be delivered with the next 6.5.4 platform release.
I was able to reproduce this bug in 6.10.7 platform. This bug is still present, can you update the corresponding bug item for this issue?
Thank you.
Thank you for this report.
Could you please provide an exception stack trace and, if possible, attach a demo project where the bug reproduces.
Reproduce steps and stack trace are below.
Reproduce steps:
-
under dynamic attributes, create a ‘Car’ category for Asset entity. The dynamic attribute settings are like this: (see attached picture.png)
testexample.zip (77.2 KB)
-
Application -> Asset
-
Create Asset (asset edit screen)
-
Enter a value for ‘Make’ and hit ‘OK’
a. Receive NullPointerException:
Stack Trace
java.lang.NullPointerException
at java.util.ArrayList.<init>(ArrayList.java:178)
at com.haulmont.cuba.core.app.dynamicattributes.DynamicAttributesManager.storeCategoryAttributeValueWithCollectionType(DynamicAttributesManager.java:295)
at com.haulmont.cuba.core.app.dynamicattributes.DynamicAttributesManager.doStoreDynamicAttributes(DynamicAttributesManager.java:272)
at com.haulmont.cuba.core.app.dynamicattributes.DynamicAttributesManager.storeDynamicAttributes(DynamicAttributesManager.java:191)
at com.haulmont.cuba.core.app.RdbmsStore.commit(RdbmsStore.java:416)
at com.haulmont.cuba.core.app.DataManagerBean.commit(DataManagerBean.java:161)
at com.haulmont.cuba.core.app.DataServiceBean.commit(DataServiceBean.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:84)
at com.haulmont.cuba.core.sys.ServiceInterceptor.aroundInvoke(ServiceInterceptor.java:117)
at sun.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy218.commit(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.haulmont.cuba.core.sys.remoting.LocalServiceInvokerImpl.invoke(LocalServiceInvokerImpl.java:94)
at com.haulmont.cuba.web.sys.remoting.LocalServiceProxy$LocalServiceInvocationHandler.invoke(LocalServiceProxy.java:154)
at com.sun.proxy.$Proxy28.commit(Unknown Source)
at com.haulmont.cuba.client.sys.DataManagerClientImpl.commit(DataManagerClientImpl.java:100)
at com.haulmont.cuba.gui.data.impl.GenericDataSupplier.commit(GenericDataSupplier.java:105)
at com.haulmont.cuba.gui.data.impl.DsContextImpl.commit(DsContextImpl.java:166)
at com.haulmont.cuba.gui.components.EditorWindowDelegate.commit(EditorWindowDelegate.java:271)
at com.haulmont.cuba.web.gui.WebWindow$Editor.commitAndClose(WebWindow.java:1773)
at com.haulmont.cuba.gui.components.AbstractEditor.commitAndClose(AbstractEditor.java:111)
at com.haulmont.cuba.gui.components.EditorWindowDelegate.lambda$wrapBy$1(EditorWindowDelegate.java:94)
at com.haulmont.cuba.gui.components.actions.BaseAction.actionPerform(BaseAction.java:228)
at com.haulmont.cuba.web.gui.components.WebButton.performAction(WebButton.java:46)
Thank you for so detailed answer! It seems like a different bug so I’ve created a new GitHub issue.
Regards,
Sergey