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 do I make dropdown field read only?

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

    how do I make dropdown field read only?

    Hi all,

    I have a read-only grid that has a dropdown field in it. However, user can click on this field, browse the list of values and select a different value. Of course, he is not able to save a new value, but he can get an impression that he did a change. If there is a way to specify in the grid field properties something to make this field readonly (gray), so user was not able even to see the drop down contents and pick a different value?

    Thank you for any help,
    Olga

    #2
    Re: how do I make dropdown field read only?

    Change the fileld type to Label.
    Steve Wood
    See my profile on IADN

    Comment


      #3
      Re: how do I make dropdown field read only?

      Hi Steve,

      Thank you for your suggestion, but the reason why I'm using dropdown is to show a value from a different table using a key that is stored in the table grid is based on. So if I change it to Label a code instead of the value will be displayed...

      Actually I can make it custom control, but in this case SQL will be generated as many times, as many rows are in the grid. So I'm trying to make it work a little bit faster and use of readonly dropdown seems to me a good choice... But I don't know if it is possible...

      I don't know if that is important, but I'm using SQL Server as a backend DB.

      Thank you,
      Olga

      Comment


        #4
        Re: how do I make dropdown field read only?

        Well, I think "read-only dropdownbox" would be an oxymoron, not possible. Add to that, your HTML has to re-create the entire list of related records for each row in order to show the values in the dropdown. So that itself takes some time to generate. (Look at the source of your page, each option on the dropdown will be repeated for each row.).

        I think you want a Calculated Field using a lookup() or lookupc() function to get your exact value, and display that as a Label.
        Steve Wood
        See my profile on IADN

        Comment


          #5
          Re: how do I make dropdown field read only?

          Originally posted by moiola View Post
          Hi Steve,

          Thank you for your suggestion, but the reason why I'm using dropdown is to show a value from a different table using a key that is stored in the table grid is based on. So if I change it to Label a code instead of the value will be displayed...
          I use sql_lookup or lookup functions for this purpose OR just a view, that's what views are for after all.

          Comment


            #6
            Re: how do I make dropdown field read only?

            Well, I was thinking something that will give me approximately the same result as this html:

            Code:
            <select name="test" disabled>
            	<option value="1">Value 1
            	<option selected value="2">Value 2
            	<option value="3">Value 3
            </select>
            but I just don't know how to make a configuration in the grid to have the same result. I understand that html will be recreated as many times as may rows I have, but it will connect to DB only once, isn't it?

            I've never been dealing with lookup() function, it seems that it only works with dbf tables, and I have MS SQL Server at the backend...

            Thank you,
            Olga

            Comment


              #7
              Re: how do I make dropdown field read only?

              Originally posted by moiola View Post
              I've never been dealing with lookup() function, it seems that it only works with dbf tables, and I have MS SQL Server at the backend...
              Andrea's comment is spot on.

              You should be using a view from MS SQL.

              Or you can build your own view in WAS.

              You don't need a dropdown field. Just display the value from the view that is already translated from the code to the value that you want to display.

              The concept is similar to a one to one set in A5.

              You do need the display values in a table so they can be linked properly in the view.
              Al Buchholz
              Bookwood Systems, LTD
              Weekly QReportBuilder Webinars Thursday 1 pm CST

              Occam's Razor - KISS
              Normalize till it hurts - De-normalize till it works.
              Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
              When we triage a problem it is much easier to read sample systems than to read a mind.
              "Make it as simple as possible, but not simpler."
              Albert Einstein

              http://www.iadn.com/images/media/iadn_member.png

              Comment


                #8
                Re: how do I make dropdown field read only?

                Thank you very much, it seems to be a right approach, but I still have one concern: this grid has a detail view which is updatable. In case I base my grid on a view instead of a table, will I still be able to update it?

                Thank you,
                Olga

                Comment


                  #9
                  Re: how do I make dropdown field read only?

                  Originally posted by moiola View Post
                  Thank you very much, it seems to be a right approach, but I still have one concern: this grid has a detail view which is updatable. In case I base my grid on a view instead of a table, will I still be able to update it?

                  Thank you,
                  Olga
                  It depends on the database, some allow you to set up updatable views and others don't. To be safe, your best bet is to use SQL_Lookup() in a grid, as otherwise as far as I can tell the dropdown gets loaded for each row which can slow things down a lot too.

                  Comment


                    #10
                    Re: how do I make dropdown field read only?

                    Andrea, thank you for your help,

                    I'm now using the SQL_Lookup() function. To use that, I had to set a type of my field to "Custom". And here I bumped into a problem that object data.field_name that is supposed to return a field_name value for the current grid row always returns me the value for the last row.

                    Is that possible to use this function in another place? I.e. in freeform layout? I tried to use that there, but got errors...

                    Thanks,
                    Olga

                    Comment


                      #11
                      Re: how do I make dropdown field read only?

                      Originally posted by moiola View Post
                      To use that, I had to set a type of my field to "Custom". And here I bumped into a problem that object data.field_name that is supposed to return a field_name value for the current grid row always returns me the value for the last row.
                      Odd... I have tried this before in a grid, and if I first define the variable, then assign it the data value from the field I want, it seems to work. I do seem to recall having problems addressing data.field_name directly though, e.g. without first populating a variable with this.

                      So my code is something like:

                      Code:
                      Dim something as c
                      Dim value as c
                      value = alltrim(Data.FIELD_TO_CONVERT)
                       
                      something = sql_lookup( "::name::DBNAME","TABLE","FIELD='" + value + "'", "FIELD_YOU_WANT")
                       
                      'Write Xbasic code here that returns the HTML to be displayed by this control
                      FIELD_NAME_render = something

                      Comment


                        #12
                        Re: how do I make dropdown field read only?

                        Thank you, Andrea! That worked for me!
                        Why it didn't work before, because I put <%a5 %> code inside %html% %html% tags...

                        Thanks again,
                        Olga

                        Comment


                          #13
                          Re: how do I make dropdown field read only?

                          Originally posted by moiola View Post
                          Thank you, Andrea! That worked for me!
                          Why it didn't work before, because I put <%a5 %> code inside %html% %html% tags...

                          Thanks again,
                          Olga
                          Aaah... hehe yes that's happened to me before too...

                          Comment

                          Working...
                          X