Checkbox in forms

Hello again,

I’ve been trying to design the fixed asset form to fit my company’s needs. One of them is to tick checkboxes of port types.

For example, a typical laptop may include dc-coaxial power port, VGA port, HDMI port, USB-A ports, USB-C port, RJ45 port, and an SD card reader while a monitor nowadays may only support VGA port and Display port. With people requiring multiple monitors for works, it becomes important to track the port compatibility and provide search options in fixed asset section.

Currently, my temporary solution is to create a new field called “port capability” with a ‘long-varchar’ entity type in /scipio/applications/accounting/entitydef/entitymodel.xml under the fixed asset section. Then people may type in the port types manually each time they create a new entry. The downside of this is obviously typos and massive extra work to manually type them.

image

I wish to change this section to a checkbox-style form similar to asset types (asset type is a drop-down menu, the content within the menu can be edited by entity engine, but it can’t select multiple types.)

The first thing that comes in my mind is that this may involve introducing a new entity to which the fixed asset entity has a one-to-many relation. My difficulty lies on how to show checkboxes onto forms such as /scipio/applications/accounting/widget/asset/FixedAssetForms.xml and /scipio/applications/accounting/widget/FieldLookupForms.xml

Thanks for any help

I think it may be easier to just migrate this particular form to an ftl and simply rely on the @table layout to build this from scratch.

Though you can actually add javascript events and logic to the widget style xml files, it is usually quite tedious to work with them in such a way. I am not sure i mentioned this before, but the xml widgets are really the least attractive part of working with scipio erp - a left over we are reducing whenever we can.

Oh, that’s really news for me.

But it seems I can’t find anything related to fixed asset under /scipio/applications/accounting/webapp/
Anyway, I will look into it and hopefully figure out how these ftls work.

Thank you for the reply.

Asset maintenance has a lot of the simple xml style code. So there are entity lookups that are then put in context. An xml widget is loaded which interprets the result (here: a form widget).

Instead of doing that, we usually prefer to use an ftl file to render the result. It is more straight forward when it comes to applying custom code and not difficult at all.