Home » Developer & Programmer » Forms » Maximum no of rows in a list block (Forms 6.0.8.22.1 on XP against Oracle 9.2.0.1 DB)
Maximum no of rows in a list block [message #425229] Thu, 08 October 2009 02:59 Go to next message
thalheim
Messages: 5
Registered: October 2009
Junior Member
I wonder if anyone can help...

I have 2 blocks on my canvas b_top and b_list. "Header" info is inserted into b_top and "detail" info is inserted into b_list, by the user (it is not a select from a DB!). The detail info can range from 1 row to, well, infinity (in theory) and will hold a numeric value.

e.g. 3 "detail" rows (numeric value and description are separate fields)

2 cabbages.
3 carrots.
2 onions.

Thus, I wish to loop through the rows and for each row "internally loop" against the numeric value. So (in the example above) I end up with DB rows...

Cabbage
Cabbage
Carrot
Carrot
Carrot
Onion
Onion

The "internal loop" is easy, as I have the numeric value to work against (ie, 2 cabbages). However, looping through the rows is proving more difficult. I've been trying, something along the lines of...

Go_block('b_list');
First_record;
While "vegetable" is not null loop
...
"Internal loop"
...
Next_record;
End loop;

What would be nice would be able to know how many rows are in b_list, so I could use that to loop against (ie, whilst current_row < max_no_of_rows).

Yet, I can find no way to determine max_no_of_rows. Any suggestions?
Re: Maximum no of rows in a list block [message #425233 is a reply to message #425229] Thu, 08 October 2009 03:17 Go to previous messageGo to next message
omaribais
Messages: 34
Registered: October 2009
Location: Bangladesh
Member

hi thalheim,

This is not clear to me why u need max_no_of_rows, if it only for make terminating condition of loop then you can try another way instead of while loop,
i.e.
-------------------------------------------------
Go_block('b_list');
First_record;
loop
...
"Internal loop"
...
Exit When :System.Last_Record='TRUE';
Next_record;
End loop;
-------------------------------------------------
If it fulfill or not your want's please let me know.

Regards,
Omar
Re: Maximum no of rows in a list block [message #425246 is a reply to message #425233] Thu, 08 October 2009 04:21 Go to previous messageGo to next message
thalheim
Messages: 5
Registered: October 2009
Junior Member
Cheers for the feedback Omar. I'm new to forms [can you tell Wink], have had no handover, with no other developer to bounce ideas off and am fumbling in the dark (somewhat). I've used Powerbuilder and other GUI development type tools in the past; some of which is relevant; some of which is not - ha ha!

Anyhow, I have tried your suggestion... and now get a "frm-40106 no navigable items in destination block" - which, I believe is triggered by next_record.

Yet, ALL items on b_list are text items, navigable, visible, enabled etc, etc. (which is the implication on another thread).
Re: Maximum no of rows in a list block [message #425247 is a reply to message #425246] Thu, 08 October 2009 04:33 Go to previous messageGo to next message
thalheim
Messages: 5
Registered: October 2009
Junior Member
Actually, it seems the go_block('b_list') is throwing the frm-40106 error, yet (as I say above) ALL items on the block are visible, enterable, inserts allowed etc, etc... jeez, this is cuckoo!! Wink
Re: Maximum no of rows in a list block [message #425358 is a reply to message #425247] Thu, 08 October 2009 13:20 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, Oracle is usually right when it complains about something. Although items are navigable when you check them in Forms Developer, what happens during runtime? Did you modify their properties (using SET_ITEM_PROPERTY or SET_BLOCK_PROPERTY built-ins)?
Re: Maximum no of rows in a list block [message #425417 is a reply to message #425358] Fri, 09 October 2009 01:55 Go to previous messageGo to next message
thalheim
Messages: 5
Registered: October 2009
Junior Member
Sure... I've used Oracle in the past (PL\SQL, Stored Procs etc)... and, as you say, it's "usually right". Though there are one or two interesting, how should I put it... err, features lol.

For this, I guess it's the little nuances of Forms that I'm missing (it'll come!)... I have been modifiying the properties, displaying, enabling (and vice versa) items etc, so that the user may not progress further forward than they should do (and yes, i've been looking at another thread that you have commented on littlefoot)... I'm convinced that all the items on b_list are active, accessible, enabled etc, etc, before I'm trying to perform the nested loops (because how else would the user be able to enter the data). But something strange still happens... the tabbing ability between one item and another within b_list doesn't function, I imagine programatically I have to force the navigation... but it seems like a lot of work, when all you wish to do is hide or show an item. [For example, within Powerbuilder you can hide or show "items" and yet their functionality (behind the scenes) remains exactly the same - so that you don't have to code around the nuances.]

Anyhow, I have modified the logic of the form... and have got it working; it's not how I would want it to be, but it functions (and sometimes that's good enough!).

Thanks for the feedback chaps... I shall try to chip in with contributions to the site. Take it easy...
Re: Maximum no of rows in a list block [message #425563 is a reply to message #425417] Fri, 09 October 2009 12:04 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
True; sometimes it drives me mad when setting the ENABLED property to false and back to true requires setting some other properties as well (otherwise it just won't work as expected). I guess you've put it right: it's a feature.

Anyway: I'm glad you solved the problem, one way or another.
Re: Maximum no of rows in a list block [message #429568 is a reply to message #425563] Wed, 04 November 2009 09:54 Go to previous messageGo to next message
thalheim
Messages: 5
Registered: October 2009
Junior Member
In the spirit of sharing solutions, etc...

I had what I call a "eureka" moment... I ended up creating a blank canvas, which is slightly larger in size to the items on b_list and has the "fill" colour, of the main canvas.

Thus, instead of messing about with the properties of the items on b_list - which was causing me so much grief - I simply left them all displayed and enabled (as per their default properties). Then used the blank canvas, hiding and displaying it as required, to "cover" items and give the functionality I was after to the end user... Smile
Re: Maximum no of rows in a list block [message #429616 is a reply to message #429568] Wed, 04 November 2009 14:37 Go to previous message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Nice trick Smile
Previous Topic: Assigning a value to display item
Next Topic: Forms 6i - dynamic order by problem
Goto Forum:
  


Current Time: Sun Dec 04 10:31:38 CST 2016

Total time taken to generate the page: 0.12665 seconds