Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create Textfield dynamically based on a condition

ShuvamMar 30 2017 — edited Mar 31 2017

Hi everyone,

I have a simple requirement, which will create same number of text fields dynamically based on value of the field.

I mean , If value of a number field say (:p20_count)=5, then five text fields will be created, Similarly if user insert value for (:p20_count=3) then three text fields will be created.

In a page I have declared a number field, P20_COUNT. I created dynamic action on the mentioned field for change event , which will actually refresh another region in the same page of type pl/sql dynamic content.

Now the below pl/sql code is throwing error.

[ORA-06502: PL/SQL: numeric or value error]

BEGIN

FOR I IN 1..:P20_COUNT

LOOP

htp.p( APEX_ITEM.TEXT(1,'DEPENDENT'||I));

htp.p('<br /><br />');

END LOOP;

END;

Can somebody please help me on this?

Note: When I am replacing the value of :P20_COUNT with hardcore value ,say 4 ,it's not giving any error.

Pls, Find the screen shots.

pastedImage_245.png

pastedImage_248.png

Thanks,

Shuvam

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 28 2017
Added on Mar 30 2017
9 comments
2,463 views