Hi Ralph, did you explicitly create a value for f01 as per documentation APEX_ITEM..
I struggled with this until I explicitly created a hidden column and concatenated it to another column using APEX_ITEM.HiDDEN(1,ID)||col2.. Just trying to use the column on its own didn't work..
my syntax was
Then your count should match the records on the screen...
Hi Richard, thanks for getting back to me.
I tried your suggestion, however no luck. The snippet from the sql used as the Region Source is now.
APEX_ITEM.HIDDEN(1,b.subject_id)||APEX_ITEM.TEXT(2,b.subject_name) as subject_name
which causes the subject_name to be displayed as
<input type="hidden" name="f01" value="41" /><input type="text" name="f02" size="20" maxlength="2000" value="Confucious" />
and the code that references the count is a debug line in a plsql dynamic action:
Which is still reporting 0
Is there some way that the dynamic action is is a different context to the report region?
This is my Dynamic Action, triggered by a button push... In this example gets only checked checkbox items.. I think, (but you will have to try ), to get all of the array values, remove the( .filter(":checked") )
Then create an onDemand PL/SQL Process.. which matches the process being called above..
for i in 1 .. apex_application.g_f01.count
delete from bri_recon where bank_stmt_id = apex_application.g_f01(i);
Hope this helps..
Still no joy. It's driving me potty.
So I started a new page, with a very simple basic 2 column report. The source of which is:
select subject_id, APEX_ITEM.HIDDEN(1,b.subject_id)||APEX_ITEM.TEXT(2,b.subject_name) as subject_name from subjects b.
that looks like this:
<input type="hidden" name="f01" value="131" /><input type="text" name="f02" size="20" maxlength="2000" value="VICTOR" />, so I would have though that f01 reference is correct.
Do you have any more ideas. I have a feeling I don't grasp something fundamental....
Hi Ralph, I created a simple working test on APEX.. go to workspace VRS login test/test application: 291.. check page 5.. I'm not using sys_utl.log, but Im populating a page item..
Fire the button.. It will invoke the DA, and ajax process.. The page item doesn't get actually populated until a reload, but if you check the session for that item after you hit the button, you will see that the item is set with the count of the records...
Apex collections are used for tabular forms. Most columns are then stored inside the collection.
Afaik classical reports do not use apex collections. Therefore you can't reference or count on the collection directly.
There are ways to have a report use collections too. The easiest would probably be to use the wizard to create a tabular form and disable all the fields. Although disabling them, might remove them from the collection. I didn't test this yet.
Maybe you can tell us, what you want to do with the information.
Assuming the count returns that 23,456 rows are in the collection. Why is that info important to you?
Yes I am probably trying to do something fundamentally wrong. Let me explain what I want to do.
I have a classic report which enables the user to paginate through the result set. I also have a chart that I produce on the same page that reflects the items in the report (not the same data, but data pertinent to those items). So if the report is showing 6 lines (which 6 lines is controlled by the user by pagination), each has an ID, its those id's that I need to access before refreshing the chart (I'm simply using the count to iterate through them). The chart is produced from custom xml that is generated by a stored function. This function takes an array of IDs as its input.
Hence what I'm currently trying to do when the report area is refreshed by user pagination is to fire a pls/sql dynamic action that builds an array of the ID's, passes this array to a function that regenerates the XML for the chart, then redraws the chart. If anybody has a better approach then please share...I'm only in week two of apex development!
I have had a look at that, tried to edit it to make it similar to my situation, but couldn't. However what I would have done to change it to be like mine is to limit the number of rows in the report to 5 (so that pagination is enabled), then changed the triggering event from your button click, to a "refresh framework event" so that the Dynamic action would fire automatically after the user paginated, I thin this is where the problem lies.
Hi Ralph, I see what you are trying to do... I changed my report.. Firstly I gave my report a static ID (Attrributes -> static ID. (I called it MyReport ) then I changed my Dynamic Action to fire :
Selection Type: DOM Object
DOM Object: MyReport
Ive still the alert on my DA, so each time I click to move to the next set of retrieved rows it fires. each time I see 15 Rows in my session as the value.. When it got to the last set, there were 12 rows and the session value was 12...
Not sure why you cannot edit my page. test/test has developer privileges...
Well. I can see your one is working. Mine, not so much. I created a new page, copying exactly what you had (changes of table and column names in the query). The only thing that is different is the Template of the report where you have "standard region" and I have "reports region"...I don't have the option for a "standard region". Though when I had it as "Blank region" the dynamic event refused to fire at all...
But alas the .count is coming back as 0 .. still.
Now a big difference is that the actual output in the report for you looks perfect where you have concatenated the apex_item.hidden. Mine however is full of the tags. eg
<input type="hidden" name="f01" value="261" />H
Query source is
apex_item.hidden(1,subject_id)||subject_type as subject_type,
Which is generated from this query. So is this likely to be something to do with it? I dont know how to get these hidden tags not to display. Maybe its to do with the report region template...