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

Set 'Updatable' property at runtime

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

    Set 'Updatable' property at runtime

    Does anyone know how to toggle the 'updatable' property of a control at runtime?

    #2
    Re: Set 'Updatable' property at runtime

    A control sitting in... a grid? a UX?

    Comment


      #3
      Re: Set 'Updatable' property at runtime

      David

      The control is in a UX.

      Comment


        #4
        Re: Set 'Updatable' property at runtime

        Knowing a bit about what your goal is would help... but... this might get you there.

        I'm not sure if there is a way to affect the e.tmpl object in one of the server side events of the UX.

        So... I created an A5W page for my test UX. In the A5W page there is an "override" section where you can set values for objects.

        In this case I determined that the field I want to affect is the 3rd field in my UX. You can find your field by clicking on the Xbasic tab (at the bottom) of the UX Component you're editing.
        While looking through the Xbasic, for the control you want to affect, you'll see the 'updateable' setting... it will look like...

        Code:
        .v.dataBinding.updateable = .T.
        In the A5W page, the override section looks like this...

        Code:
        'Override settings start -----------------------------------------
        
        tmpl_ux_field_u.page_fields[3].v.dataBinding.updateable = .F.
        
        with tmpl_ux_Field_U
        .alias = "ux_Field_U"
        _dialogFilename = "ux_Field_Updateable_Test"
        
        end with 
        
        
        'Override settings end -----------------------------------------
        I added this code just after the 'Override settings start' comment

        Code:
        tmpl_ux_field_u.page_fields[3].v.dataBinding.updateable = .F.
        Now... when the A5W page executes... the updateable setting for my field overrides what is set in the UX and the field will not update on a Submit.

        You'd most likely want to establish the value for this setting in a session variable. Then you'd access the session variable within the override section.

        Code:
        dim updFld = session.myUpdFld 'where session.myUpdFld would have been set to .T. or .F.
        tmpl_ux_field_u.page_fields[3].v.dataBinding.updateable = updFld

        Comment


          #5
          Re: Set 'Updatable' property at runtime

          David

          Thanks. Let me explain what I'm trying to do. I have UX component with a signature capture control. It's bound to a sql database, field type 'image'. For some reason when I add a new record I get a sql error that the signature is nvarchar and can't be converted to image type. If I toggle off the updatable on the signature field, then the record is added without any problem. The oddball here is that once the record is added I can enable 'updatable' and any changes to the record are saved. This error only happens when adding a new record, not during update. So I thought that by toggling the property to false if the record is new I could get around this.

          Maybe you have a better solution.

          Comment


            #6
            Re: Set 'Updatable' property at runtime

            I think it's a completely different problem.

            I'm going to guess you're working with MS SQL Server. I don't think there's an Image data type in MySQL.

            Change your data type to varbinary(MAX) and give it a try. I haven't tried this yet, but I think this is the trouble. If it still doesn't work, report back and I'll build and test.

            Comment


              #7
              Re: Set 'Updatable' property at runtime

              Dave

              I think I found the problem. It seems that something is screwed up in the xBasic. I set up a small test project with the signature capture and same data type field in sql. I'm able to add records without any problem. So I compared the xBasic in the production app with the test app and I found that a few lines of code are missing from the production app. I tried to change to xBasic code, but it seems to be locked?? I can't insert a new line. The xBasic in the test app can be changed??? I'm confused here...

              Production app:

              DIM tmpl.xbasiccode as P
              DIM tmpl.xbasiccode.blankInitialValueIfVarNotFound as C
              DIM tmpl.xbasiccode.setValueProperties as C = <<%code%


              Test app:


              DIM tmpl.xbasiccode as P
              DIM tmpl.xbasiccode.blankInitialValueIfVarNotFound as C
              DIM tmpl.xbasiccode.setValueProperties as C = <<%code%
              value.NAME=""
              value.SIGNATURECAPTURE1=""%code%
              DIM tmpl.xbasiccode.setValueProperties2 as C = <<%code%
              value.NAME=""
              value.SIGNATURECAPTURE1=""%code%[/COLOR]

              Comment


                #8
                Re: Set 'Updatable' property at runtime

                Managed to edit the xBasic, but same problem. Is there a way to rebuild the xBasic?

                Comment


                  #9
                  Re: Set 'Updatable' property at runtime

                  I solved my problem by using a separate UX for signature capture. The record is already inserted, so the user is only doing an update with the signature. FYI I created a test UX and single table, the signature capture worked fine. I think the sql error occurs when you have tables with a parent/child (one-to-many) relationship.

                  Comment

                  Working...
                  X