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

UX Component - Updating Database Field

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

    UX Component - Updating Database Field

    I am trying to update a database field with some text that a user enters into a text box in a UX Component. On the submit button, in the on click javascript I have the below code

    var rowNum = {Grid.RowNumber};
    {grid.object}.submitGridPartRow(rowNum);

    This code works in a grid component I have but not in UX Component. It throws a error that saids something like Obj.submitGridPartRow is not a function.

    Is there a different way I have to write this in a UX Component or is something else? Maybe it doesnt know which table to update in the UX Component because I have multiple tables in the Data Binding whereas in my Grid Component I just have one table in the Data Binding?

    #2
    Re: UX Component - Updating Database Field

    You're in a UX (a "dialog" object), not a "grid" object. They are 2 vastly different worlds.

    Since your UX is Data Bound, then your Submit button may only require...

    Code:
    {dialog.object}.submit();
    This assumes you've set up the Server-side onDialogInitialize to get your data... and the afterDialogValidate event to save your data.

    Comment


      #3
      Re: UX Component - Updating Database Field

      Ok, I have this code now:

      var rowNum = {Dialog.RowNumber};
      {dialog.object}.submit(rowNum);

      The error is saying now Global Error, User Identifier Field Missing

      Is this saying it doesnt know which table and field to update with the information inputted? If so how would it be fixed?

      Comment


        #4
        Re: UX Component - Updating Database Field

        No... you can't just replace 'grid' with 'dialog'. The concept of a rowNumber in the UX component doesn't really exist... in a data bound component. You're essentially always on row 1. You're trying to fit grid methods into a UX... and it doesn't work that way.

        Do you actually have data binding set?
        Do you have Server-side events onDialogInitialize and afterDialogValidate set up?

        I think there's a lot of non-understanding here... so here's the best process for you to follow...

        From the Web Projects Control Panel, click on Web Components, click New, double-click Web Component, double-click UX, click OK. This will leave you in a new UX Component.

        Click Controls, then click TextBox... this will display the New Control dialog.

        There's a link at the bottom of this dialog... Populate list from a table... click it. Fill in your Connection String, pick a Table, uncheck All fields... and then pick a few Fields... including the key.

        All the other options are automatically checked on for you...

        Including data binding information
        Add 'Load Primary Keys' action
        etc.

        Click ok.

        The UX will be built with all the data binding and server-side events filled in... and all the buttons you'll need.

        Now... have a look at the code in those buttons... and.. the code in the server-side actions. Hopefully that will shed some light on how a UX works.

        Comment


          #5
          Re: UX Component - Updating Database Field

          I looked at that but still unsure how to take text a user inputs into a textbox and update a database field in a certain table. Yeah, still pretty new to the UX and creating mobile apps but trying to learn! I copied the server events from the new UX and put them into my mobile app Server Side events.

          Comment


            #6
            Re: UX Component - Updating Database Field

            Is there a good training video on this I can watch?

            Comment


              #7
              Re: UX Component - Updating Database Field

              https://news.alphasoftware.com/v11pr...v11.htm#Dialog
              take a look
              thanks for reading

              gandhi

              version 11 3381 - 4096
              mysql backend
              http://www.alphawebprogramming.blogspot.com
              [email protected]
              Skype:[email protected]
              1 914 924 5171

              Comment


                #8
                Re: UX Component - Updating Database Field

                Originally posted by swest View Post
                I looked at that but still unsure how to take text a user inputs into a textbox and update a database field in a certain table. Yeah, still pretty new to the UX and creating mobile apps but trying to learn! I copied the server events from the new UX and put them into my mobile app Server Side events.
                Because your UX is Data Bound, each Control... e.g. a TextBox control has data binding. Look at the properties for a TextBox control... at the very end of the properties list is a Data Binding section. You'll see the table and field that TextBox control is bound to. These are established in the Data Binding section of the UX. The process I described previously will do all this for you. Then you can have a look and see how it all fits together.

                If you can get it to run, this video might help, although it's very old and was created for a prior version of Alpha, the basic principles are good. The current version of Alpha has better tools for data binding.

                https://www.ajaxvideotutorials.com/V...stingTable.swf
                Last edited by Davidk; 11-02-2017, 09:34 PM.

                Comment


                  #9
                  Re: UX Component - Updating Database Field

                  Looked at all this but still cant get it to work. So I want a user to upload a video. Then I want a user to write a comment about the video and when they hit submit it will insert a record into a database table with the comment stored in Caption field of that database table. Seems this should be pretty straightforward but cant seem to figure out how to do it.

                  Comment


                    #10
                    Re: UX Component - Updating Database Field

                    Post your UX component.

                    Comment


                      #11
                      Re: UX Component - Updating Database Field

                      Thanks for sending a sample.

                      Your UX may be data bound, but you have no server-side code in place for retrieving or saving data. Therefore your .submit() isn't doing anything.

                      You want to update the data table from a Comment TextBox Control. It looks like you have a List Control getting displaying data including the Caption data (which is your Comment).

                      So, it looks like you want to create a Detail View for your List Control. The Detail View will include a Comment TextBox control... and all updates to the Detail View will run through the List Control.

                      The updates will be handled by the List Control, not by a data bound UX.

                      Overall, you'd select a row from the List... the List Detail View will show data from the List... you update the data... submit the changes to the List Control... and sync those changes back to the table.

                      So, the question is... is the Comment TextBox control you currently have the same Caption data showing in the List Control. If so, then you want to set up a Detail View for the List.

                      Comment


                        #12
                        Re: UX Component - Updating Database Field

                        Steven,

                        Everything you know about Grids must be discarded when you move to UX. It would be well worth the time to go through the basic videos on the UX by doing the following:
                        • Open Alpha Anywhere,
                        • Select your workspace
                        • From the "Help" menu select Video Library
                        • type "submit" into the filter box (no quotes)
                        • Click on the "UX Component (12)" item from the Category listbox.
                        • Starting at the first video (D7) go through all the videos !!! (A few you could skip, like the "Sending email from UX", if you don't need it)


                        Tedious way to learn, I know, but there is no other way.

                        Comment

                        Working...
                        X