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

how to override grid settings in the canupdate event

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

    how to override grid settings in the canupdate event

    In ver 9 I used the following code in the CanUpdateRecord event to dynamically change the content above the grid. This does not work in ver 12. I can find documentation of changes to the grid settings from within the a5w page but I can not find how to do this in a grid event. The grid name is changesuperagree.
    Code:
    		
    with tmpl_changesuperagree
    	EditRegion.Grid.Top = <<%html%
    	<font size="3" color=#ff0000>The start date must be before the end date.</font>%html%
    end with
    the xbasic tab for the grid includes:
    Code:
    tmpl.EditRegion.Grid.Top = <<%editregion%
    %editregion%
    but I can not figure out how to change it dynamically. Any help would be appreciated.
    Thanks,
    Irwin

    #2
    Re: how to override grid settings in the canupdate event

    I can't seem to find the CanUpdateRecord event in a v12 grid clients side events, the release notes since v9 don't seem to mention it either so I wonder if it ever existed ? Anything you want to change dynamically should be done using javascript, the xbasic is the code for rendering / creating the grid. So put a span & an id tag in the freeform region above your grid next use javascript in any client side event to get a pointer using getElementById to the element & replace the innerHTML.
    Frank

    Tell me and I'll forget; show me and I may remember; involve me and I'll understand

    Comment


      #3
      Re: how to override grid settings in the canupdate event

      Thanks Frank
      The Canupdate record event is real (http://wiki.alphasoftware.com/Using+...anupdaterecord) and I used it in ver 9. It also is supported in v12 but the code I want to use does not work in v12 as it did in v9. In any case I see what you are saying and I will play with it but I was hoping I could use the same method in v12 as I did in v9 and use xbasic in the event itself.
      Irwin

      Comment


        #4
        Re: how to override grid settings in the canupdate event

        Originally posted by irwincohen View Post
        Thanks Frank
        The Canupdate record event is real (http://wiki.alphasoftware.com/Using+...anupdaterecord) and I used it in ver 9. It also is supported in v12 but the code I want to use does not work in v12 as it did in v9. In any case I see what you are saying and I will play with it but I was hoping I could use the same method in v12 as I did in v9 and use xbasic in the event itself.
        Irwin
        canupdaterecord is a grid serverside event. Not sure EditRegion.Grid.Top is accessible. You can verify with the debugger.

        If you want to prevent the update and display an error you typically display the error using Result.ErrorHTML
        Code:
        with PageVariables
        Result.Cancel = .t.
        Result.ErrorHTML = "Something is wrong"
        end with
        You can also look at the various ClientSideEvents canGridSubmit etc
        https://appsbydesign.co.uk/

        Comment


          #5
          Re: how to override grid settings in the canupdate event

          OK , found it : it is only available when working with DBF tables. Editing EditRegion.Grid.Top will have no effect as is is serverside; xbasic generates the grid and once that is done it's over except for ajax callbacks (=javascript calling xbasic functions that return javascript) So you definitely need to use js as I pointed out.
          Frank

          Tell me and I'll forget; show me and I may remember; involve me and I'll understand

          Comment


            #6
            Re: how to override grid settings in the canupdate event

            Disagree with you Frank. This event is not specific to nor limited to DBF tables. I use it quite a bit.

            Irwin - go to the grid properties, and find "Error Style". You would set the error the way you describe in this event, and then find the Error Style that suits you. I think you're looking for the Global display choice.

            Correction - Colin shows the correct way to set the error message here.
            Last edited by Steve Workings; 03-23-2015, 09:04 PM.
            -Steve
            sigpic

            Comment


              #7
              Re: how to override grid settings in the canupdate event

              Steve,

              We are both right but it took me a while to see there's probably a bug. Create a readonly grid with NO detail view, check out server side events & see that canupdaterecord for example is not available which makes perfect sense. Add detail view & make it editable. Save the grid. See how canupdaterecord still isn't available. That's where I got confused because I first created a sql based grid w/o editable dv, next I tried with a dbf based grid with editable dv right from the start. solution is to close & reopen the grid. I will report it. Thx
              Last edited by Clipper87; 03-23-2015, 11:01 PM.
              Frank

              Tell me and I'll forget; show me and I may remember; involve me and I'll understand

              Comment


                #8
                Re: how to override grid settings in the canupdate event

                Thank you all, I was trying to save some work porting my v9 code to v12 regarding the error message. But as Colin and Steve suggest I am going to stick with the standard error message protocol as suggested by Colin. I have to rewrite more code but it will be easier for my successor (or me too) to maintain.
                Thanks for your suggestions,
                Irwin

                Comment


                  #9
                  Re: how to override grid settings in the canupdate event

                  this has been fixed now. it is no longer necessary to exit and reopen the grid builder to see the correct list of server side events after you change the grid from r/o to r/w or vice-versa. thanks. the fix will be in the next update but is available now in the pre-release build.

                  Comment

                  Working...
                  X