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

Can field values be inserted into textarea HTML editor?

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

    #16
    Re: Can field values be inserted into textarea HTML editor?

    I think I'm doing something very close to that. We have about 18 different letter templates. When we create a record we choose the template we want to use. When I print the report the tokens are replaced with the values. It seems like your driver is the table with those details. And then a drop-down with what State Lien they want to use.

    Comment


      #17
      Re: Can field values be inserted into textarea HTML editor?

      Originally posted by kingcarol View Post
      You made me start thinking now, Lee. I think I could probably give them a list of strings to insert into their text ...such as [VENDOR_NAME] or [CHECK_AMOUNT]. Then on the report design, I can use a calculated field to replace those strings with field values....
      What are trying to do is actually quite easy with build in JavaScript assuming you are using the Alpha HTML editor in a textarea. There are two parts to the process. First you need to insert some text at the cursor position, and then you need to make the editor content "dirty" so it can be saved.

      If you want to put a placeholder named [VENDOR_NAME] in the text in the editor, create a button or link and on the onclick event add this
      Code:
      {Grid.ComponentName}_BODYCONTENT_RTEObj._edInsertHTML('','[VENDOR_NAME]');{Grid.ComponentName}_BODYCONTENT_RTEObj._edGetState();
      where "BODYCONTENT" is replaced with the name of the control that holds the editor. If the control is named "NOTES", the code would be
      Code:
      {Grid.ComponentName}_NOTES_RTEObj._edInsertHTML('','[VENDOR_NAME]');{Grid.ComponentName}_NOTES_RTEObj._edGetState();
      The placeholder will be inserted at the cursor position. This can be used to insert any text or characters into the editor

      Comment


        #18
        Re: Can field values be inserted into textarea HTML editor?

        Lee, when the user inserts a token from the dropdown list it looks like it always gets placed at the end of end of the text field, right? And I assume they can just cut and paste it higher up in the text if they want?

        Did you look into a way to paste the token at the cursor's current position?

        -Rich

        Comment


          #19
          Re: Can field values be inserted into textarea HTML editor?

          Yes. Version 2 will have that. Usually, these templates aren't changed much. The first time through you just click on the drop down and it goes at the end because that's where you want it anyway. But it would be nice to have it at the cursor. I've tried Jerry's code, but because I'm using a drop down it seems to loose where the cursor is and puts at row 1 column 1.

          Comment


            #20
            Re: Can field values be inserted into textarea HTML editor?

            Didn't have time to try any of the above today, but TOMORROW!... playing with it will be fun! Thanks, Lee and Jerry. I'll report back the results.
            Carol King
            Developer of Custom Homebuilders' Solutions (CHS)
            http://www.CHSBuilderSoftware.com

            Comment


              #21
              Re: Can field values be inserted into textarea HTML editor?

              Carol here is one that I have done which is a standard letter and depending on the type of hire I choose a certain letter. This is done with rtf in a report.

              http://www.screencast.com/t/Czi4vNUk1
              Chad Brown

              Comment


                #22
                Re: Can field values be inserted into textarea HTML editor?

                That's very cool, Chad. Shows that strings are being replaced with values, which is very good to know. Is a user entering the rich text themselves, or are you providing the letters? In my case, I do not plan to become a lawyer and keep up with 50 states and their lien waiver requirements, so my users will be using the html editor to create the main body text. I'm going to try Jerry's idea for that with buttons... today, I hope.
                Carol King
                Developer of Custom Homebuilders' Solutions (CHS)
                http://www.CHSBuilderSoftware.com

                Comment


                  #23
                  Re: Can field values be inserted into textarea HTML editor?

                  The user is not entering that info as its an in house thing. I have two preset letters but you could basically have a different button for each letter needed. In your case you would definitely need a more dynamic solution.
                  Chad Brown

                  Comment


                    #24
                    Re: Can field values be inserted into textarea HTML editor?

                    I am finally getting around to trying to follow Jerry's advice above, but am getting a script error. (I have sent a msg to Jerry via email asking advice.)

                    I have created a button with the following in-line javascript (field name of the control with the editor is LW_TEXT_RICH) :
                    Code:
                    {Grid.ComponentName}_LW_TEXT_RICH_RTEObj._edInsertHTML('','[VENDOR_NAME]');{Grid.ComponentName}_LW_TEXT_RICH_RTEObj._edGetState();
                    When that button is clicked (after I type some text into the editor), I get the following script error:
                    GRID1_LW_TEXT_RICH_RTEObj is undefined.

                    Here is video: http://screencast.com/t/QOFjuAWtYiIa
                    Carol King
                    Developer of Custom Homebuilders' Solutions (CHS)
                    http://www.CHSBuilderSoftware.com

                    Comment


                      #25
                      Re: Can field values be inserted into textarea HTML editor?

                      For mail merge I insert "fields" in the text area like ***firstname*** and then use stritran() to replace that field with an actual value at runtime. As long as the user knows what field names are valid they can insert them in the editor.
                      Steve Wood
                      See my profile on IADN

                      Comment


                        #26
                        Re: Can field values be inserted into textarea HTML editor?

                        I'm planning to do exactly that with the stritran, too, Steve. I like your solution, and I think I'll just give my users a list of the strings they need and give up on Jerry's solution.
                        Carol King
                        Developer of Custom Homebuilders' Solutions (CHS)
                        http://www.CHSBuilderSoftware.com

                        Comment


                          #27
                          Re: Can field values be inserted into textarea HTML editor?

                          Well, Steve, (or somebody).. would you mind helping me out here? I've used stritran_multi several times, but always just replacing strings with hard text.
                          In my example below, the bodyOutlist needs to be the values of the fields Ap_Vendor_Name and Checktotal. How do you get those values in there? It doesn't like that line right now.

                          Second question... my calculated field to use on the report will be waiverBodyResult and I don't know how to tell the report that it is an HTML Memo field so that it won't display all the rich text symbols?

                          waiverBody = Lw_Text_Rich (Lw_Text_Rich is field that holds the user input)
                          bodyInList = "***VendorName***,***CheckAmount***"
                          bodyOutList = Ap_Vendor_Name,Checktotal (needs to be list of values. Of course I can't put quotes around it cuz will just get field names)
                          bodyInRows = comma_to_crlf(calc->bodyInList)
                          bodyOutRows = comma_to_crlf(calc->bodyOutList)
                          waiverBodyResult = stritran_multi(calc->waiverBody,calc->bodyInRows,calc->bodyOutRows)
                          Carol King
                          Developer of Custom Homebuilders' Solutions (CHS)
                          http://www.CHSBuilderSoftware.com

                          Comment


                            #28
                            Re: Can field values be inserted into textarea HTML editor?

                            I'm getting there with using stritran one step at a time instead of stritran_multi.... but still don't know how to get the html stuff out of my calculated field.
                            Here is a screenshot of my report (just a testing report): http://screencast.com/t/yEIUf37F7

                            waiverBody = Lw_Text_Rich
                            waiverBodyResult1 = stritran(calc->waiverBody,"***VendorName***",Ap_Vendor_Name)
                            checkAmount = alltrim(str(Checktotal,250,2,"$"))
                            waiverBodyResult2 = stritran(calc->waiverBodyResult1,"***CheckAmount***",calc->checkAmount)
                            waiverBodyResult = calc->waiverBodyResult2
                            Carol King
                            Developer of Custom Homebuilders' Solutions (CHS)
                            http://www.CHSBuilderSoftware.com

                            Comment


                              #29
                              Re: Can field values be inserted into textarea HTML editor?

                              I'm so close... Anybody? Do you know how to make my calculated field above (waiverBodyResult) print in rich text on the report?
                              Carol King
                              Developer of Custom Homebuilders' Solutions (CHS)
                              http://www.CHSBuilderSoftware.com

                              Comment


                                #30
                                Re: Can field values be inserted into textarea HTML editor?

                                I have been trying all kinds of functions to get my calculated field to display as rich text.
                                Some of my tries are below and all they produce is a bunch of junk. I am completely stumped. HELP?????? pretty please

                                *plain_to_html(calc->waiverBodyResult2)
                                *rtf_to_html(calc->waiverBodyResult2)
                                *plain_to_rtf(calc->waiverBodyResult2)
                                Carol King
                                Developer of Custom Homebuilders' Solutions (CHS)
                                http://www.CHSBuilderSoftware.com

                                Comment

                                Working...
                                X