Topic
  • 7 replies
  • Latest Post - ‏2013-02-25T15:23:58Z by george.baker
SystemAdmin
SystemAdmin
1192 Posts

Pinned topic How to set update option in a macro

‏2013-02-20T09:07:38Z |
Hi,
how to set update option in a macro
i have a macro with combination of 25 screens all of these screens have only display option and there is not update option i want to update in these screens..
for example i want to update a loannumber.
please send me the code snippet ..
Thanks
Sabir
Updated on 2013-02-25T15:23:58Z at 2013-02-25T15:23:58Z by george.baker
  • george.baker
    george.baker
    335 Posts

    Re: How to set update option in a macro

    ‏2013-02-21T17:23:41Z  
    Read the InfoCenter.

    If the host application does not allow you to update the field, then you cannot do it with HATS. HATS can only do what the host screen will allow.
  • SystemAdmin
    SystemAdmin
    1192 Posts

    Re: How to set update option in a macro

    ‏2013-02-22T13:57:50Z  
    Read the InfoCenter.

    If the host application does not allow you to update the field, then you cannot do it with HATS. HATS can only do what the host screen will allow.
    Thanks george for ur reply..

    we already have individual hats screen updation to its corresponding particular individual host screen.

    But, now we want to do the updation in web browser page screen, which displays the combination of multiple host screens.

    Like, HostScreenPage1 and HostScreenPage2 will be combined to display in one single web browser screen,
    we need your help on the way of creating macro to edit the values in web browser screen and update its values inside 2 host screens.

    Thanks
    -Sabir
  • george.baker
    george.baker
    335 Posts

    Re: How to set update option in a macro

    ‏2013-02-22T14:34:47Z  
    I do not understand your environment and question. Here is what I do understand:

    1. You collect information from a series of host screens (25).
    2. These screens only display the data, there is not an option to change/update the data from those screens where you collected the data.
    3. The Web page you display to the user displays data from all of the host screens and allows them to modify the data

    I do not understand your last post. Specifically:
    "we already have individual hats screen updation to its corresponding particular individual host screen."
    Does this mean that when you transform an individual screen that allows update you have that working? That is simple to do.

    "But, now we want to do the updation in web browser page screen, which displays the combination of multiple host screens.

    Like, HostScreenPage1 and HostScreenPage2 will be combined to display in one single web browser screen,
    we need your help on the way of creating macro to edit the values in web browser screen and update its values inside 2 host screens."
    This sounds like you are collecting data from HostScreenPage1 and HostScreenPage2, but in order to update the values you must navigate to HostScreenPage5 and HostScreenPage6 in order to update the values. If this is the case then you must write another macro to perform the work. You would place the values to be updated into global variables, then when the user submits the updates from the Web page you need to run a macro that will navigate to HostScreenPage5, insert the value(s) for that page, then navigate to HostScreenPage6 and insert the value(s) for that page.

    If I have misunderstood the requirement, then you must restate it in more specific terms.
  • SystemAdmin
    SystemAdmin
    1192 Posts

    Re: How to set update option in a macro

    ‏2013-02-22T16:00:19Z  
    I do not understand your environment and question. Here is what I do understand:

    1. You collect information from a series of host screens (25).
    2. These screens only display the data, there is not an option to change/update the data from those screens where you collected the data.
    3. The Web page you display to the user displays data from all of the host screens and allows them to modify the data

    I do not understand your last post. Specifically:
    "we already have individual hats screen updation to its corresponding particular individual host screen."
    Does this mean that when you transform an individual screen that allows update you have that working? That is simple to do.

    "But, now we want to do the updation in web browser page screen, which displays the combination of multiple host screens.

    Like, HostScreenPage1 and HostScreenPage2 will be combined to display in one single web browser screen,
    we need your help on the way of creating macro to edit the values in web browser screen and update its values inside 2 host screens."
    This sounds like you are collecting data from HostScreenPage1 and HostScreenPage2, but in order to update the values you must navigate to HostScreenPage5 and HostScreenPage6 in order to update the values. If this is the case then you must write another macro to perform the work. You would place the values to be updated into global variables, then when the user submits the updates from the Web page you need to run a macro that will navigate to HostScreenPage5, insert the value(s) for that page, then navigate to HostScreenPage6 and insert the value(s) for that page.

    If I have misunderstood the requirement, then you must restate it in more specific terms.
    thanks george for your response..

    Sorry for the confusion actually your understanding is correct..
    i am writing a macro in that i am collecting data thru globalvariables and writing these globalvariables in a jsp page to dispaly that data.
    now my requirement is to make these data editable...
    i don't know how write another macro to perform the work with in a macro.
    can u please suggest me some steps to place the values to be updated into global variables
    Thanks
    Sabir
  • george.baker
    george.baker
    335 Posts

    Re: How to set update option in a macro

    ‏2013-02-22T16:35:29Z  
    You should place the global variables on your Web page by doing an Insert Global Variable and select the option of Input field. This places the GV on the page in an <input> field for the user to edit. You can modify the <input> statement to do any type of validation you want.

    When the use wants to submit the changes they should execute a macro rather than using the enter key. That macro should navigate to the page that you want to update and Prompt for the value and obtain the input from the GV by selecting Set prompt to global variable option in the Prompt action. It is up to you to design the macro to do the navigation.

    Look at some of the tutorial found in the Education section of the Hot Spot for examples.
  • SystemAdmin
    SystemAdmin
    1192 Posts

    Re: How to set update option in a macro

    ‏2013-02-25T09:35:44Z  
    You should place the global variables on your Web page by doing an Insert Global Variable and select the option of Input field. This places the GV on the page in an <input> field for the user to edit. You can modify the <input> statement to do any type of validation you want.

    When the use wants to submit the changes they should execute a macro rather than using the enter key. That macro should navigate to the page that you want to update and Prompt for the value and obtain the input from the GV by selecting Set prompt to global variable option in the Prompt action. It is up to you to design the macro to do the navigation.

    Look at some of the tutorial found in the Education section of the Hot Spot for examples.
    thanks george for your reply..

    As i am the beginner in HATS...
    i created another macro by place the global variables on Web page by using an Insert Global Variable,but i can't able to edit these Global Variable's
    for the user to edit.how can i modify the <input> statement to do any type of validation.
    please send me the some code snippet regarding macro edit in a screen ...
    sothat i can check it as a reference..
  • george.baker
    george.baker
    335 Posts

    Re: How to set update option in a macro

    ‏2013-02-25T15:23:58Z  
    Let me repeat my previous post, but this time I will be more specific.

    You should place the global variables on your Web page by doing an Insert Global Variable and select the option of Input field. This is not the default option. Select the option that says Prompt for global variable with input box. This places the GV on the page in an <input> field for the user to edit.
    
    <input name=
    "hatsgv_GlobalV" size=
    "20" type=
    "text" value=
    "<%= CommonFunctions.htmlEscape( ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getGlobalVariable(\u0022GlobalV\u0022, true).getString(0) ) %>">
    

    Notice you now have an HTML <input> statement and the name is hatsgv_GlobalV The value is dynamically obtained from the screen.

    The key is that the input field should be extracted into a global variable prior to applying the transformation. This can be done on the screen event just prior to the apply transformation action.

    There are to many ways to validate the input. The most common is to execute some JavaScript code when trying to exit the field (onblur()). You should also beware that if try to use onblur() that it will not execute for that field if you press enter before exiting the field. You must research HTML programming to see how to code all of this. The next thing is that the value in the changed global variable must be placed back onto the screen before it is processed. This is also simple. Simply insert the global variable back onto the screen after the transformation action.

    You now have (1) validated the input prior to it being submitted back to the host, and (2) the value is now in a global variable that you can use in a macro.

    When the use wants to submit the changes they should execute a macro rather than using the enter key. That macro should navigate to the page that you want to update and Prompt for the value and obtain the input from the GV by selecting Set prompt to global variable option in the Prompt action. It is up to you to design the macro to do the navigation.

    Look at some of the tutorial found in the Education section of the Hot Spot for examples.

    This answer is intended to not simply give you the answer, but to direct you to what techniques you should use, but leaving you to research the HTML techniques that you need to use. Once you do your own research to discover the specifics it will stay with you much longer than simply being given a working example.