cancel
Showing results for 
Search instead for 
Did you mean: 

java.lang.Boolean.FALSE issue in hMC

Former Member
0 Kudos

I've the Product item definition with attributes of type java.lang.Boolean defined with the java.lang.Boolean.FALSE for few and java.lang.Boolean.TRUE for few. Only the default values TRUE are set to "Yes" where as for FALSE the value chosen is "n/a" instead of "No". Can someone help me to resolve the issue in hMC to pick the default value FALSE. Due to this I'm facing issue with workflow functionality which checks for the value as, say, product.getIsApproved(). Please refer to the attached screen print for clarity.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Bala

You can assign the default value of the attribute in the items.xml

<attribute autocreate="true" qualifier="myAttribute" type="java.lang.Boolean">
               <persistence type="property"/>
               <defaultvalue>java.lang.Boolean.FALSE</defaultvalue>
               <modifiers read="true" write="true" ........... />
            </attribute>

This should be followed by a system update

christoph_meyer
Active Participant
0 Kudos

When using java.lang.Boolean as type, hMC should only display "n/a" in case the attribute is null, which I suppose is the case here. Do check the values that are shown as n/a, if they are not in fact null. They must have been modified via API or product manager in your case.

Also note, hMC cannot handle type boolean (as opposed to java.lang.Boolean) too well, it was introduced much later and some chips then cannot treat null vs. false correctly.

Former Member
0 Kudos

Hi,

try to edit the booleanEditorChip.jsp, this jsp is responsible for populating the radio buttons, you can force display if you want, add this code after line 11 or 12:

final Boolean myValueToTestOn= (Boolean)request.getAttribute("myValueToTestOn");
 if(myValueToTestOn.TRUE.booleanValue()){
   checked=true;
   not_checked=false;
 }else{
   checked=false;
   not_checked=true;
 }
Hope this help, please let me know.