Dear Ivy Team.

We faced with the autounboxing problem. On UI side we have input field for number:
<pe:inputNumber value=#{data.num}/>
or <p:inputText value=#{data.num}>

On data model, the field 'num' has type Number. When a user saves data, then we get value 0 in this field. Can we store null value?

We read question:
http://answers.axonivy.com/questions/1674/auto-initialisation-number-0-from-jsf-view

We tried set COERCE_TO_ZERO=false in: \AxonIvyDesigner6.5.0.53277\webapps\ivy\WEB-INF\web.xml

<context-param>
<param-name>org.apache.el.parser.COERCE_TO_ZERO</param-name>
<param-value>false</param-value>
</context-param>

in %JAVA_OPTS%: -Dorg.apache.el.parser.COERCE_TO_ZERO=false
in process code, as: System.setProperty("org.apache.el.parser.COERCE_TO_ZERO", Boolean.FALSE.toString());

But it didn't help for us.
Could you correct us, what do we need do any more for Designer and then for Engine?

Where do we need set variable ivy.vm.additional.options?

asked 02.06.2017 at 10:49

Maxim%20S's gravatar image

Maxim S
11224
accept rate: 0%

edited 09.06.2017 at 10:37

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
8.5k21851

The ivy.vm.additional.options is only used on the Engine for Windows. There you can copy the Example.ilc file in the bin directory and rename it to AxonIvyEngine.ilc. In the file your find that property. The ilc file is used by the AxonIvyEngine.exe to start java. See Engine Guide for more information about the ilc file and how to use it.

(02.06.2017 at 11:08) Reto Weiss ♦♦ Reto%20Weiss's gravatar image

Thank you very much! But what do we need to do that disable convert null to 0 for Designer?

(02.06.2017 at 11:16) Maxim S Maxim%20S's gravatar image

Hi

  1. of all you have to set the system property org.apache.el.parser.COERCE_TO_ZERO to false as described by you about. This can be done in the AxonIvyDesigner.ini of the AxonIvyEngine.ilc file on Windows. This turns of that JSF replaces null values through 0.
  2. IvyScript tries to auto initialize most of the values. This means that if a number is null IvyScript will turn it into a 0. Even though you can test if a 0 is set manually or was auto initialized. This can be done with the operator is initialized.

Example:

ivy.log.info("Was initialized manually:"+(in.num is initialized) +" Value "+in.num);

With that you can decide if the field was empty (value is 0 but not initialized) or if the user has entered a 0 (value is 0 and initialized).

Regards

Reto Weiss, ivyTeam Support

link
This answer is marked "community wiki".

answered 09.06.2017 at 08:34

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k182656
accept rate: 74%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×5

Asked: 02.06.2017 at 10:49

Seen: 853 times

Last updated: 09.06.2017 at 10:37