Home › Forums › Presentation › Screens › How to create multipicker screen with a non persistant class.
- This topic has 6 replies, 2 voices, and was last updated 8 years ago by ramesh bunga.
-
AuthorPosts
-
-
September 28, 2016 at 3:13 pm #7619ramesh bungaParticipant
Hi .
I am tying to create a multipicker screen with values from a non persistant class. I can see the values in the source form but once i select them and move to target form i am not able to see the values. Basically the caption value vanishes . Any inputs are much appriciated.
Thanks in advance.
0 -
September 29, 2016 at 10:52 am #7641norairnParticipant
Can you post a zip file with screen, form and metaclass metadata files please?
0-
September 29, 2016 at 12:42 pm #7657ramesh bungaParticipant
Hi Norim,
Thank you for the reply. attached are the complete files0Attachments:
You must be logged in to view attached files.
-
-
September 29, 2016 at 1:11 pm #7666norairnParticipant
Can you upload it as a .zip file as opposed to .7z please.
0 -
September 29, 2016 at 2:31 pm #7679ramesh bungaParticipant
-
September 30, 2016 at 12:13 pm #7690norairnParticipant
In order to properly display a caption of the target item in MM picker we need to make sure the source object can be read by OID. Below is what I’ve done approaching a case like this.
- I’ve examined the value property of the “Caption” column in the target grid. It’s bound to the “actSearchContext caption” association path.
- Since the “Caption” column shows a blank value I examined the results received from the model server. I enabled logging by adding the “-Dlog4j.logger.nexj.core.rpc.GenericServer=ALL” line in the Studio preferences in the Window/Preferences/Scheme Console Settings/Common VM Arguments. The log below shows that the server returns the BaseActSearchContext instance with null caption: “caption=()”.
Java123456789101112131415161718192021222324252611:24:55,350 DUMP [GenericServer] (http-7081-exec-4) Request(namespace=http://www.nexjsystems.com/ns/finance, version=..., async=false, commit=false, locale=en, timeZone=America/New_York)invocations(2):...TO<ActTypeReportCommand'create,, @127712960>(actSearchContext=TO<BaseActSearchContext, OID:2:S1:C:S5:SCHED>(),commandClass=REF:TO<EntityReportCommand'create,, @472079202>)filters(4):...; 11:24:55,363 DUMP [GenericServer] (http-7081-exec-4) Response:results(2):TO<EntityReportCommand'create,, @1636433331>(unsavedFilterRuleExpressions={},...actSearchContexts={TO<ActTypeReportCommand'create,, @1725489879>(actSearchContext=TO<BaseActSearchContext, OID:2:S1:C:S5:SCHED>(caption=()),caption=(),commandClass=REF:TO<EntityReportCommand'create,, @1636433331>)})REF:TO<ActTypeReportCommand'create,, @1725489879>events(4):The issue is that the ActSearchContext metaclass has no persistence, but overrides the ‘read event for UI to read a collection of instances. The ‘read event is not suitable for cases when the object is being read indirectly as part of an association. That’s why the server returns a null value for the (BaseActSearchContext’caption) attribute. A more robust way would be to build service persistence for the metaclass and handle read by OID. BaseActSearchContext derives from ActSearchContext.
I’ve addressed the problem of null caption by implementing the (ActSearchContext’caption) as a calculated value and forcing it to invoke the ‘read event.
((read-instance ActSearchContext ‘(caption) `(= (@) ,(this’:oid)) ())’caption)
I’ve attached the zip file with ActSearchContext.meta. You will need to customize it as it’s part of core finance repository.
Refer to the https://community.nexj.com/2016/08/16/getting-control-console-logger/ for comprehensive overview of logging.
1Attachments:
You must be logged in to view attached files.-
September 30, 2016 at 4:23 pm #7707ramesh bungaParticipant
Thank you so much Noraim. This solution worked .
Initially I thought of making it as a persistant object but i just need it to generate query for a report so I felt that may not be solution.
Once again thank you for your help.
Regards
Ramesh.0
-
-
AuthorPosts
- You must be logged in to reply to this topic.