Home > database >  Oracle Apex - Display Items based on number of values
Oracle Apex - Display Items based on number of values

Time:12-02

I have a regular link on an Interactive Report:

my IR

That links sends the Deal Number information into a different page where the user will be able to update all product information. As per customer request, I need to use items. Issue is, that I need to show one textfield item per Product, so for example:

If Peter is selected (as per my snap above), I would need to show 2 textfield Items, one for Product 'ABC' and another for Product 'XYZ'.

If John is selected, I would need to show 3 textfield Items, one for 'Product1', one for 'Product2' and another for 'Product3'.

Is there a way to achieve this dynamic display of items? If so, how can I make Item 1 to show Product1 info, Item 2 to show Product2 info and so on?

Thanks

CodePudding user response:

There are a couple of routes you can take, each one has it's pros and cons.

1. the APEX_ITEM API

This is an API that renders apex items, as part of a sql query or in a static region with pl/sql source (not tested that last option)

Pro:

  • a lot of flexibility

Cons:

  • Look and feel is "old" - doesn't look anything like the modern page items that exist in the universal theme and you're stuck with that old look and feel. Lots of and coded pl/sql.

2. A fixed number of pre-created items.

Create a number of items and populate only the ones you need, eg P1_PRODUCT1_NAME, P1_PRODUCT2_NAME, ... .If you only need a single product then you're populate only P1_PRODUCT1_NAME, else you'd use as much as you need. With server sided conditions you hide/show the ones not needed/needed

Pro:

  • All the bells & whistles for look and feel you have in "normal" forms

Cons:

  • Can't render more products than what you created items for in your page. What if you create fields for 10 products but you need 11 ?

3. Interactive Grid.

I know "the customer wants items" but this component is specifically written for this purpose. I'd definitely consider this as an option - maybe you can make the customer change his mind.

Pro:

  • Very modern apex component, highly configurable. Check the interactive grid cookbook for a ton of advanced examples.

Cons:

  • Not items - this is tabular form/spreadsheet layout. Not all end users like them as a form of data entry.
  • Related