Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Calling a grid from a grid

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Peter.Greulich
    replied
    Re: Calling a grid from a grid

    It may be a timing issue, but something doesn't seem right here.

    Put an alert(vGrid); in after the first line where it gets the field value. If the field value shows then something weird is going on. You can put a 2nd alert at the end of the script as a follow up.

    Leave a comment:


  • Peter.Greulich
    replied
    Re: Calling a grid from a grid

    D is for detail part, G for grid part. Make sure you use the right one.

    Some how it is a timing issue. The grid call fires before the field value is retrieved, hence the one step behind. Worse comes to worse, you will have to use an Ajax callback to call an xbasic function after you retrieve the field value. JS is fast, xbasic "slow".

    Leave a comment:


  • JimFtex
    replied
    Re: Calling a grid from a grid

    Thanks Peter,
    I made the corrections and that gets me closer....but it seems to run a cycle behind;

    first time in - I press the button and nothing
    next click - Aciphex form is displayed.
    move to Acyclovir and click - the Aciphex form displays
    click agian - the acyclovir form displays
    move to alesse and click - acyclovir form displays
    click again - alesse form displays


    I have this in the onClick event, but it seems to be getting the form name from last viewed, if that makes sense.
    I tried changing from 'D' to 'G' in vGrid = {grid.Object}._getValue('D','NOTE_TO_BUYER'); but that didn't work
    either.

    Am I missing a response or a function that should happen first?

    thanks for the help,
    Jim

    Leave a comment:


  • Peter.Greulich
    replied
    Re: Calling a grid from a grid

    I see the problem. Your case statement is using my example ...

    case 'Grid1':


    case 'Grid2':


    case 'Grid3':


    'Grid1' etc needs to be the name of the corresponding grid that the next line opens up. If a field "grid" value is Aciphex, then the statement should read

    case 'Aciphex':

    etc etc.

    Also make sure you close with a } not a { as you show in your document.

    Yeah, no need to use a filter.

    Leave a comment:


  • JimFtex
    replied
    Re: Calling a grid from a grid

    Peter, maybe the last Doc did it.

    Multi-Grid Display

    Leave a comment:


  • JimFtex
    replied
    Re: Calling a grid from a grid

    Multi-Grid Display.doc

    Leave a comment:


  • JimFtex
    replied
    Re: Calling a grid from a grid

    Multi-Grid.docMulti-Grid.doc

    Peter, I'll try to insert the document again. Not sure what I'm doing wrong.

    Leave a comment:


  • Peter.Greulich
    replied
    Re: Calling a grid from a grid

    The doc you attached only contains my post.

    Leave a comment:


  • JimFtex
    replied
    Re: Calling a grid from a grid

    Peter, I tried setting up 3 grids with the information. I've attached a Word doc to show my process. I hope it makes sense or
    I've done something wrong....let me know. I'm not sure if the document attached, if not email me at: [email protected]


    thanks for the help,
    Jim
    Attached Files

    Leave a comment:


  • JimFtex
    replied
    Re: Calling a grid from a grid

    OK, Peter....Thanks. I'll give this a try and let you know how it turns out.
    Jim

    Leave a comment:


  • Peter.Greulich
    replied
    Re: Calling a grid from a grid

    Jim,

    I must have been having a stupid attack. Instead of messing around with that intricate JS that A5 generates, do this:

    On your hyperlink or button put in Action JS in the OnClick event. For each grid, create one action. So if you have 25 potential grids to open, you'll have 25 Action JS "Open Grid" rows. Then insert before the first row and between each and every grid row an InLine Action JS. The first Inline will have this:

    //get a field value
    vGrid = {grid.Object}._getValue('D','SOME_FIELD');

    //JavaScript case function
    switch (vGrid)
    {
    case 'Grid1':


    Then you will have the first Action JS to open "Grid1"

    Then the next Inline is:

    break;
    case 'Grid2':

    And the next first Action JS to open "Grid2"

    Then the next Inline is:

    break;
    case 'Grid2':


    and so on...

    The last inline at the very end after the last Gird is:

    }


    If you were to convert the whole thing to text or "view JS", you get something like this:

    Code:
    //get a field value
    vGrid = {grid.Object}._getValue('D','SOME_FIELD');
    
    switch (vGrid)
    {
    case 'Grid1':
     {grid.componentName}_G__UNBOUND_HYPERLINK_1_1({grid.rownumber},'{grid.rowId}',this);
      break;
    case 'Grid2':
       {grid.componentName}_G__UNBOUND_HYPERLINK_1_2({grid.rownumber},'{grid.rowId}',this);
      break;
    case 'Grid3':
     {grid.componentName}_G__UNBOUND_HYPERLINK_1_3({grid.rownumber},'{grid.rowId}',this);
      break;
    case 'Grid4':
      {grid.componentName}_G__UNBOUND_HYPERLINK_1_4({grid.rownumber},'{grid.rowId}',this);
      break;
    default:
      {grid.componentName}_G__UNBOUND_HYPERLINK_1_4({grid.rownumber},'{grid.rowId}',this);
      //or whatever...
    }
    The reason not to convert the whole thing to text is so if you need to change a grid opening setting.

    This method works well and this technique can be used for other things such as selecting a report, etc.

    Leave a comment:


  • JimFtex
    replied
    Re: Calling a grid from a grid

    Originally posted by kkfin View Post
    If I understand right you want to open from grid1 another grid2. The selection value comes from a field value in grid1.

    If so you can use lookup with linked grid (video #8). You have to create 5 (5 forms) extra grids holding actual grid name and use this extra grid as a primary lookup grid with grid1 (and then select the right one). With this technique you don't have to write any code.


    Thanks Ken, that's kinda where I'm at now. I created a new grid with 25 buttons on it. Each calls the correct grid but that is a work-around until I get this figured out. Not sure which video #8, but I've tried linking the grid also.

    Thanks guys, I'll keep poking around and trying different things to get this worked out.
    Jim

    Leave a comment:


  • Peter.Greulich
    replied
    Re: Calling a grid from a grid

    {Grid.ComponentName}=":WhatGrid"

    That's not going to work. You're mixing xbasic with JS. You need to get the field value using

    {grid.Object}.getValue(part,name,[row - omit for Search and Detail View part])

    and probably evaluate it using JS.

    Leave a comment:


  • JimFtex
    replied
    Re: Calling a grid from a grid

    Thanks Peter. I tried to modify the code, but all I can do is close the window after modifying the code.
    I'm not sure where to put the new code. I did put 2 lines in Override Settings {Grid.ComponentName}=":WhatGrid"
    All I get is the original grid with the ID filled in from the :WhatGrid argument.

    Still working at it.

    Leave a comment:


  • kkfin
    replied
    Re: Calling a grid from a grid

    If I understand right you want to open from grid1 another grid2. The selection value comes from a field value in grid1.

    If so you can use lookup with linked grid (video #8). You have to create 5 (5 forms) extra grids holding actual grid name and use this extra grid as a primary lookup grid with grid1 (and then select the right one). With this technique you don't have to write any code.

    Leave a comment:

Working...
X