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

Guidance for newbie (try #2)

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

    Guidance for newbie (try #2)

    (forum messed up other post - re-posting)

    Hi
    This week I need to make a component to view/edit my customer info... the grand daddy Customer Info screen (CustInfo). Using UX. A complex, comprehensive, Customer at-a-glance status screen showing all sorts of stuff about a specific customer.

    Once I have the CustInfo screen done, I would like to make that a stand-alone component that can be called from other places in Alpha (ie. a list of open invoices, each of which is for a customer, should allow me to get to the CustInfo screen, albeit not in Edit mode for each user, or a to-do list for today. Basically, any place a piece of data references a customer MIGHT be a place where I'd want to jump to the CustInfo screen.)

    One simple starting place would be a UX List of customers (that does searching, filtering, etc) and then be able to select a customer to then view using CustInfo.

    1) Is this the correct strategy to approach this, with a seperate, compartmentalized routine for CustInfo? Sure, it could be in 1 UX comp with the list and edit together, but in the example above, I want to come to the CustInfo screen from many places in the system, not just from a List.

    2) Is there a written example of this somewhere in the docs, on how I go about passing parms, etc. Is this what a filter is for? Do I stuff the selected CustID into a session variable? etc etc

    3) is this so ridiculously simple, that someone could just describe how to do it?

    thx
    jim

    web only, no desktop needed
    bld 5864.5310 (23 may)
    MS SQL
    Last edited by jimww; 06-02-2019, 06:22 PM.

    #2
    Re: Guidance for newbie (try #2)

    What Build of Alpha are you using? Help, About. E.g. the lastest official build of Alpha is 5864. This is important because features and bugs are introduced in versions... and bugs are fixed in subsequent versions. Are you using MySQL, SQL Server, other???

    If you're using a List with a Detail View (for editing), then the List and Detail View cannot be separated... they are tied together. Generally you select a row in the List to edit in the Detail View. You can use a List by itself, but not a Detail View by itself. You can get complex and not see the List in order to edit a row, but the List will be there... feeding the Detail View data. Edit data is sent back to the List and then synchronized with the database.

    If you're creating an Edit only UX, then you must get that record key somewhere. In this case the UX would be considered a Data Bound UX, or an UNBOUND UX... where you populate Controls (Text Box, dropdown, etc) with data from a source. Once edited, you "submit" your data to the server and the database gets updated. In this case you'd open your UX with Action Javascript e.g. "Populate Controls in a UX Component with data from Tables" or "Populate controls in an UNBOUND UX component with data from tables. It depends on your needs.

    You could also use the Action Javascript "Open a UX component to Edit Current Record in List Control..." I believe the UX in this case would be UNBOUND since the edits are being sent back to the List.

    If you absolutely want a List UX and a standalone Edit UX, then I believe your Edit UX would have to be opened with "Populate Controls in a UX Component with data from Tables". Your Edit UX will be a Data Bound UX capable of editing and saving data. Your List UX would supply the record key.

    You'll need to explain this a bit more...
    Once I have the CustMaint screen done, I would like to make that a stand-alone component that can be called from other places in the system.
    Does "in the system" mean a system of Alpha components?

    but i'm wondering what if I want to access the edit without seeing the list first.
    How would you get the key to the table record in order to edit it?

    Since there are a couple of ways to go about all this, there's a few ways things link together. You'll need to decide what your functionality will be, and that will help dictate the process.

    Overall, it's a fairly easy process, but that's if you know Alpha reasonable well. Alpha is a bit scattered, and until you know the bit and pieces and where they are, it's a little tough to get around.

    As you narrow your focus and decide how you want things to work, specific answers about how to get it done are easier to provide.

    Keep asking questions.

    Comment


      #3
      Re: Guidance for newbie (try #2)

      thx david, answer below

      What Build of Alpha are you using? Help, About. E.g. the lastest official build of Alpha is 5864. This is important because features and bugs are introduced in versions... and bugs are fixed in subsequent versions. Are you using MySQL, SQL Server, other???
      latest as of may 23 2019. edited OP


      If you're using a List with a Detail View (for editing), then the List and Detail View cannot be separated... they are tied together. Generally you select a row in the List to edit in the Detail View. You can use a List by itself, but not a Detail View by itself. You can get complex and not see the List in order to edit a row, but the List will be there... feeding the Detail View data. Edit data is sent back to the List and then synchronized with the database.
      right, thats why I'm planning ahead not to be tied to the list

      If you're creating an Edit only UX, then you must get that record key somewhere. In this case the UX would be considered a Data Bound UX, or an UNBOUND UX... where you populate Controls (Text Box, dropdown, etc) with data from a source. Once edited, you "submit" your data to the server and the database gets updated. In this case you'd open your UX with Action Javascript e.g. "Populate Controls in a UX Component with data from Tables" or "Populate controls in an UNBOUND UX component with data from tables. It depends on your needs.
      well sure, any place I'm showing data for a customer, I'll have the CustID (tickler, Open Invoices, etc.)
      Data bound, or unbound - well, what ever is easiest, prolly.
      I'll pass in a CustID to CustInfo and it needs to read data to build its view.

      You could also use the Action Javascript "Open a UX component to Edit Current Record in List Control..." I believe the UX in this case would be UNBOUND since the edits are being sent back to the List.
      don't think I want this - as I'm not always coming from a list. And I don't necc. need data sent back to the list. The list should refresh with updated data from the db.

      If you absolutely want a List UX and a standalone Edit UX, then I believe your Edit UX would have to be opened with "Populate Controls in a UX Component with data from Tables". Your Edit UX will be a Data Bound UX capable of editing and saving data. Your List UX would supply the record key.
      YES, this sounds correct.
      I say LIST, but it might be coming from another form.
      I might be on a Invoice Detail screen and need to view communication history or contact phone#s for this Customer, so I'd click a button to bring up the CustInfo screen to find what I needed, then return to Invoice Detail.
      Point is, this stand alone component gets a record key passed in (how?) and displays CustInfo.

      thx
      jim

      Comment


        #4
        Re: Guidance for newbie (try #2)

        this video V11 Creating a Button to Make a Callback to the Server and Populate the Dialog with Data
        is V11, so outdated I would guess.
        Yet the options don't appear much diff. in the current version.

        Q: If I select "Read from Dialog Controls", well I don't have the CustID in a local control like in the video?
        So I could follow this path, but I'll need more assistance on how I'm passing in the CustID value.

        using the "when data us NOT BOUND" doesn't make sense because I'm clearly presenting a bunch of data on the screen thats coming from various SQL tables. So I may not understand the full ramifications of data bound vs. unbound.
        Last edited by jimww; 06-02-2019, 08:09 PM.

        Comment


          #5
          Re: Guidance for newbie (try #2)

          Jim,

          A lot of things from V11 are still quite relevant.
          I'll admit that I'm not to the point of using lists yet (some old habits die hard),
          but I am getting better at making callbacks to the server and getting the desired
          data.

          I tend to not worry about the version unless A. you say something used to work but suddenly stopped working, or B. You are following a video and
          a method used in the video does not work as expected (the .getChildObject method was introduced after V11).

          Don't be afraid to try something. If it doesn't work, post the code. It gives us a better idea of what you're trying to accomplish.

          There are some thoughts of things that "can't" be done, yet with enough out of the box thinking, you can accomplish most anything.
          Gregg
          https://paiza.io is a great site to test and share sql code

          Comment


            #6
            Re: Guidance for newbie (try #2)

            Jim,
            You wrote:
            Q: If I select "Read from Dialog Controls", well I don't have the CustID in a local control like in the video?
            So I could follow this path, but I'll need more assistance on how I'm passing in the CustID value.
            You can set your list to return the Customer ID:
            listReturnValue.png
            Then use the Action Javascript to open a UX based on this value. Create an argument in the opening UX, and in OnDialogInitialize, use this value as the value to populate the UX.

            Hope that helps.
            Jay
            Jay Talbott
            Lexington, KY

            Comment


              #7
              Re: Guidance for newbie (try #2)

              Originally posted by Jay Talbott View Post
              You can set your list to return the Customer ID:
              Jay
              thx jay
              the list doesn't need to return anything.
              its a possible starting point.
              it needs to CALL the CustInfo component PASSING [somehow] the CustID.
              Maybe a session variable? Is this the way to do it, via OnClick?
              ... set a session var and then the ServerSide/OnDialogInitialize picks up that var.
              thats the direction i'm heading

              Comment


                #8
                Re: Guidance for newbie (try #2)

                You are technically correct, but if you make the list return the CustID, you won't need a session variable. Where are you going to get the value for the session variable from anyway? Just get the list to return the CustID, and pass that into the argument on the CALLED form (as you say above >> "stand-alone component that can be called from other places in Alpha").

                You can open the CALLED form with a button, a double click on the list, or possibly other methods.

                Jay
                Jay Talbott
                Lexington, KY

                Comment


                  #9
                  Re: Guidance for newbie (try #2)

                  I really need to start dealing with lists, but it's not difficult to get a customerID, whether
                  it's by end-user memory, or perhaps a customer telling the representative their customerID.
                  With that done, it is feasible to use state.Info variables to pass the customerID to another
                  UX or grid. You can then use events to do whatever you need to do with value.
                  Gregg
                  https://paiza.io is a great site to test and share sql code

                  Comment


                    #10
                    Re: Guidance for newbie (try #2)

                    >> if you make the list return the CustID, you won't need a session variable.
                    I guess its my unfamiliarity with Alpha... when you say "return", to me that implies the list is closing/ending.
                    I figure my CustInfo component might display in a new tab, or in a popup, so when its done and closed, the list (or whatever) refreshes and is still there.

                    >> Where are you going to get the value for the session variable from anyway?
                    onClick() I would assign the session var from a list variable (CustID), then call CustInfo

                    >> Just get the list to return the CustID, and pass that into the argument on the CALLED form (as you say above >> "stand-alone component that can be called from other places in Alpha"). You can open the CALLED form with a button, a double click on the list, or possibly other methods.
                    this is what I was trying to ask in the OP.
                    I don't know the mechanism to "pass that into the argument". Thats one thing I'm trying to learn.

                    From this video
                    at 03:00
                    he says "read the value from a variable. that could be a session variable or a local variable"

                    Since I don't have a local var, which is what he does in Part 2, I was to use session.

                    Comment


                      #11
                      Re: Guidance for newbie (try #2)

                      >> if you make the list return the CustID, you won't need a session variable.
                      I guess its my unfamiliarity with Alpha... when you say "return", to me that implies the list is closing/ending.
                      I figure my CustInfo component might display in a new tab, or in a popup, so when its done and closed, the list (or whatever) refreshes and is still there
                      See image in post #6. Whatever line in a list has focus (is selected), the value in the return field gets assigned to the list.

                      >> Where are you going to get the value for the session variable from anyway?
                      onClick() I would assign the session var from a list variable (CustID), then call CustInfo
                      Maybe we are talking about the same thing above, but how would you assign the list variable?

                      I don't know the mechanism to "pass that into the argument". Thats one thing I'm trying to learn.
                      If you create an argument in the CALLED form, when you go through the Action Javascript to open that UX, one of the options is Argument Binding.

                      Jay
                      Jay Talbott
                      Lexington, KY

                      Comment


                        #12
                        Re: Guidance for newbie (try #2)

                        Here's what I think you'll need.

                        A Data Bound UX:
                        With a new, empty, UX created, you can add a TextBox Control which will open the New Control dialog. Use the "Populate list from a table" link in this dialog to get all the fields you want from your SQL Table, view... etc. You can change the controls from Textbox to whatever else you need after the controls are created.

                        In the Properties of this UX, go to Arguments. Insert New Argument, named nicely... e.g. argCustId, and leave it at the default of "Set value at Run-time". Leave the value empty.

                        In your List UX, in the Data Source tab, make sure "Return value type" is set to Primary Key.
                        On whatever List Event you want, e.g. DblClick, click on Action Javascript, and create a new Action and use "Open a UX component to Edit Current Record in a List Control...".
                        Filling in the dialog for this action is very straight forward. You'll may want to un-check "Use cached UX Component" since other areas may be editing records."
                        That's it for the List. By default, this action will Close the UX and refresh your List.

                        In any other, non-List, UX, to call the Edit UX, add a Button and a Textbox Control. This Textbox Control will hold the record Key. On the button add the Action "Open a UX component". Select your UX name, un-check "Use cached UX Component", and in Argument bindings you'll see the Argument you added to your Edit UX. Double-click on this argument and select the Textbox control you added.
                        Whatever value (existing Record Id) you put into the Textbox control, will be used for the Edit UX... via the Argument setting.

                        Now you have 3 UX components. An Edit UX, a List UX which opens the Edit UX, and a 3rd UX to open the Edit UX.

                        Comment


                          #13
                          Re: Guidance for newbie (try #2)

                          (posted simultaneously with David's reply above - will review - thx)

                          here's what I got so far...

                          made a CustInfo dialog. It is NOT executing any code in OnDialogInitialize (ie. doesn't go read PrimaryKeys)

                          from a List, List Properties, on DblClick():
                          {dialog.object}.runAction('show_CustInfo');

                          The JS Action is:
                          Open a UX component to Edit Current Record in a List Control in a UX Component...

                          I point to my List control and point to the destination CustInfo_UX
                          I have to set no vars, session or state, or any parms - I guess its handling that internally.
                          And up comes the CustInfo dialog box.

                          (weird, that in Working preview, the window doesn't show a close box, but in Live it does)

                          I would need to add an explicit Close button to the dialog.
                          And prevent EDIT/Submit in some cases.
                          And I'll need to see EXACTLY how its knowing to fetch the record, because I won't always be calling this from a List... so I need to see whats being passed in so I can do it from other places.

                          Comment


                            #14
                            Re: Guidance for newbie (try #2)

                            Originally posted by Davidk View Post
                            Now you have 3 UX components:
                            An Edit UX, (part 1)
                            a List UX which opens the Edit UX, (part 2)
                            a 3rd UX to open the Edit UX. (part 3)
                            david,
                            thanks, this was the direction I was going.

                            parts 1 & 2 are ok.
                            when I got to part 3, I could never get CustInfo to show data, unless I hardcoded in a primarykey. Passing in the argument from a data field didn't work. I looked at it further and got it to work...

                            I had to specify "pop ux comp with data from a table" in the section following "Target UX Definition"
                            and pointed to the same field I was using for the Argument.
                            This worked 1st time.

                            But I have a problem with this, because it seems that each time I want to call CustInfo, I need to specify Target Window parameters - type of window, name of window, size of window, etc etc. I do this from lots of places in the system, and its extra maintenance to find all those spots that will call my key component when I need to make one of these UI changes. My main component should be able to set its Window name & size, for example.


                            The whole "Argument" thing is wonky to me.
                            1) I defined Part 1 Argument as you said and told it to specify at runtime, then how did Part 1 work when I wasn't sending an argument from the List in Part 2? In fact, after I did Part 3 (another list, of invoices, with a link to display the CustInfo for the invoice) I still wasn't using the Argument. I removed it and it still works.

                            If you write a function to expect arguments, and other code can still call it without an argument, then something's weird.
                            But at some point, I'm going to find myself not on a list that has that neat interface and I will need to call it with a parm so I need to figure out why it didn't work.

                            Comment


                              #15
                              Re: Guidance for newbie (try #2)

                              1) I defined Part 1 Argument as you said and told it to specify at runtime, then how did Part 1 work when I wasn't sending an argument from the List in Part 2? In fact, after I did Part 3 (another list, of invoices, with a link to display the CustInfo for the invoice) I still wasn't using the Argument. I removed it and it still works.
                              Ok... your Edit UX has an Argument set up. Good.

                              You don't need to pass an Argument from the List UX... the Action is doing all that for you. That's why you could remove the Argument from the Edit UX and still have the List UX work.

                              In my Part 3 UX I only have a Button and a Textbox.
                              The Button is running the Action "Open UX Component"
                              In Argument Bindings I can see the Argument from the Edit UX. I set the Argument Value to my TextBox control.

                              So... when you run that Action, Alpha looks for the Argument Value in the Textbox. It passes that Argument Value into the Edit UX... and into the Argument you set up in the Edit UX.

                              But... I'm sorry... I forgot a part. How does your Edit UX know to use the Argument coming from the Part 3 UX. You must set a filter. In your Edit UX, Server-Side Events, onDialogInitialize, you'll see an ExecuteServerSideAction. Click anywhere on this line... then click Action Scripting and choose Edit Action. In the Filter property, choose your Record Id, add an equal sign, and then click Insert Argument and pick your Argument. At the end it'll look something like this.

                              Code:
                              CUSTOMER_ID = :ARGCUSTID
                              Now you can use the List UX, your Part 3 UX, and both will use the Edit UX to edit and update data.

                              Comment

                              Working...
                              X