cancel
Showing results for 
Search instead for 
Did you mean: 

Backoffice Label Expression Bean Not accessible

Former Member
0 Kudos

Hey guys,

Trying to use a custom bean using @beanId in y: label, label expression in myext-backoffice-config.xml for a certain type Gave the spring definition in myext-backoffice-spring , But it seems that the bean is not accessible since label comes as empty. No errors in console.

Is there anything missing here ??

Any idea how can I use a custom bean in label expression?

Any help is much appreciated

myExtension-backoffice-config.xml

         <y:base>
             <y:labels>
                 <y:label>code+' - '+@labelService.getObjectLabel(user) + ' - '+  @myDateTimeLabelProvider.getLabel(date) +' -
                     '+totalPrice+' '+currency.isocode+' - '+status</y:label>
             </y:labels>
         </y:base>
     </context>


myExtension-backoffice-spring.xml

Former Member
0 Kudos

spring entry in myExtension-backoffice-spring.xml

 <bean id="myDateTimeLabelProvider"
         class="com.org.myExtension.backoffice.provider.MyDateTimeLabelProvider">
 </bean>
 


DOnt see any error in console. Nothing comes up in the label after my changes.

Accepted Solutions (1)

Accepted Solutions (1)

former_member625836
Active Contributor
0 Kudos

Hi,

Expression you provide is resolved by some Backoffice mechanism that in the end uses SpEL. Nevertheless the environment in which the SpEL is resolved is sandboxed for security reasons. In you custom implementation, you may extend it and add some beans that should be accessible there. You can either use local.properties to define platformbackoffice.available.bean.names.for.spel parameter as a ,-separated list of bean names (be aware that you may override some other values in this way!). You can also use list-extender to add your own bean name to availableBeanNames list property of fixedBeanResolver bean.

Cheers, Jacek

Former Member
0 Kudos

Thank You : )

Good to know. I did use a workaround to achieve this one though. Prepared label in a bean instead of using a label Expression.

Answers (0)