Home Forums Presentation Screens How to create multipicker screen with a non persistant class.

Viewing 4 reply threads
  • Author
    Posts
    • #7619
      ramesh bungaramesh bunga
      Participant

      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
    • #7641
      norairnnorairn
      Participant

      Can you post a zip file with screen, form and metaclass metadata files please?

      0
      • #7657
        ramesh bungaramesh bunga
        Participant

        Hi Norim,
        Thank you for the reply. attached are the complete files

        0
        Attachments:
        You must be logged in to view attached files.
    • #7666
      norairnnorairn
      Participant

      Can you upload it as a .zip file as opposed to .7z please.

      0
    • #7679
      ramesh bungaramesh bunga
      Participant

      Please find .zip files

      0
      Attachments:
      You must be logged in to view attached files.
    • #7690
      norairnnorairn
      Participant

      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=()”.

      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.

      1
      Attachments:
      You must be logged in to view attached files.
      • #7707
        ramesh bungaramesh bunga
        Participant

        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
Viewing 4 reply threads
  • You must be logged in to reply to this topic.