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

Dynamic Bubble Help

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

    Dynamic Bubble Help

    I have a grid where I want to dynamically show bubble help based on a the fields in a table. I know how to use a grid field in the bubble help {myfieldname}

    But, this grid is returning a lot of rows, and the help text for each column is the same for the entire column. I'd like to do a separate call when the grid initializes and then use the values I get from the call to populate the bubble help fields in the grid as opposed to pulling it as straight data.

    I believe this will make my grid much faster as it is not pulling the same data 1000 times just so I can use it for a mouseover.

    But I'm not sure where to start. I think I want to grab the values in the grid.execute event and then store them into an e.rv variable.

    But then I don't know how to use the e.rv variable in the bubble help section.

    Can someone point me in the right direction, please?

    Larry

    #2
    Re: Dynamic Bubble Help

    Larry - can you clarify? Do you want a (possibly) custom bubble help for each row? Or, one custom bubble help for all rendered rows?
    -Steve
    sigpic

    Comment


      #3
      Re: Dynamic Bubble Help

      One custom bubble help for each row, but separate helps for each column.

      That is why I would like to read it in once at the beginning, then set the bubble help for each column. Right now I am pulling in the help in the select statement for the grid, but then it pulls the same help for each row, which seems inefficient.

      Comment


        #4
        Re: Dynamic Bubble Help

        So if you have 100 rows, but three columns, you need a grand total of three different bubble helps?
        -Steve
        sigpic

        Comment


          #5
          Re: Dynamic Bubble Help

          Correct. (Although, in the particular grid I'm looking at, it's more like 50 columns)

          Comment


            #6
            Re: Dynamic Bubble Help

            And just to be clear, (because looking back I'm not sure I have been.) 1 help for each column, and that help would be the same regardless of which row. If the help had to be different for each row, I'd include it in the data because you wouldn't save anything by pulling it outside of that.

            But in this case, I want to setup all of the help for each column so I don't have to include it in the data.

            Comment


              #7
              Re: Dynamic Bubble Help

              OK, here's one way:

              I put bubble help in the regular property sheet for two columns. Column 1 bubble help is Col1BHelp and Column 2 bubble help is Col2BHelp

              Then in the Server side OnExistingRowRender event, I did this:

              Code:
              dim vCol1Bhelp as c = "This is column 1 help"
              dim vCol2Bhelp as c = "Here is column 2 help"
              e.currentRowHTML = stritran(e.currentRowHTML, "Col1BHelp", vCol1Bhelp)
              e.currentRowHTML = stritran(e.currentRowHTML, "Col2BHelp", vCol2Bhelp)
              I'll be interested to see if anyone comes up with something more efficient, but I can't think of it. Does this help?
              -Steve
              sigpic

              Comment


                #8
                Re: Dynamic Bubble Help

                By changing the variables a bit, I can use the ongridexecute event to set the values:

                e.rtc.vCol1Bhelp = "This is column 1 help"
                e.rtc.vCol2Bhelp = "Here is column 2 help"

                And then use them in the onexistingrowrenderevent


                e.currentRowHTML = stritran(e.currentRowHTML, "Col1BHelp", e.rtc.vCol1Bhelp)
                e.currentRowHTML = stritran(e.currentRowHTML, "Col2BHelp", e.rtc.vCol2Bhelp)


                That way setting the values with a sql call will only fire once per rendering of the grid.

                Thank you Steve, that is quite nifty!

                Comment


                  #9
                  Re: Dynamic Bubble Help

                  Taking this one step further you might be able to avoid setting the Help Tips on every "OnGridExecute" event. I have a grid where I set column headings, but not during a "save" callback. So, I put this at the beginning of OnGridExecute:

                  if e.ajaxCallback = .t.
                  if "save" $ request.variables.__FormAction then
                  end ' *** Exit event
                  end if
                  end if
                  I figure there might be some other "__FormAction", besides "save", that I might discover that does not need to execute the fixups. That is why I coded it as 2 "IF" statements.

                  Comment


                    #10
                    Re: Dynamic Bubble Help

                    You could also do it in the "other properties" property of the grid and do a strtran there for the property "BubbleHelpControl" after first calling a function that looks up the data. No callbacks & only 1 call.
                    The "other properties" property is pretty powerful you can write xbasic code there with no problem so it is not just limited to setting some tmpl.<propertyname> value as one might think.
                    Frank

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

                    Comment


                      #11
                      Re: Dynamic Bubble Help

                      I was going to only fire the script when ajaxcallback = .f.

                      But now I'm also going to look into the "other properties" and see how that works!

                      Comment


                        #12
                        Re: Dynamic Bubble Help

                        Got it Working! Here is the script in case anyone is interested:

                        In OnGridExecute:

                        if e.ajaxCallback = .f. then

                        dim conn as SQL::Connection
                        dim connString as C
                        dim query as C
                        dim args as SQL::Arguments
                        dim array[1] as P
                        dim e.rtc.helparray[1] as P
                        dim results as C

                        query = "select FlagHelpKey, flagdef from vw_tblflag where flagorder is not null order by flagorder"

                        connString = "::Name::conn"

                        if .not. conn.open(connString)
                        ? "Error" + conn.CallResult.text
                        end
                        end if

                        if .not. conn.ToPropertyArray(query, e.rtc.helparray)
                        ? "Error" + conn.CallResult.text
                        conn.close()
                        end
                        end if

                        conn.close()

                        end if

                        In onExistingRowRender:

                        -- NOTE: I know, I should put a loop around this. I'll get around to it someday!
                        -- NOTE2: In each help bubble field I put |Flag1|, |Flag2| etc. Those are values coming through in FlagHelpKey, FlagDef is the help text.

                        e.currentRowHTML = stritran(e.currentRowHTML, e.rtc.helparray[1].flagHelpKey, e.rtc.helparray[1].flagdef)
                        e.currentRowHTML = stritran(e.currentRowHTML, e.rtc.helparray[2].flagHelpKey, e.rtc.helparray[2].flagdef)
                        e.currentRowHTML = stritran(e.currentRowHTML, e.rtc.helparray[3].flagHelpKey, e.rtc.helparray[3].flagdef)

                        ...

                        e.currentRowHTML = stritran(e.currentRowHTML, e.rtc.helparray[20].flagHelpKey, e.rtc.helparray[20].flagdef)
                        e.currentRowHTML = stritran(e.currentRowHTML, e.rtc.helparray[21].flagHelpKey, e.rtc.helparray[21].flagdef)

                        Comment

                        Working...
                        X