Home › Forums › Development › Using data from other fields in an AFL portlet.
Tagged: AFL Portlet, UI, UI Development
- This topic has 6 replies, 2 voices, and was last updated 1 year, 9 months ago by Max Widmaier.
-
AuthorPosts
-
-
February 26, 2023 at 7:05 pm #22032Max WidmaierParticipant
Hello all!
I’ve recently discovered AFL portlets. These seem to be a very powerful tool, but there seems to be very little documentation on what it’s capabilities are (using in-built functions of course). I was wondering if it were possible to grab the data from other fields in the portlet and use them for calculating new fields, running data operations, parsing, etc.
For example,JavaScript123456789101112131415161718define("app/portletname", ["nexj/sys", "nexj/ui"],function(sys, ui) {"use strict";function process(name) {return "Hello, " + name + "!";}return function() {return ui("Portlet", {children: [ui("Card", {caption: "Test Portlet", children: [ui("Text", {caption: "Name", value: new ui.Value()}),ui("Button", {caption: "Test", onClick: function() {process(<get text of Name field>);}})]})]})}})Obviously, I could achieve this through using React, however it would be far simpler to just use an AFL module because it already has the look and feel of Finance. So, is there a way to get the value of a field in the portlet or will I just have to use React? If any exists, could I be pointed to further documentation on various functions and abilities of AFL portlet other than the basic documentation here
0 -
February 26, 2023 at 7:14 pm #22042Max WidmaierParticipant
Also if I’d like to use other JavaScript libraries in my portlets how would I include them? For example, jQuery.
0 -
February 28, 2023 at 9:35 am #22079Ed ShawKeymaster
Max, I’ve attached a PDF with some more information about AFL. This document will be included in our public documentation set in the near future. Thanks
0 -
February 28, 2023 at 9:36 am #22086Ed ShawKeymaster
File seems to be too large for the server upload. I’ll send it directly to you.
0 -
February 28, 2023 at 11:55 am #22095Max WidmaierParticipant
I’d just like to check because this may be an issue, but can I use Typescript while developing stuff (as long as I package it before running?). I assume that would be fine but just checking.
0 -
February 28, 2023 at 1:40 pm #22104Ed ShawKeymaster
Max,
For very custom portlets, there are examples in training for how AFL and also AFL/React may be integrated and done carefully, they have their uses. That said, the vast majority of UI patterns can be accomplished in NexJ Studio using MDA Layouts, Portlets, and Dialogs.
Using raw AFL and including 3rd party libraries and tooling is not the recommended approach as we don’t have predictability of security, download size, compatibility, licensing … You also have to do a fair bit of manual work to support data binding, internationalization, rendering, context sharing and ongoing maintenance.
Please confirm with your project team what you plan on doing with AFL and what the plans to maintain that code going forward would be.
Thanks
0 -
March 1, 2023 at 4:58 pm #22124Max WidmaierParticipant
Unfortunately, I don’t think there is a way to do that with MDA. Unless there’s a way to easily parse text using scheme. I was mostly asking about JavaScript APIs because I wanted to ensure that we could use a library I am building which provides an abstraction layer over Finance’s REST API. Unless there’s a way to interact with the database using AFL, which I haven’t seen, that will be necessary for ease of programming and code readability. The reason I’m using AFL is because JavaScript is because it is easier to process data, especially for the specific task we are using it for. So it wouldn’t be 3rd party libraries because we’d be developing it in-house. I will take a look at training however.
Thanks
0
-
-
AuthorPosts
- You must be logged in to reply to this topic.