Alpha Video Training
Page 2 of 2 FirstFirst 12
Results 31 to 42 of 42

Thread: Search Grid On A Desktop Form

  1. #31
    Member
    Real Name
    Melvin
    Join Date
    Nov 2011
    Posts
    133

    Default Re: Search Grid On A Desktop Form

    Sorry...Didn't see your update.

    I now understand what I was doing wrong.

    Thank you very much for your continued help!

  2. #32
    Member
    Real Name
    Melvin
    Join Date
    Nov 2011
    Posts
    133

    Default Re: Search Grid On A Desktop Form

    Hi Stan

    Using this same search method, how do I search I by date?

    I have tried by using a variable of
    v_created = " / / "
    with the below coding.

    filt = ""
    if var->v_fnme > ""
    filt = filt + quote(var->v_created) +" $ crtd_date"
    filt = ltrim(filt," .and. ")
    parentform.QueryRun(filt)
    end if
    Not sure what I am doing wrong?

  3. #33
    "Certified" Alphaholic forskare's Avatar
    Real Name
    Ken Nordin
    Join Date
    Apr 2000
    Location
    Walker, MN
    Posts
    7,545

    Default Re: Search Grid On A Desktop Form

    Quote Originally Posted by ADCO Service View Post
    Hi All

    I have created a Search Grid web component and embedded it on a desktop form. This Search Grid is designed to allow the user to search for a specific customer in the database. (Please see pic) I'm looking to create a link between the search grid and the customer desktop form. The idea being that when the user comes across the customer they are looking for, they can simply click either on the row or a link that would then open the related customer form.

    Is this possible? And if so, how do I build it?
    No I don't think it's possible. I've tried this several times and have yet to get it to work. I wish it could because it is very easy to set up and is quite powerful. Aside from doing as Ted suggested, you could show the grid. You can use buttons to go from there.
    TYVM :) kenn

    Knowing what you can achieve will not become reality until you imagine and explore.

  4. #34
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,785

    Default Re: Search Grid On A Desktop Form

    Quote Originally Posted by ADCO Service View Post
    Hi All

    I have created a Search Grid web component and embedded it on a desktop form. This Search Grid is designed to allow the user to search for a specific customer in the database. (Please see pic) I'm looking to create a link between the search grid and the customer desktop form. The idea being that when the user comes across the customer they are looking for, they can simply click either on the row or a link that would then open the related customer form.

    Is this possible? And if so, how do I build it?

    Attachment 32199
    Quote Originally Posted by forskare View Post
    No I don't think it's possible. I've tried this several times and have yet to get it to work. I wish it could because it is very easy to set up and is quite powerful. Aside from doing as Ted suggested, you could show the grid. You can use buttons to go from there.
    Actually this can be done. See video http://www.ajaxvideotutorials.com/V1...TheDesktop.swf which is DT6 on this page http://news.alphasoftware.com/v11pre...opApplications See also the videos in DT5

    I made an example using Melvins previous sample. The form Search_grid contains the embedded grid. Clicking the link(Svc_id) in the grid will open a desktop form filtered to the correct record. See the javascript code in the OnClick event in the grid. This runs the function defined in the code tab on the desktop side with the id passed in.

    Hope this helps.
    Attached Files Attached Files
    Last edited by Tim Kiebert; 11-18-2012 at 04:19 PM. Reason: spelling
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  5. #35
    "Certified" Alphaholic forskare's Avatar
    Real Name
    Ken Nordin
    Join Date
    Apr 2000
    Location
    Walker, MN
    Posts
    7,545

    Default Re: Search Grid On A Desktop Form

    This is one time when I am happy I was wrong. Actually, half wrong. Thank you for looking into this. I really appreciate your efforts as I'm sure, many others will as well. I give you five gold stars

    Update: I added an autosuggest look-up to the Svc_nme field. It works fine except when I click the Search button, it says there are no records in the query. I haven't a clue how that could be but I'll try to figure it out.

    Update2: I added a record the the Svce_nme would be short, "smith". I a lookup is used, either the auto-suggest or the Edit-Combo, it returns an empty query. Remove the lookup and it works fine. It causes me to wonder there it itch is located. Does the lookup conflict with the code in the OnClick event or is there a bug?

    I added a detail section and removed the code in the on click event and the tried the lookup and got the same result, no records in the query. The should rule out the code as a problem but is it a bug? Hmmm, more experimenting to do. Stay tuned.
    Last edited by forskare; 11-18-2012 at 01:01 PM.
    TYVM :) kenn

    Knowing what you can achieve will not become reality until you imagine and explore.

  6. #36
    Member
    Real Name
    Melvin
    Join Date
    Nov 2011
    Posts
    133

    Default Re: Search Grid On A Desktop Form

    I've actually abandoned the idea of embedding a search grid, although Tim your post was really excellent and I'll need to look into it in more detail.

    At the moment my search form is based on Stan's code. I'm just having problems with modifying it to search for a date field.

    See post #32 for my details.

  7. #37
    Member
    Real Name
    Melvin
    Join Date
    Nov 2011
    Posts
    133

    Default Re: Search Grid On A Desktop Form

    Hi Tim

    I've been reviewing the sample app you uploaded.

    Your method for linking the grid to a desktop form is fantastic!!!

    I tried to duplicate your work in my application but sadly nothing happens after clicking the link.

    I've attached a sample of my app. Any idea as to what I'm doing wrong?

    Athena_2.0.zip

    Quote Originally Posted by Tim Kiebert View Post
    Actually this can be done. See video http://www.ajaxvideotutorials.com/V1...TheDesktop.swf which is DT6 on this page http://news.alphasoftware.com/v11pre...opApplications See also the videos in DT5

    I made an example using Melvins previous sample. The form Search_grid contains the embedded grid. Clicking the link(Svc_id) in the grid will open a desktop form filtered to the correct record. See the javascript code in the OnClick event in the grid. This runs the function defined in the code tab on the desktop side with the id passed in.

    Hope this helps.

  8. #38
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,785

    Default Re: Search Grid On A Desktop Form

    You missed one minor detail. The script in the code tab called 'Open_Cust_Form' should be a function with the same name. The string that gets created in the click event in the grid will be in the form of - Open_Cust_Form("1") This is what the A5 function genericXbasicUIFromWorkingPreview(xb) runs when you click the id. As you can see the code is simply a function call with the id passed to it, in contrast to a scriptplay.
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  9. #39
    Member
    Real Name
    Melvin
    Join Date
    Nov 2011
    Posts
    133

    Default Re: Search Grid On A Desktop Form

    Tim...You are a gentleman and scholar.

    Thank you very very much!

  10. #40
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,785

    Default Re: Search Grid On A Desktop Form

    Your welcome.
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  11. #41
    Member
    Real Name
    Melvin
    Join Date
    Nov 2011
    Posts
    133

    Default Re: Search Grid On A Desktop Form

    Hi Tim

    Quick Question...

    I want to use this method to add the "svc_id" field value from my search grid to a desktop form called "form_interaction_service".

    I've added a button to the grid component and tried to run a javascript code to store the "svc_id" as a variable (usesvcrid) and run a function called "Use_Svcr". (See Code Bellow)

    Code:
    var rn={Grid.RowNumber};
    var usesvcrid = {grid.object}.getValue('G','svc_id',rn);
    
    
    var xb = 'Use_Svcr("'+usesvcrid+'")'; 
    
    genericXbasicUIFromWorkingPreview(xb);
    The "Use_Svcr" function is designed to add the usesvcrid variable to a field called "svc_id" on the "form_interaction_service" form.

    Code:
    FUNCTION Open_Svcr_Form AS C (id AS C )
    
    'Set 'Value' property of 'Svcr_id' in Form 'form_interaction_service' .
    DIM window_name as C
    window_name = ":"+"form_interaction_service"
    DIM varP_Object as p
    'Get a pointer to the specified window
    varP_Object = obj(window_name)
    varP_Object:Svcr_id.value = convert_type(usesvcrid,"numeric")
    
    END FUNCTION
    At the moment the button doe nothing when I press it.

    Any suggestions?

  12. #42
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,785

    Default Re: Search Grid On A Desktop Form

    Yes, a couple of suggestions.

    Your code to get the usesvcrid is ok.

    Firstly, the name of the function you have created in the code tab to do the work is not named the same as the function you are calling from the button. (Open_Svcr_Form instead of Use_Svcr)

    Secondly the variable you are passing in to the convertType function should be 'id' (the varname that you are passing in to the Use_Svcr function)


    Although the word 'numeric' seems to work in the convert type function, the documentation says to use a single letter.
    Last edited by Tim Kiebert; 01-31-2013 at 05:24 PM.
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

Similar Threads

  1. opening a desktop form from a grid
    By barry685 in forum Alpha Five Version 11 - Desktop Applications
    Replies: 9
    Last Post: 03-11-2012, 03:33 PM
  2. Opening a desktop form from a grid
    By rafaelecuador in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 11-12-2011, 07:24 PM
  3. Use Grid search form to filter child grid
    By aburningflame in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 10-26-2010, 10:09 AM
  4. Grid / Search Criteria - active by loading form
    By PhillipS in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 09-23-2009, 10:01 PM
  5. Initialize grid search field in tabbed form
    By Brett in forum Web Application Server v7
    Replies: 1
    Last Post: 04-07-2006, 10:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •