1. Dan Harrel
  2. PowerBuilder
  3. Thursday, 15 April 2021 19:33 PM UTC

Can I insert data entry fields into a Rich Text document in a PB Rich Text control?  

I understand PowerBuilder supports version 1.6 of the RTF standard, except for Formatted tables and Drawing objects.  The RTF 1.6 standard seems to support such fields: http://latex2rtf.sourceforge.net/rtfspec_7.html#rtfspec_31 .  

I cannot see how to insert such fields when using a PB Rich Text control.  There are no ribbon bar options for fields, or right-mouse button options.  

I next thought to create a Rich Text document with such fields outside of the PB control, and then trying right-mouse-click "Insert File..." to the document into a PB Rich Text control.  I wanted to see how the control would handle it.  I just cannot seem to find a tool that will let me create a RTF file with such fields (MS Word saving as RTF did not work, for example).  

Here is what I'm trying to do: I would like a user of our application to be able to create a task list document to populate into a PB Rich Text control that includes checkboxes and data entry fields.  Users would use the checkboxes to mark off steps they had taken.  Users would enter values such as measurements into data entry fields.  The document, with fields and values, would be saved by our application.  

I need the Rich Text data, complete with fields and field values, visible in PB and in a web app.  I was thinking the built-in TX control in PB would meet the need on the PB end, and a licensed "TX Control .NET Server" (or similar) would meet the need for the web app.  However I can't yet do what I want on the PB end.  

Does anyone have any experience, feedback, or alternate suggestions?  

Thanks!

P.S. May I suggest creating a tag for Rich Text?

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 16 April 2021 14:47 PM UTC
  2. PowerBuilder
  3. # 1

(posted this on the wrong post!).
Here's my initial version, saving doesn't do anything yet (have to register the callback js function to a powerbuilder event, which what I'll do right now). Expect me to be posting improvements somewhere else, maybe a new post with a link to github or google drive.

See attached.

 

Attachments (1)
Comment
  1. Dan Harrel
  2. Friday, 16 April 2021 15:00 PM UTC
Thanks again, Miguel. I look forward to hearing further.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 16 April 2021 01:40 AM UTC
  2. PowerBuilder
  3. # 2

Currently, tired of all the quirks of each and every version of the rich text control in PB, I'm implementinig the Tiny MCE html editor. With the new web browser control available in PB 2019 R3 that's really a nice solution since now we are able to interact iwith user events, javascript call back functions, etc.

Once I've finished, I'll post a sample app.

 

Comment
  1. Miguel Leeuwe
  2. Friday, 16 April 2021 14:50 PM UTC
you could define your own format for what's to be considered an input field. After that, search and replace with the values.

Tinymce is html + js. I'm pretty sure you can define your own form in the index.html but I wouldn't know how to make that easy to do for a user. You'd probably have to code it yourself. (a button that inserts the required html for you input fields).
  1. Helpful
  1. Miguel Leeuwe
  2. Friday, 16 April 2021 14:53 PM UTC
We have a current solution (using the traditional rte), in which we allow a user to drag and drop fields from some datawindows onto the rte wherever the cursor is. We name them ##field_name##. Later (when sending the email), we replace those fields with values.
  1. Helpful
  1. Miguel Leeuwe
  2. Friday, 16 April 2021 14:54 PM UTC
I don't remember exactly why we chose not to use input fields, but there was a reason. Maybe the ability for a user to NOT show them, can't recall, getting old.
  1. Helpful
There are no comments made yet.
Dan Harrel Accepted Answer Pending Moderation
  1. Thursday, 15 April 2021 20:59 PM UTC
  2. PowerBuilder
  3. # 3

Thanks, Chris.  That sounds very promising!  Can you please help me find it?  Please see the attached.  

You prompted me to look and find the "Input Field Names Visible" and "Input Fields Visible" checkbox, however this help me (yet).  Please see attachment 2.  

Thanks.

 

 

Attachments (2)
Comment
  1. Chris Pollach @Appeon
  2. Friday, 16 April 2021 17:15 PM UTC
Hi Dan;

That is a tricky one because the control has it's own built-in pop-up menu. You need to use your own PopMenu() command and intercept the default RHMB event. Then your pop-up menu will take precedence over the built-in one. Now you can add whatever new functionality to your App's RTE pop-menu that you need.

HTH

Regards ... Chris
  1. Helpful
  1. Dan Harrel
  2. Friday, 16 April 2021 18:39 PM UTC
Thanks Chris. However it looks like your suggestion creates fields in which to display data. I'm looking to create fields in a RTF document where users can enter data, including and especially clicking checkboxes. Such seem to be part of the RTF 1.6 specification. I still can't find by Googling anywhere this is actually done, though.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 16 April 2021 19:09 PM UTC
Yes, the RTE control and RTF DW are not that friendly when it comes to data entry. However, how about using a DWO for the data entry part and then linking the DWO's column(s) to the RTE's Input Fields? That would allow you to control the data entry precisely via the DWO and then have the RTF document produce the final RTE output. This can be easily done by using the ShareData() between the DWO & the RTE. Basically, binding the two controls too act as one.

http://docs.appeon.com/pb2019/application_techniques/ch16s03.html#d0e11942

Food for thought. ;-)
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 15 April 2021 19:53 PM UTC
  2. PowerBuilder
  3. # 4

Hi Dan;

   Have you looked at using the RTE Control's "InputFieldInsert" command from your own toolbar or popup menu on the RTE control?

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.