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

Passing and Using a Variable from Dialog to Grid

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

    Passing and Using a Variable from Dialog to Grid

    I have a dialog component that is used to filter a table and open a grid in a Modal-Popup with the selected records. There is also a variable that is passed to the Modal-Popup that appears as a part of the HTML This is achieved with the following code upon a button press

    InlineJavascript associated with a button in the dialog component

    window['v_employee'] = {dialog.object}.getValue('Employee');


    On the receiving end, the grid has an

    onGridRender code

    var x_employee ='';
    if(window['v_employee']) x_employee = window['v_employee'];
    else x_employee = 'Value not found';
    $('Emp').innerHTML = x_employee;


    I then place the Employee Name into the HTML for the Grid in Free form Edit Region as

    <div>
    <h2>Employee Training Records</h2></br>
    <div>Employee: <span id="Emp"></div>
    </div>
    </br>

    Here is the Question

    I want to take the info from the Employee and do a global update of all records in the grid.

    I am having problems with this and have spent over 10 hours so far. I am not a programmer but can follow code to a great extent.

    Can someone please show me how to take the v_employee variable from the dialog and use it to update the Modal-Popup grid Employee Field for all records?

    Thank you for reading this and even more thanks if you have an answer. Please respond in terms a non-programer can follow.

    Steve

    #2
    Re: Passing and Using a Variable from Dialog to Grid

    Excellent explanation and question... lots of good info. Just wanted to confirm that you want to update each displayed record in your Grid Employee field. So, if your Grid got filtered and has 100 records to display, you want to update 100 records in the grid with the Employee from the dialog.

    SQL Server? MySQL? DBF?

    If you just had a couple of records I would loop through the grid records and fill in the Employee field.
    You could do this in Javascript or in Xbasic via an Ajax Callback.

    However, I'm wondering if performing a SQL Update from the dialog and then have your "already updated" Grid displayed with the Employee information in place. What do you think? More details when you figure out what might be best.

    Comment


      #3
      Re: Passing and Using a Variable from Dialog to Grid

      My 2 cents - I would consider sticking with javascript here (assuming David and I are understanding you correctly).
      If the popup grid has a single editable field - EmployeeID - then you could set up an action button that, when clicked, would loop through all grid records and .SetValue each EmployeeID field to your global var. To save, you would then click the Save All button, or cancel if you chickened out. All this can be done in less than 10 lines of javascript, I'm sure.
      Andy.

      Comment


        #4
        Re: Passing and Using a Variable from Dialog to Grid

        Thanks for the great responses, I'm using Dbf tables. If I use JavaScript, what is the syntax for the variable I got from the dialog?

        Steve

        Comment


          #5
          Re: Passing and Using a Variable from Dialog to Grid

          Oh, and yes, I want to update the same editable field on all selected records. Usually the total number of records is from 4 to 20. After the update, I will then append all records to a different table.

          Comment


            #6
            Re: Passing and Using a Variable from Dialog to Grid

            Sorry to dig so much, but is there a reason for the grid, beyond updating the Employee field? If you're doing a bunch of other stuff in the Grid, then great. If not, then performing the Employee field update and then append to another table, in code, would be better.

            Comment


              #7
              Re: Passing and Using a Variable from Dialog to Grid

              I freely admit I may be doing this bass ackwards. What I am building is a training program. I have a list of procedures that are associated with different work operations. I want select an operation, associate it with an employee and then append this to the training system. It creates a training plan for the employee.

              My concept was to select the employee and operation from the dialog, it then opens a table in grid mode with add the employee name then append. If you have a more efficient concept, please feel free to advise. I have been working on this way too long.

              Steve

              Comment


                #8
                Re: Passing and Using a Variable from Dialog to Grid

                Hey Steve,

                If you're not doing anything with the Grid, other than filling in the Employee Name, then I wouldn't do the grid. Open the dialog, select the Employee, then append - all from the dialog. Is the Grid needed?

                Comment


                  #9
                  Re: Passing and Using a Variable from Dialog to Grid

                  Steve,

                  It sounds like you should think about this a bit first. Remember that it all starts with a well designed database. Don't rush into it without understanding how your database needs to be designed. You will likely need some many-to-many relationships.

                  In SQL, for example, you would want to define which procedures are performed per operation (shown below in tablename: field1, field2... format):

                  Procedures: ProcID, ProcName, ProcDescription, ...
                  Operations: OperID, OperName, OperDescription ....
                  Oper_LINK_Proc: OperID, ProcID

                  Then, you need to tie in your employees:
                  Employees: EmpID, EmpName, Age, etc
                  Emp_LINK_Oper: EmpID, OperID, GeneralNotes

                  Then, you can set up your queries, grids, dialogs, etc. around this database.

                  Good luck.
                  Andy.

                  Comment


                    #10
                    Re: Passing and Using a Variable from Dialog to Grid

                    Andy and David,

                    Thank you for your responses.

                    Andy,
                    The structure you defined is what I have. I have a table of employees with a lot of data such as email address, phone, supervisor, job function etc. I also have a table of procedures, rev level, etc, I then have a table of operations which list the procedures as you defined. These are DBF tables.

                    David,

                    How do I use the dialog tool to create an output combining the employee name, operation and procedure from which I can append from? I agree this would be more efficient but my poor brain hasn't figured that out.

                    Steve

                    Comment


                      #11
                      Re: Passing and Using a Variable from Dialog to Grid

                      Steve,

                      Post your tables with some sample data in them and I can set up the process you need and show you how it's done. Post the dialog you have, as well.

                      Comment


                        #12
                        Re: Passing and Using a Variable from Dialog to Grid

                        Here are the tables involved and the dialog plus the grid I was opening. TrainingSelect1 is the dialog name

                        attachment removed
                        Attached Files
                        Last edited by SteveK3003; 05-29-2012, 11:06 AM.

                        Comment


                          #13
                          Re: Passing and Using a Variable from Dialog to Grid

                          Steve,

                          Just to recap... select an Employee, select an Operation. Based on the Operation go and get the information in the Procedures table and then write it all out to the Trainingdev table. Is that right?

                          If so, then in your dialog, the Operations dropdown, your choices are from the training_group_procedures table... the field Training_Group. Should this dropdown be Procedure_num and Procedure_name... so that we can then have a key into the Procedures table?

                          Currently, the dropdown for Operations gives two choices... but from either of these selections there's no way to get to the Procedures table.

                          Comment


                            #14
                            Re: Passing and Using a Variable from Dialog to Grid

                            The table "TrainingGroupNames" holds the operations by Name, The Table "Procedures" holds the procedures, The Table "Training_Group_Procedures" Brings them together. I have a grid that allow me to build the associations via drop down selecetions to build the "Training_Group_Procedures" Table. In the end I want to select an employee, select an operation, append employee, and procedure number to the "TrainingDev" table. I can from whatever example you come up with, I can figure out how to add additional things like procedure Name if I want. I really appreciate your help and time.

                            I would love to dig deeper into database design and alpha software. Any suggestions on what materials to study? I have V11 and most if not all the videos, and manuals. Still so much isn't published.

                            Steve

                            Comment


                              #15
                              Re: Passing and Using a Variable from Dialog to Grid

                              This should get you started. Not sure why I was getting an error on your dialog, but no matter... created a new one. Employee dropdown, Operation dropdown. The button fires off an Ajax Callback which grabs information from the dialog, then grabs information from the Procedures table, opens the TrainingDev table and writes it all out. The name of the dialog is TrainingSelect so you may need to rename something on your system. Hope it helps. Beyond all the videos (which are amazing) and manuals the best way to learn this stuff is just to keep asking questions and doing the work. If you run into Javascript problems check out www.w3schools.com.
                              Attached Files
                              Last edited by Davidk; 05-25-2012, 07:47 PM.

                              Comment

                              Working...
                              X