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

Using Dialog to set default values in grid not bound to dialog

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

    Using Dialog to set default values in grid not bound to dialog

    The newbie non-programmer has another question - again I researched and couldn't find an answer.

    I have a dialog (called DEFAULTS) with 3 fields: Beg Date, End Date, and Store. The User sets these first, then clicks a button that Opens a grid (called PRODUCTS) that displays the full PRODUCT list. From this grid they select one or more products via checkboxes and then click a button that adds to and opens the SPECIALS grid (also unrelated). On the SPECIALS grid there are fields for Beg Date, End Date, Store, Brand, Product, Size, Sale Price, etc. When the user adds the additional information and clicks Submit, this grid closes and is not displayed again until the user adds more items from PRODUCTS to SPECIALS.

    I would like the Beg Date, End Date, and Store values displayed in the DEFAULTS Dialog to become the default values for each record that is added to the SPECIALS grid. I think I should be able to set the value of the Initial Value property for each of these fields in the SPECIALS grid to the values in the fields from the DEFAULTS dialog but I don't know how to accomplish this.

    Any help would be appreciated.

    #2
    Re: Using Dialog to set default values in grid not bound to dialog

    First, consider the option of including the PRODUCTS table as an embedded grid in the dialog - it will function in a more streamlined way.
    To get & set values from a parent component, you just the standard javascript procedures we all know and love:
    var po = {grid.object}.getParentObject();
    if(po) {
    var myfield = po.getValue(...);
    {grid.object}.setValue(....);
    }

    Comment


      #3
      Re: Using Dialog to set default values in grid not bound to dialog

      Thanks Andy. I knew it must be easy. So if I embed the grid in the dialog, regardless of whether the data is related, then the Dialog is considered the parent even though the data is not related?

      Eureka!! This makes everything I want to do much easier!!

      Comment


        #4
        Re: Using Dialog to set default values in grid not bound to dialog

        Andy, can you get this to work for embedded grid objects? I replied to a thread about this on 12/20. I have had to resort to storing the parent object in the global namespace. I don't remember if I tested getParentObject() in both Working Preview and Live Preview though. I'm pretty sure I did.

        http://msgboard.alphasoftware.com/al...ed+grid+parent

        Thanks

        Comment


          #5
          Re: Using Dialog to set default values in grid not bound to dialog

          When a grid is embedded in a dialog, the dialog is the parent component of the grid.
          There was a bug (reported to be now fixed by Alpha in recent pre-releases) where the getParentObject method did not work.
          It should work now. I haven't tested because my workaround works great and I haven't gotten back to check :)

          Comment


            #6
            Re: Using Dialog to set default values in grid not bound to dialog

            I had assumed the dialog object would become the parent object to the embedded grid, so I had originally tried using getParentObject because it's so convenient. I did not realize this was reported as a bug and was fixed. This is good to know.

            Thanks

            Comment


              #7
              Re: Using Dialog to set default values in grid not bound to dialog

              Andy,
              I thought I understood this but when I read the additional posts and tried to implement it, I realized I need more clarification.

              First - I think I may have a Parent - Child - Grandchild situation.
              There is a button on the Dialog that opens the PRODUCT grid (which is now embedded in the dialog) where items are selected and then a button on PRODUCT grid is clicked to add the selected records to the SPECIALS grid that opens in a modal window. That's where I need the values on the Dialog to become the values in the BegDate, EndDate, and Store fields - on the SPECIALS grid. So, if I am using the getParentObject, won't that still be the PRODUCTS grid because that object is what is actually opening the Specials grid? if so, how would I "go back" to the Dialog to get the object from which to get the values? Note - if there is a way to do this and still bring up the SPECIALS grid in a modal window that is preferred because I want the user to be required to complete the remaining fields in SPECIALS grid and submit it before allowing any new Product selections or changing any values in the Dialog (setting defaults).

              Second, the {grid.Object}.setValue method appears to require a line number as a parameter but I am adding multiple records to the SPECIALS table at once and they ALL need to receive the default values from the Dialog.

              And finally, I am unsure exactly where to put the javascript you provided. I have tried it in a number of client side events (such as onGridRender, onGridRender) in the Specials grid and they all seem to return the following error:

              Line: 5021
              Error: 'undefined' is null or not an object

              Your guidance is appreciated.

              Comment


                #8
                Re: Using Dialog to set default values in grid not bound to dialog

                First, note that in Alpha there are many different ways to approach your requirement.

                You could set session vars for the dates and use these as default values in the new records.

                Or use global js vars. Or pass arguments down the line.

                Or use some javascript from SPECIALS to get the parent's parent, something like:

                Code:
                var po = {grid.object}.getParentObject();  //the parent (PRODUCTS grid)
                if(po) {
                  var po_rowNum = po._selectedRow;
                  var my_po_field = po.getValue('MYPARENTFIELD', po_rowNum);
                
                  var gpo = po.getParentObject();  // the grandparent (dialog)
                  var mygpofield = gpo.getValue('MYDATEFIELD');  //not need for row num in dialog
                  {grid.object}.setValue('MYFIELD', childrownum);  //child row var passed in or defined in situ depending
                }
                This stuff is really for developers who are comfortable working with js, and it is a learning curve that we all spend lots of time climbing (gradually).

                But first, go here, and then check some other videos for ideas:
                http://news.alphasoftware.com/v11preview/videos_v11.htm

                Look at M48 especially.

                Hopefully others can chip in and guide you further (my problem is that I don't always have the time, and I am almost never near a development platform when I respond, so I'm mostly just "winging it" from past experiences.

                Comment


                  #9
                  Re: Using Dialog to set default values in grid not bound to dialog

                  Thanks. I've been watching many, many videos and learning as I go but sometimes its hard to know which video might reveal the nugget you're looking for so it is very time consuming. I would love for A5 to improve their indexing and search of these things as well as their documentation wiki. I've actually found the answer to some questions in videos that seemed to have nothing to do with the answer I was seeking. These forums are also VERY helpful in pointing one in the right direction. I will watch the video you recommend.

                  And, yes, I am considering hiring an Alpha 5 developer to assist with the difficult stuff but after this piece that I'm currently working on, the rest is merely queries and reports so I'd like to take it as far as I can by myself first. Seemed the best learning route to start with the difficult piece first.

                  I'm an IT business analyst by day - so I am fairly technical but not a programmer myself and although I have access to web developers, SQL, and javascript programmers at work, so far they kind of look down their noses at Alpha 5 and since this is an entrepreneurial endeavor of mine outside work, I don't really want to expose too much there.

                  So, any help from anyone reading this forum would be greatly appreciated and if anyone would like to become my "mentor" of sorts, it could be very lucrative in the future... or not. I am using Alpha 5 (because its fast and cheap) as a proof of concept of sorts.

                  thanks!!

                  Comment


                    #10
                    Re: Using Dialog to set default values in grid not bound to dialog

                    Cool. Good luck with it. Luckily, Alpha is way more that a proof of concept - it is an excellent business platform that is by far the most flexible out there - serious functionality can literally be added overnight. But there is still a learning curve. I actually believe that if you are an experienced web developer (using PHP or ASP or whatever in the backend), you will have a significant headstart because you already know the client-server process, javascript, CSS, etc. which make up the client-side framework that Alpha Web is based on. Without these skills, it is going to be really hard to do the cool stuff - you will need to stick with vanilla.

                    Comment


                      #11
                      Re: Using Dialog to set default values in grid not bound to dialog

                      Andy,
                      Thanks for the pointer to the video. I actually had already watched this and had the SQL INSERT working for the checked rows and then it occurred to me that I can get the Values from the dialog and pass them at the same time I'm adding the rows. BIG FAT DUHHHH!! <grin>

                      And, BTW, I do understand the power and potential of Alpha 5 but it certainly not a "golden bullet" as it appears to have some possible limitations when is comes to scaling. So far, where that is concerned, there doesn't seem to be anyone providing a definitive answer or live examples on large numbers of concurrent users via a consumer-facing website so that is an unknown. My hope is that it will work for my purposes no matter the size but I am certain it will at least take me far enough to know if my idea will be as profitable as I believe. To be able to test that quickly without spending a lot of money is one of the ADVANTAGES of Alpha 5 even if it can't meet my needs long term.

                      I choose not to be discouraged just because I am not a "developer" - the more I learn the better prepared I will be when/if I end up hiring one.

                      Thanks again for the help.

                      Comment


                        #12
                        Re: Using Dialog to set default values in grid not bound to dialog

                        Good points. Definitely don't be discouraged. Just be patient and you will learn more than enough skills to build excellent projects.
                        The ease of building business web apps is why most of are using Alpha Five in the first place. It certainly is why I am.

                        Comment

                        Working...
                        X