Null value when get value from an attribute with out context parameter

1
Hello there! I usually use get fucnction followed by an attribute name which I want to got value such as System.out.println(objCust.getCustomerName()); System.out.println(objOrder.getOrderAmount()); System.out.println(objOrder.getPaymentTerm()); After I have upgraded modeler from 2.5.5.1 to 2.5.6.1 I did not to used this old code My Eclipse show me the return value of attribute is null, I try to change this command whit context parameter like this System.out.println(objCust.getCustomerName(this.getContext())); That it's work But I have for few questions below 1.This is new interface to get value or This is a bug 2.I have a lot of command to get value. Any advice to implement this if i need to do? Please let me know if I do misunderstand Many thank :)
asked
3 answers
0

Propbably you didn't initialize /create the Customer Object with a context. If you initialize / create an object with context, you do not need to pass the context in any subsequent calls.

* Updated *

Ok, I see you use the initialize methods a lot (line 117, 140, 144, 179). You should pass your context as first argument to them. That will avoid the need to pass context during the get/ set calls.

That you did not need the context in 2.5.5.1 is an inconsistency in 2.5.5.1, since it will result in unpredictable behavior as you won't no from which context / rights you are viewing the objects.

answered
0

Hi Michel,

In ordinarily, I used standard method to create/edit. One page contained a datagrid with a button to open a new/edit form This method do use automatically context,don't it?

Thanks a lot :)

answered
0

Of course,I can do for you.They are below

CreateCustomerTextFile_2.5.5.1 as work.java

CreateCustomerTextFile_2.5.6 need to pass context .java

You're very kind. :)

answered