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

Cannot delete a record from UX Component

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

    Cannot delete a record from UX Component

    I am not having any luck using the 'Delete Record' button found in the 'Defined Controls' section of the UX builder. Has anyone?

    Delete Record.jpg

    I've had success using the suggestions made by Chris Tappan (Thanks Chris!) but I'd like to use the defined button.

    What is the point of that being there if it does not work???

    #2
    Re: Cannot delete a record from UX Component

    Works perfectly for me. Did you follow the directions in the error message? I have to say... I really appreciate not only getting error message from Alpha, but quite often the solution to the error is given... that's rare for development software.

    Is your UX Component Data Bound? Then... in the Server Side onDialogInitialize Event, did you add an Action to Load the Primary Keys? Here's what mine looks like...

    Code:
    ExecuteServerSideAction("Get Primary Keys for Parent Table::Load_Primary_keys_for_Parent_Table")
    It's one of choices in Action Scripting. Once that's done, the data aware defined controls all work.

    Comment


      #3
      Re: Cannot delete a record from UX Component

      David,

      I have that setup but it does not seem to make any difference. My UX is data bound as well...

      onDialogInitialize.jpg

      The second image shows my data binding, the primary key is idafe(N).

      I don't understand why it is not working.

      Databinding.jpg

      Jose

      Comment


        #4
        Re: Cannot delete a record from UX Component

        Have you made any changes to the data binding since setting up the Action to Load the Primary Keys? Just to make sure, get back into the onDialogInitialize Event, edit your Action, and then just click ok to get out of the Action. That will force Alpha to refresh stuff. I'm working with Build 1435. What are you calling the UX from? And how?

        Comment


          #5
          Re: Cannot delete a record from UX Component

          Still no luck. I'm on 1416 4127.

          I am calling the UX from a read only grid that shows a listing of entries. I placed a button in the grid that has an onClick event to use the 'Open a UX component to Edit Current Record in Grid, or add a New Record'.

          The Record mode is set to 'EditExistingRecord'.

          David, you mentioned that it works for you? Can you tell me how you are using it? Maybe that will shed some light.

          Thanks!

          Comment


            #6
            Re: Cannot delete a record from UX Component

            The first thing I would do is update your version of Alpha. It's all beta so I don't hesitate in putting in the latest... there's no production stuff to worry about. In the mean time I'll duplicate what you have. The UX I tested the delete button with is a stand alone component... so there's a difference there.

            Comment


              #7
              Re: Cannot delete a record from UX Component

              I thought I was using the latest.. I'll check on that.

              Thanks!

              Comment


                #8
                Re: Cannot delete a record from UX Component

                I'm updated to 1439-4129 but that didn't fix it.

                Comment


                  #9
                  Re: Cannot delete a record from UX Component

                  What you're doing is Editing a Grid Record with a UX Component, but I believe the Delete ability of that records rests with the Grid. You can Edit the record, but you can't add new records or delete existing records.
                  Because you're working with a Read Only Grid, you can't choose "Open UX as an alternative Editing view..." you won't get a record to edit.

                  I think what you'll need to do is use the Open UX Component Action. This allows a Read-only Grid, and gives you full control over the UX. However, you get all records in the UX... not just the current Grid record. There's an option in this Action which asks if you want to Populate the UX with current row data, but this gives you the same problem... you can edit, but not do anything else.

                  What you'll need to do is use the Open UX Component Action, and filter the UX to show current Grid record. Then you can do whatever you like with the UX record. When you exit the UX you'll need to refresh the Grid.

                  The other Actions do all the updating and refreshing for you... but they're only for editing... which is not deleting.

                  A bit later I'll post the UX filter to current grid record stuff.

                  Comment


                    #10
                    Re: Cannot delete a record from UX Component

                    David,

                    Thanks for your help!

                    I am now able to open the UX with a button and delete the record. It works!

                    I noticed that if I edit the record and submit or delete the record the change is committed to the database but the UX stays open. How do I get the UX to close after submit? When I used the 'Open a UX component to Edit Current Record in Grid, or add a New Record' action the UX automatically closes, but that does not happen anymore.

                    Jose

                    Comment


                      #11
                      Re: Cannot delete a record from UX Component

                      Have a look in the UX Server-side event, afterDialogValidate. There are some comments and code in there to close the pop-up window that is hosting the UX component.

                      What was your solution to the delete problem?

                      Comment


                        #12
                        Re: Cannot delete a record from UX Component

                        David,

                        Here is what I did to get the delete working on my UX.

                        1. I added a button to my grid and set the onClick Event to Open a UX Component.

                        2. I added to my UX Server-side onDialogInitialize event the 'Load Primary keys for Parent Table' action and then set the filter to equal the primary key with the use of arguments.

                        2.jpg3.jpg


                        That got it working!

                        I looked at the UX server-side event, afterDialogValidate but that is another language to me. What do I do with e.javascript? I tried following the instructions in the notes but it does not work. Any suggestions?

                        This seems like something so basic, why did Alpha leave this out???

                        Comment


                          #13
                          Re: Cannot delete a record from UX Component

                          I forgot to mention that I know it works becuase while I have to manually close the UX, when I refresh my grid I can see the updates/deletes. So now I just have to figure out how to close the stinking UX!

                          Comment


                            #14
                            Re: Cannot delete a record from UX Component

                            In your Grid, on the button onClick event where you run the Open a UX Component action... this dialog as a property for Window Title. Put this in for the Window Title.

                            Code:
                            Edit Grid Data<span id="mywindowid"></span>
                            The Window Title can be anything you want... and the span id can be anything you want. But, we're going to use the span id the UX.

                            One more change to a property here... "Refresh Grid on Window Close"... set this to All Rows or Current Row... which ever is best for you. Then, when your UX closes, your Grid refreshes.

                            In your UX, Server-side, afterDialogValidate... after your Action script to save data, put this...

                            Code:
                            e.javascript = e.javascript + crlf() + "var ele = $('mywindowid');" + crlf() + "{dialog.object}.closeContainerWindow(ele);"
                            mywindowid is the span id you set in the grid... make sure they are the same id.

                            The e object in a Server side event has buckets of data... all yours for the using. There's lots of videos about the e object... it's one great object.

                            When you assign Javascript commands to e.javascript, the Javascript runs when the event completes.

                            In this case, afterDialogValidate sets e.javascript with some stuff of it's own. Then, we add more Javascript... two more lines... one to set the variable ele to an Id (our Span Id) and the second to close the window we just identified in ele.

                            So... the afterDialogValidate runs... it saves the data, then runs all the javascript commands.

                            Comment


                              #15
                              Re: Cannot delete a record from UX Component

                              David,

                              Thank you! It works perfectly now!

                              I got as far before with the code you mentioned but I was having trouble with the quotes. The instructions (see below) don't use the quotes.

                              '-------------------Closing the Window in Which the Dialog is Hosted -------------------------
                              'In many cases the Dialog will have been opened in a pop-up Ajax window and you will want code in this event handler to close the pop-up window.
                              'Here is how you can do this:
                              'a) In the action that opens the Dialog in a window, set the Window title to something like this: MyWindowTtitle<span id="mywindowid"></span>
                              'b) In this event handler set e.javascript to:
                              ' var ele = $('mywindowid');
                              ' {dialog.object}.closeContainerWindow(ele);

                              'NOTE: If you have used Server-side Action Scripting in this event to save the submitted data to a table, then you might want to reference
                              'the rtc.flagRecordWasSaved variable (which is set by the Action Script) to decide if the window should be closed or not. In addition, since the
                              'Server-side Action will have already set the value of the e.javascript variable, you will want to append your code to e.javascript, as follows:
                              'e.javascript = e.javascript + crlf() + var ele = $('mywindowid'); + crlf() + {dialog.object}.closeContainerWindow(ele);
                              Folks like you really are what make this forum so valuable! Thanks for taking the time to assist.

                              Jose

                              Comment

                              Working...
                              X