Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
4 replies Latest Post - ‏2012-12-11T12:48:18Z by SystemAdmin
SystemAdmin
SystemAdmin
1192 Posts
ACCEPTED ANSWER

Pinned topic Running Macro From Java Custom Widget

‏2012-12-04T09:34:03Z |
Hi all,

i wish to know if is possibile to run a macro ( real generic macro, it search for more/bottom marker on the page ) from java code: i have to read all subfile rows with my widget ( and now i read correctly the pages but manually ) but i need to loop over it till the end ( bottom marker ).

Thanks
Updated on 2012-12-11T12:48:18Z at 2012-12-11T12:48:18Z by SystemAdmin
  • tmparker
    tmparker
    518 Posts
    ACCEPTED ANSWER

    Re: Running Macro From Java Custom Widget

    ‏2012-12-04T18:56:07Z  in response to SystemAdmin
    It sounds like you are asking how to navigate host screen in code. That can be done; however, you would not want to do this in widget code. You should never try to manipulate the host screen from a widget since there is a lot of other code that depends on the host screen being in the place we expect it to be. I would suggest you try to get all the data prior to rendering the page. You can do this through a looping macro and extracting the data you want to a GV or you could use business logic to navigate. I wrote a simple example a while back in this post at the very bottom, https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14871074&#14871074.

    Hope this helps.
    Tim
    • SystemAdmin
      SystemAdmin
      1192 Posts
      ACCEPTED ANSWER

      Re: Running Macro From Java Custom Widget

      ‏2012-12-05T15:19:07Z  in response to tmparker
      Hi Tim,

      thanks for your (very) useful reply. I read the linked post and i get some suggestions. The only thing i can't understand is why the same thing is not possible to do in the component part of the subfile ? I'm tryin to get this working and i can't get my code to work ( when i get the hashtable i get always null pointer exception but with debug i see the session is valued ). Unfortunately i can't do this with a business logic because my target is to build a custom ( general, to use in default rendering ) component/widget for all subfiles: unfortunately i can't use screen customization and i have a "style" problem with my customer.

      Is there another way ?
      • tmparker
        tmparker
        518 Posts
        ACCEPTED ANSWER

        Re: Running Macro From Java Custom Widget

        ‏2012-12-05T15:52:05Z  in response to SystemAdmin
        If I am understanding you correctly, you are asking to do the combining of the screen data in the component itself, and again you won't be able to since you can't change the host screen that you are currently using because that would mess up HATS completely. The only way you can change the host screen to combine the data is in an action before the transformation itself. Once the transformation begins it is now tied directly to the host screen currently being shown. You would need to use the screen combination feature in HATS or do the combining of the data prior to the transformation and make your custom component use the data you combined instead of what is on the host screen currently.

        Thanks
        Tim
        • SystemAdmin
          SystemAdmin
          1192 Posts
          ACCEPTED ANSWER

          Re: Running Macro From Java Custom Widget

          ‏2012-12-11T12:48:18Z  in response to tmparker
          Hi Tim,

          i got it. Following your link i get working the data extraction on subfile ( on a trasformation/customization ). I'm trying to get this working on all subfiles without customization/trasformation now.
          If you know can i define an event for all pages to manage operations before trasfomation (Business logic, etc....) ?