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

Coloring a field on a condition in a browser

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

    Coloring a field on a condition in a browser

    i have several fields in a table. One field is name the other field name is deletedDate. So if the deletedDate field is true I want the name field to change color. I have tried in the Display format but I can not use other fields as far as I can see. This is what I have

    if(DeletedDate<>" ",<value>,??)

    Maybe someone can help me. IU am doing this in the Display format of the Field properties of the Name field
    Last edited by Atta; 01-02-2009, 06:47 PM. Reason: Wrong word

    #2
    Re: Coloring a field on a condition in a browser

    Roelof,
    Although you have posted this in a Web forum, it sure sounds like a desktop question....??

    If this is a desktop question then maybe you should be setting a default for the logical field DeletedDate and then test for either a true or false value instead of blank.
    Last edited by MikeC; 01-02-2009, 09:47 PM.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________



    Comment


      #3
      Re: Coloring a field on a condition in a browser

      No, I am working on a web page, therefore I think it needs to be in this forum. I know how to do it in Alpha5, but cannot get it to work in the web page.

      Thanks

      Comment


        #4
        Re: Coloring a field on a condition in a browser

        Are you attempting to accomplish this in a grid or dialog?

        I know there are ways to do this in desktop but have tried without much success on the web side. As a consolation, in my grid, I created a calculated field such as New2 = If(nDate-date()>cDate"","New!","") then when the record met my new requirements, the word "New" was displayed in the color blue.
        Eric

        Alpha Five Websites
        longlivepuppies.com
        socialservicenetwork.com
        -------------------------------------------------
        socialservicenetwork.org

        Comment


          #5
          Re: Coloring a field on a condition in a browser

          My mistake then I guess...still seems strange to me to test a logical field to see if it equals a space " ", considering that on the desktop, this as a condition would always be false...hope to learn a bit then if this is actually a way to test for a logical value with a web application.

          ...but then again, maybe this is why I try to limit my answers to the desktop side!! :)
          Mike
          __________________________________________
          It is only when we forget all our learning that we begin to know.
          It's not what you look at that matters, it's what you see.
          Henry David Thoreau
          __________________________________________



          Comment


            #6
            Re: Coloring a field on a condition in a browser

            I just need to know if a computer has been deleted in the database. What happens is that people delete the computer but in the SQL database we do not delete it we mark the date and we make the field TRUE.
            So I need to find out that IF the computer has been deleted I want the name of the computer in the grid to come up a different color.

            Hope this makes more sense, sorry for the confusion.

            Comment


              #7
              Re: Coloring a field on a condition in a browser

              You do this using a CUSTOM field in a grid or dialog. Look for a Control Type named Custom. This is difficult area to master, but there is a very good example using color in the Alpha help document.
              Steve Wood
              See my profile on IADN

              Comment


                #8
                Re: Coloring a field on a condition in a browser

                Field in my grid is Poortstatus01.

                At this field: select <Control type> custom. then at <Custom Control Properties>, <Definition>:

                something like this:

                on error goto Poortstatus01_xbasicError 'do not delete this line
                'Write Xbasic code here that returns the HTML to be displayed by this control
                If data.poortstatus01 = 1 then
                'RED
                Poortstatus01_render = <<%html%
                <div style="color: #ffffff; text-align: center; background-color:#ff0000;font-weight:bold;">%html% + data.Poortstatus01 + "</div>"
                else
                If data.Poortstatus01 = 2 then
                'Green
                Poortstatus01_render = <<%html%
                <div style="color: #000000; text-align: center; background-color:#00ff00;font-weight:bold;">%html% + data.Poortstatus01 + "</div>"
                else
                'Yellow
                Poortstatus01_render = <<%html%
                <div style="color: #000000; text-align: center; background-color:#ffff00;font-weight:bold;">%html% + data.Poortstatus01 + "</div>"
                end if
                end if

                Got something like above from an earlier post in this forum.

                regards, Ron

                Comment


                  #9
                  Re: Coloring a field on a condition in a browser

                  Greetings:

                  I have had to design a couple web calendars in the past few months that require this type of highlighting.

                  In addition to purchasing Dr. Waynes book (A wise purchase, just for this project alone!), I had help from Steve Woods calendar examples, and got further ideas from Dr Traub's enhancements. Dynamic Drive supplied the dialog code.

                  Thanks to each for their building blocks.

                  For coloring, please see this example on Alpha's Web Site. It contains an example that shows how to do exactly what you are asking, and the code is on your computer is the example web application that ships with Alpha:

                  http://afas.alphasoftware.com/SamplePagesv9/

                  Here are a few screenshots of a partially finished project that may, if nothing else, illustrate that this can be achieved in Alpha on the web. The calendar is for a night club that rents out the building for parties during the day, and allows one appointment per day. Each user can highlight his own calendar to make sure details aren't overlooked, thus creating a custom legend with a lookup color list.

                  Picture 1 is the calendar, picture 2 is a dialog box that opens after clicking on an event, picture 3 is the custom legend below the calendar, and picture 4 is the 135 colors that can be used to highlight the calendar or legend.

                  If you, or anyone is seeking code snippets to help them do this, just let me know. I just saw this thread, and it spurred me to offer this to save others as others have saved me.

                  Craig
                  Attached Files

                  Comment


                    #10
                    Re: Coloring a field on a condition in a browser

                    Craig,

                    I was struck by your highlight color lookup. That's a great idea! I have an application where someone can select a background color and text color for the heading of their page, but I have just been using text in dropdowns for the selection which limited my color choices to those that the brower would recognize. This is a much better idea!

                    Thanks,
                    Pat
                    Pat Bremkamp
                    MindKicks Consulting

                    Comment


                      #11
                      Re: Coloring a field on a condition in a browser

                      Sorry guys, I am not really good in coding. If I have a field deleteddate and computername how can I change the color of the computername when the deleteddate has something in it. I am hooked up to a SQL database, hope you can help.

                      Comment


                        #12
                        Re: Coloring a field on a condition in a browser

                        Sorry, I kind of skimmed past a real answer for you. Additionally, the web example site at Alpha is down.

                        Attached are two pictures that illustrate how I colored the field shown above in the calendar legend.

                        Basically, create a custom field, and insert your code in the definition.

                        If DeletedDate is a date field, and Name_Field is the info you want highlighted, your code might look like this:

                        if data.deleteddate > ctod("01/01/1980")
                        Highlight_render = <<%html%
                        <div style="background-color: #F0F8FF">%html% + alltrim(data.name_field) + "</div>"
                        end if

                        CTOD turns the characters into a date, but be sure to pick a date earlier than any possible delete date. You can use isblank(), if preferred.

                        Alltrim removes leading and trailing blanks from the data field.

                        Replace #F0F8FF with AliceBlue (or other directly declared HTML color like RED)

                        Comment


                          #13
                          Re: Coloring a field on a condition in a browser

                          Ugh. I always post a reply, then realize I missed something.

                          highlight is a blank field (dummy field) in the legend table. You should replace highlight_render with:

                          name_field_render

                          with name_field having been referenced by you at the start of this thread as the field to be highlighted.

                          Comment

                          Working...
                          X