I want to change page number, I decided to create page as copy, after creation copy page, that page doesn't have same functionality like original page. All in page is same, dynamic action, process, sql query...
Why copied page doesn't have same functionality?
I hope I've explained well.
I tried to find similar question on stack, but I didn't find.
Thanks in advance
As far as I remember, older Apex versions (which one do you use?) would "ignore" page number change in PL/SQL units. For example, if your query used
select empno, ename
from emp
where deptno = :P1_DEPTNO
and you copied it to a new page (e.g. number 2), query would still be the same, referencing :P1_DEPTNO instead of :P2_DEPTNO.
Also, if the "original" page was called from some other page which passed some items' values to it, the "copied" page doesn't have that functionality - you'd have to manually modify the "caller" page and switch P1_ items to P2_.
Other than that ... I can't remember anything else. Generally speaking, it should work.
Related
I am creating form for search data in oracle forms 10g
when user select LOV from non-database field and press search button then non-database field goes null. I want field not null when button press
A screenshot would help; it is unclear where's that non-database field placed. If it is a tabular layout forum, is it placed within all the other fields? Or is it somewhere in a control, non-database block?
Anyway: here's how I'd do that.
First of all, if possible, avoid inventing your own searching algorithm. Forms is very good at doing such things by itself. Shortly:
enter query mode
enter search criteria (select it from a list of values; why not?)
execute query
absolutely no additional programming is necessary (apart from the LoV)
If, for some reason, you have to do it "your way":
put the non-database LoV field into a separate control block
WHEN-BUTTON-PRESSED should
use SET_BLOCK_PROPERTY and set database block's DEFAULT_WHERE (or, maybe even better, ONETIME_WHERE) to a selected LoV value
navigate to a database block (GO_BLOCK)
EXECUTE_QUERY
alternatively, WHEN-BUTTON-PRESSED would only EXECUTE_QUERY, but you'd use PRE-QUERY trigger on the database block that sets the searching criteria, for example :database_block.name := :control_block.lov_field;
As of your question:
it seems that the LoV field is part of the database block, and it gets cleared once you execute query. See if you can re-fill it using POST-QUERY trigger
Or, if it is not, check what the WHEN-BUTTON-PRESSED trigger is doing - maybe it clears it
See of what I wrote helps. If not, please, edit the question (your initial message) and provide additional information which would help us help you.
I'm creating a new package for Concrete 5 (5.4.0+). Inserting a new block works perfectly. But when I edit an existing block, it tries to INSERT again when I click 'save', instead of UPDATE.
The two fields on the database that affect this are bID and eID. Both are non-auto-incrementing INT(10) default none NOT NULL.
The values are passed in an associative array $args in the controller and I'm calling the parent save method with Parent::save($args);
Any help/input would be appreciated. PS: I have looked over this on the net and the C5 forums did turn up some stuff which I tried, mostly relating to the database fields, but I still get the above error. I don't want to overwrite the ADODB save() method if possible.
--- EDIT ---
Perhaps I'm looking at this all wrong. Let me say what I'm trying to achieve. I need the eID to remain 37 (for example) across multiple edits of the block. The bID can increment away AFAIC.
How do I get the eID to remain 37 on edit, but increment by 1 on creation of a new instance? Make sense?
A second table references the eID field, and edited instances of an entry on this table must have the same eID unless a new instance is created. Sry - clear as mud I know.
Are you saying you get a new instance of the block appearing on your page, rather than a new version of the existing one? I don't think the problem is with there being a new record inserted in your table, since new records are normally created when you edit a block. C5 keeps the older version of the block.
The custom blocks I've done have never required a call to the parent save method. You just need an edit form that collects the data and designates which database field it corresponds to, and the parent controller knows what to do with it when the form is submitted.
For example, if you have a text field in your block table called "firstname" that you are updating, you would add a line to your edit.php file like this:
<?php echo $form->text('firstname', $firstname, array('style' => 'width: 320px'));?>
My block editors contain little else than this, other than html/CSS stuff to add labels and make the form look better. The $form object takes care of everything else.
One thing that really helped me understand blocks and block controllers was to download and install the "designer content" add-on. It's free. You can use it to build some custom blocks, then look at the code it generates to perform various functions.
So I looked into the existing packages to duplicate this funcitonality and my question has evolved into this: PHP Concrete 5 Pass Variables to Add.php
Follow the rabbit ;)
Having some trouble getting this to work... I basically want the report to look similar to:
The way I remember doing this in the past was by creating "page groups" in the report wizard. However, I believe that was in VS05, and now the report wizard is very different in VS10. It now has column groups and row groups but no page groups, and I can't see how to get this to work without the wizard either. If tried looking for a tutorial or example but haven't had much luck. Also, the site 'gotreportviewer.com' is pretty terrible and has not been much help.
To create the effect of one record per page means you need to set a group element to the report. For instance assume you have a database table called "Login" and you wanted to group by a person's login name. Here is what you do:
First add a table to the report like so:
The table can be found in the "Toolbox" on the left hand side of VS2010. Once the table is added you will want to add a group to this table:
After this you will want to go to the properties of the group:
Here you simply can set a page break between each instance of a group, in addition, this will give you a "one record per page".
List of values, with multiple columns and multiple return values in Apex. It's a question i've seen around the web quite a few times, but i'm struggling with it aswell.
Coming from Oracle Forms, and now migrating forms to Apex, this is a feature i'm missing quite well. It also still baffles me a bit how enormously basic the built-in popup-lov is.
For example, right now i'm making some smaller forms, each having about 4 or 5 multirecord columns, for not much else than having 2 values linked up. Column 1: some value, used in sap for example, column 2: the id of a record in the oracle database (another table than the base table for the block). On column 2 there is an lov, with validate from list, and displays 3 columns, but also returns 3 columns. So you can choose a record from the lov, and automatically, the id will be filled in, aswell as the 'name' and 'description' for said id. Column 1 and column 2 form the base table of the block.
Now, in Apex, i'd loose this functionality by default. So for now, i've mostly coded the onchange event in javascript, and get the values with an ajax callback process. In the popup i concatenate the 3 columns. This however looks stupid (in my most humble opinion) when you want to force the user to pick a value from the lov ('Not Enterable, Show Display Value and Store Return Value'): the item will contain the concatenated value used in the lov, not just the id i'd much rather show - plus, i'll already have my other 2 fields filled in by the ajax callback.
It rather stings a bit to have to deal with this. The users are used to working with these old (headstart generated) forms, with just 2 enterable columns, one of which has an lov. Now they need to start working with this 'new tech', and even though there is some adjustment required, this area does feels a bit archaic at times!
So, i've made it work through an Ajax callback on the onchange event. So, when the value is changed through the lov, extra fields are filled up. This goes together with an after header process, after the automated row fetch, so the values are fetched when the page is loaded (or a user navigates the rows).
I've also written a custom solution, which requires me to create a page with a classic report on it with a search box. I then use this page in an iframe, and pop it up through a modal. When the user selects a record, i return the required returnvalue and a list of displayvalues. This i do through a bunch of javascript, which i've packed in a JS file, and actually requires quite little extra work to do on the pages: include the file on both, make an item with some post element text calling an 'open' procedure, and calling a select-and-close procedure on my lov page. I'm quite considering creating a small item typep plug-in, so i can more easily configure my calling item. Just a couple of buts: i've not actually used this in some forms already, i've engineered this in a testing application after getting frustrated with the standard tool. It would also require the client to maintain this javascript code + remember the config of the 2 items, let alone me writing a small plugin. So i'm hesitant to implement this.
TLDR: if you've been using Apex for a while, and maybe done some forms: how do you actually work with the popups. And if you've known forms: how did you deal with this change?
I'm still struggling - throw me a bone ;)
I haven't used it myself yet but I believe SkillBuilders Super LOV plug-in probably does what you need.
I have two tables, HELP_PROBLEMS and HELP_SOLUTIONS.
HELP_PROBLEMS has a number of different fields, including PROBLEM_ID, SOLUTION_ID, PROBLEM_DESC etc.
HELP_SOLUTIONS has just SOLUTION_ID and SOLUTION_DESC.
I'm trying to build form that when you view the edit form of a problem, you can add the solution in a form below it.
In my mind, when I hit the button Add Solution (submit), it creates the new row in HELP_SOLUTIONS, and adds the SOLUTION_ID to the current row in HELP_PROBLEMS. (and update a few other things but trying to keep this as basic as possible).
Is this at all possible? I thought the 'master form' might work but I couldn't seem to sort it out as planned.
Thanks,
C.
You can create a pl/sql block that inserts a value in two different tables.
create a page process and select pl/sql
then try something like
begin
--insert into help_problems
--insert into help_solutions
end;