on 11-05-2014 3:51 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.