Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Request: Textedit Links to raise Actions  (Read 13544 times)
.
Posts: 64


« on: October 16, 2009, 12:33:53 pm »

Hi,

I was wondering if it's possible to have a textedit feature for triggering actions from within a textedit, similar to how weblinks work in text edits so that an action can be raised by clicking within the text edit (probably need to be dNO ENTRY on the textedit). I suppose this could also work with a label with HTML.

If I explain the main motivation: Within our optometric system we show historical examinations on a form based approach, record by record with forward/back type navigation between them. What we want is more of a 'record card' (report) type format ( I've enclosed a .png with an example) that we use as an overall summary that will cover all their tests. But what we want is a clickable link within the text to allow us to capture an action, normally to copy the chosen test data to the one that is being entered. Obviously we might need to have lots of actions defined as they might have lots of test, but I'm okay with that although my suggestions below for implementation helps work around it a bit.

No idea how you would implement, but possible ways:

1) HTML type tag with a different action for every one
  eg
   LET lv_text = "<linkaction=edit_label_text>Your Title Here</linkaction>. "

   ON ACTION edit_label_text

Or
2) Single action for each text edit, passing a tag when an action is raised allowing the action to be used for many items
 eg
   LET lv_text = "<linkaction tag='edit_label_text'>Your Title Here</linkaction>"

   ON ACTION textedit_action         -- Generic, or defined in .per as LINKACTION=textedit_action against the TEXTEDIT
      LET lv_item = DIALOG.getLastLinkActionTag()

      CASE lv_item
         WHEN "edit_label_text"

Or
3) best of both (and my prefered option), define action in HTML with a tag to allow both many actions and multiple use dependant on function
 eg
   LET lv_text = "<linkaction=edit_label_text tag='main title'>Your Title Here</linkaction>. ",
                            "

<linkaction=edit_label_text tag='sub heading'>This is not the main title</linkaction>"

   ON ACTION edit_label_text   
      LET lv_item = DIALOG.getLastLinkActionTag("edit_label_text")

      CASE lv_item
         WHEN "main title"
                               -- do your bits
                        WHEN "sub heading"


I hope this makes sense. I personally feel that textedit is a really useful feature who's strengths could be really improved with this feature.

Thanks

Jeff McFee
Eyesite


* RecordCard.PNG (67.81 KB, 1048x910 - viewed 1434 times.)
Reuben B.
Four Js
Posts: 1062


« Reply #1 on: October 18, 2009, 10:19:43 am »

Why use 1xTEXTEDIT.  I look at that page and see 50+LABELS and 7xBUTTONS with the link style introduced in 2.20 https://4js.com/techdocs/genero/gdc/devel/DocRoot/User/NewFeatures220.html#220ButtonLink.  Using presentation styles you can get the same look (black text on a white background) if that is what you are after.

Reuben


Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
.
Posts: 64


« Reply #2 on: October 18, 2009, 11:30:57 am »

Hi Reuben.

Thanks for the reply, but I think a change to textedit would be far more appropriate and the label/button route unmanageable.

You see on this fairly simple example 7 buttons and 50 labels which all need coding or generating plus the code to trap them but in reality I might need to add hundreds of labels and huge numbers of buttons. Also, whilst the example I've given is in a single window the normal usage would be side by side with the input screen and thus the only place I want scrolling is within the textedit field. There will also be about 15 locations in our form (different folder pages) where this will be in use.

The content of each page will also change quite a bit depending on what our patients have previously had, how many times they've been, what they wear for correction, the severity of their vision, how they pay etc. Doing this in a text string is actually very simple but handling labels and buttons would be very problematic and I'm really not convinced the DGC would correctly handle the layout.

Would be great to hear back from 4JS if this is a possibility as I still think it could benefit others as well and also because with out it we are left wondering which way to go next.

Thanks

Jeff
Reuben B.
Four Js
Posts: 1062


« Reply #3 on: October 18, 2009, 12:50:42 pm »

Quote
the normal usage would be side by side with the input screen and thus the only place I want scrolling is within the textedit field.

that is an interesting point.  If I was using LABEL/BUTTON to render that page then I'd probably be forced to go FOLDER/PAGE to avoid the window exceeding the screen size, or perhaps endup requesting a SCROLLBAR attribute for GRID.

Quote
There will also be about 15 locations in our form (different folder pages) where this will be in use.

Consider how data is sent from the backend to the GDC in this scenario.  I had one site who said their system was running slow.  When we looked into it there were about 10 folder pages and a number of TEXTEDITs, some of them that were very large (30,000-60,000 characters)).  All the information in the folder pages was 'displayed' at the beginning.  WHilst their was improvement by only sending the data for the folder pages to the GDC when the individual page was clicked on, you can't do the same for a TEXTEDIT.   You have to send the whole info even though the user may not scroll down in the TEXTEDIT and ever read it all.

If you want to pursue the TEXTEDIT further, also consider WebKit.  Instead of creating a textedit string, create an html file and display it via webkit.  You will get a wider range of HTML functionality (but still no ability to trigger a GDC action)

Quote
The content of each page will also change quite a bit depending on what our patients have previously had, how many times they've been, what they wear for correction, the severity of their vision, how they pay etc. Doing this in a text string is actually very simple but handling labels and buttons would be very problematic and I'm really not convinced the DGC would correctly handle the layout.

You know your application and data better then I do (although I think I can guess why the right is on the left, and the left is on the right :-)).  I didn't see anything that didn't scare me away from using LABEL/BUTTON, FOLDER/PAGE, DISPLAY BY NAME, and some hidden methods on Page, Grids, and/or individual LABELS/BUTTONS.

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
.
Four Js
Posts: 115


« Reply #4 on: October 18, 2009, 01:00:21 pm »


If you want to pursue the TEXTEDIT further, also consider WebKit.  Instead of creating a textedit string, create an html file and display it via webkit.  You will get a wider range of HTML functionality (but still no ability to trigger a GDC action)


Actually, this is in our plans for future version (would annonce 2.30 but roadmaps and version numbers are not in my hands).
I've already worked on a small prototype to publish an object that could then be available via javascript. This object would made public a few functions like "triggerAction". You would then be able to create an html link, and via some javascript trigger the action you would like.
I've also tried to propose a kind of "data buffer" you can access via javascript and via your 4GL program (don't tried yet, but I would even expect that a given javascript function may be triggered if the buffer changes so you don't have to poll data).

As said Reuben, this would rely on our webkit integration, our basic textedit widget has a too weak scripting support for that.
Lionel F.
Four Js
Posts: 82


« Reply #5 on: October 21, 2009, 10:17:18 am »

Jeff,

In addition to what was mentioned by Pierre-Nicolas, take also note that we filed an enhancement request for your follow-up (enhancement bz.#15085: Having a way to manipulate 4GL dialog from JavaScript). The main idea would be top provide a JavaScript API in order to introspect the available actions, raise a given action, modify a given value and so on....

Regards,
Lionel
Jeff M.
Posts: 38


« Reply #6 on: February 02, 2016, 03:55:16 pm »

Was anything ever actioned on this?

Using HTML in textedit's is a great feature but being able to raise a BDL action would improve the look and feel of applications greatly.

Thanks,

Jeff
Laurent G.
Four Js
Posts: 110


« Reply #7 on: February 02, 2016, 04:20:12 pm »

Jeff,

Have you looked at a Genero feature called Web Components where you would embed a html/js component inside a Genero container and can then interact with it:

https://4js.com/online_documentation/fjs-fgl-manual-html/?path=fjs-fgl-manual#c_fgl_webcomponent.html

There are 2 types, one where you can define 4gl actions to be triggered inside the WC
Jeff M.
Posts: 38


« Reply #8 on: February 02, 2016, 05:30:47 pm »

Thank you Laurent.

I suspected there would be a way to implement it. I will try and set some time aside for playing but as normal a very busy release schedule leaves little time for play, which is why a more straightforward method would have been ideal.

At least I know where to look now.
Reuben B.
Four Js
Posts: 1062


« Reply #9 on: February 02, 2016, 11:22:50 pm »

Jeff,

I quickly modified one of my webcomponent examples to show 4gl action being triggered by richtext in a web component.  Have a look at https://github.com/FourjsGenero/wc_touchpad  (follow https://www.youtube.com/watch?v=OcEGsOqAUAc to check out fromGitHb into GeneroStudio and run).  When the example runs click Html, and then you will see some richtext with a link you can click on that triggers a 4gl action.

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines