B4J Question Multiple Dynamic Fields?

PenguinHero

Member
Licensed User
Longtime User
Hi All,

A little bit of background:
The real quick summary - I'm writing a simple proof-of-concept using B4J for an application that could replace a very long multi-stage manual process.
The current process is an approval mechanism that follows a number of stages, with each stage having its own data collected for it, and a different team that reviews that data and approves (or rejects) that stage.
Along with the approval there may have been risks identified for that stage, that need to be recorded against it.
I'm using a tabbed pane view, with one tab for each stage, and the tab having the fields specific for that stage.
Overall this is working well, and looks quite good.

Problem:
On each tab I currently have a single text field for a risk, along with another text field next to it that would hold each risk mitigation, if it has been identified.
This works well if there are no risks, as the stage gets approved and the risk field is left empty.
If there is only one risk it's fine too.
But what if there are two or more risks identified for that stage?

Question:
This is probably as much as a design question as a technical question.
How do I set up a mechanism on each stage's tab where the user can indicate if there are more than one risk, and get another pair of risk and mitigation text fields dynamically created to fill out, and repeat this as often as needed?

I can write each pair to a unique database record that is linked to the overall Process ID and Stage ID, and read them back, but I don't know how to handle the GUI side of things.

How can I dynamically add another pair of fields to the screen when needed? And remove them if the user indicates they were requested in error? And how to I populate all these dynamic fields when I read that data back from the table of risks for editing, when I don't know what the fields are called?

I'm hoping this is a common problem, with a simple solution, but a search of the forums didn't show me anything even close to what I'm tying to do - perhaps a reflection of my poor searching skills. :)

Any and all suggestions appreciated.


Thanks.
PH.
 
Top