Computation on same page

Hy All
i am new in htmldb and can not find a lot in documentation.
Here is my problem.
i got a mandatory field in a table which is the result of concatenation of other fields.
On my page, i want to put a button to calculate this field and redisplay the page without submitting the data to the table as they will be refused, as this field is not calculated yet.
I tried computation, processes ... each time i got he message that this field should have value, ie a submit is done BEFORE the field is calculated.
Sure this is simple, can someone help me ?
Thanks
Yann

Ron,
Do you really have tried to compute COLLECTION through Page Computation?
Please let me know, because I cannot see that there is a way of compute anthing but 3 kind of values declared in my first post. And collection cannot be declared in any of these items..
Am I missing something?
THX

Similar Messages

  • How to cause a button to compute a text field on the same page?

    I have a button called "Generate Hash" and I want to have it compute a text field and display it on the same page with the results of a simple sql query:
    select 'P'||substr(Sys_guid(),1,10) from dual;
    Is this a difficult thing to do?

    Hello Patrick,
    Nope - not hard at all. Create a Process on your page that says:
    :Pxxx_HASH_VALUE := 'P'||substr(Sys_guid(),1,10);
    Then in the Condition portion of the Process, Set the section labeled "When Button Pressed (Process After Submit When this Button is Pressed)" equal to the button you wish to use for the compute.
    Don

  • Smart forms- when i print a report it print main window data on same page

    hi,
    when i print a report it print main window data on same page .
    i.e. if data is more then one page then it shows data page wise on computer screen but when i print it print all data on same only one page by over wrriting .
    pl. help why it is happening
    i create page in page i set next page and in second page give first page.
    mukesh

    mukesh,
    what happened to this: smart form
    close that please.
    by the way,did you tried with what i suggested?
    lets say mainwindow in 1st page.
    copy the first page to second page.
    now.
    for 1st page: next page is : page2
    for page2: next page is also : page2

  • Multiple (updatable) details in the same page.

    Hello,
    I tried to put two updatable details in the same page and got the error
    "Updatable SQL Query already exists on page 11. You can only add one updatable SQL query per page. Select a different page"
    So having more than one updatable detail is not allowed in apex ?
    I have a master table with three details. Should I create one page for each one of them ?
    Thanks in advance
    Bye
    Nicola

    What you want to use are called collections. Here is a simple collection example:
    The process goes in 4 steps: gather the data, display the data, update based on user input, then write the changes. Each step requires it's own piece of code, but you can extend this out as far as you want. I have a complex form that has no less than a master table and 4 children I write to based on user input, so this can get as complex as you need. Let me know if anything doesn't make sense.
    First, create the basic dataset you are going to work with. This usually includes existing data + empty rows for input. Create a Procedure that fires BEFORE HEADER or AFTER HEADER but definitely BEFORE the first region.
    DECLARE
      v_id     NUMBER;
      var1     NUMBER;
      var2     NUMBER;
      var3     VARCHAR2(10);
      var4     VARCHAR2(8);
      cursor c_prepop is
      select KEY, col1, col2, col3, to_char(col4,'MMDDYYYY')
        from table1
        where ...;
      i         NUMBER;
      cntr      NUMBER := 5;  --sets the number of blank rows
    BEGIN
      OPEN c_prepop;
        LOOP
          FETCH c_prepop into v_id, var1, var2, var3, var4;
          EXIT WHEN c_prepop%NOTFOUND;
            APEX_COLLECTION.ADD_MEMBER(
            p_collection_name => 'MY_COLLECTION',
            p_c001 => v_id,  --Primary Key
            p_c002 => var1, --Number placeholder
            p_c003 => var2, --Number placeholder
            p_c004 => var3, --text placeholder
            p_c005 => var4 --Date placeholder
        END LOOP;
      CLOSE c_prepop;
      for i in 1..cntr loop
        APEX_COLLECTION.ADD_MEMBER(
            p_collection_name => 'MY_COLLECTION',
            p_c001 => 0, --designates this as a new record
            p_c002 => 0, --Number placeholder
            p_c003 => 0, --Number placeholder
            p_c004 => NULL, --text placeholder
            p_c005 => to_char(SYSDATE,'MMDDYYYY') --Date placeholder
      end loop;
    END;Now I have a collection populated with rows I can use. In this example I have 2 NUMBERS, a TEXT value, and a DATE value stored as text. Collections can't store DATE datatypes, so you have to cast it to text and play with it that way. The reason is because the user is going to see and manipulate text - not a DATE datatype. If you are using this as part of a master/detail form, make sure that your SQL to grab the detail is limited to just the related data.
    Now build the form/report region so your users can see/manipulate the data. Here is a sample query:
    SELECT rownum, apex_item.hidden(1, c001),  --Key ID
         apex_item.text(2, c002, 8, 8) VALUE1,
         apex_item.text(3, c003, 3, 3) VALUE2,
         apex_item.text(4, c004, 8, 8) VALUE3,
         apex_item.date_popup(5, null,c005,'MMDDYYYY',10,10) MY_DATE
    FROM APEX_COLLECTIONS
    WHERE COLLECTION_NAME = 'MY_COLLECTION'This will be a report just like an SQL report - you're just pulling the data from the collection. You can still apply the nice formatting, naming, sorting, etc. of a standard report. In the report the user will have 3 "text" values and one Date with Date Picker. You can change the format, just make sure to change it in all four procedures.
    What is critical to note here are the numbers that come right before the column names. These numbers become identifiers in the array used to capture the data. What APEX does is creates an array of up to 50 items it designates as F01-F50. The F is static, but the number following it corresponds to the number in your report declaration above, ie, F01 will contain the primary key value, F02 will contain the first numeric value, etc. While not strictly necessary, it is good practice to assign these values so you don't have to guess.
    One more note: I try to align the c00x values from the columns in the collection with the F0X values in the array to keep myself straight, but they are separate values that do NOT have to match. If you have an application you think might get expanded on, you can leave gaps wherever you want. Keep in mind, however, that you only have 50 array columns to use for data input. That's the limit of the F0X array even though a collection may have up to 1000 values.
    Now you need a way to capture user input. I like to create this as a BEFORE COMPUTATIONS/VALIDATIONS procedure that way the user can see what they changed (even if it is wrong). Use the Validations to catch mistakes.
    declare
      j pls_integer := 0;
    begin
    for j1 in (
      select seq_id from apex_collections
      where collection_name = 'MY_COLLECTION'
      order by seq_id) loop
      j := j+1;
      --VAL1 (number)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>2,p_attr_value=>wwv_flow.g_f02(j));
      --VAL2 (number)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>3,p_attr_value=>wwv_flow.g_f03(j));
      --VAL3 (text)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>4,p_attr_value=>wwv_flow.g_f04(j));
      --VAL4 (Date)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>5,p_attr_value=>wwv_flow.g_f05(j));
    end loop;
    end;Clear as mud? Walk through it slowly. The syntax tells APEX which Collection (p_collection_name), then which row (p_seq), then which column/attribute (p_attr_number) to update with which value (wwv_flow.g_f0X(j)). The attribute number is the column number from the collection without the "c" in front (ie c004 in the collection = attribute 4).
    The last one is your procedure to write the changes to the Database. This one should be a procedure that fires AFTER COMPUTATIONS AND VALIDATIONS. It uses that hidden KEY value to determine whether the row exists and needs to be updated, or new and needs to be inserted.
    declare
    begin
      --Get records from Collection
      for y in (select TO_NUMBER(c001) x_key, TO_NUMBER(c002) x_1,
                 TO_NUMBER(c003) x_2,
                 c004 x_3,
                 TO_DATE(c005,'MMDDYYYY') x_dt
               FROM APEX_COLLECTIONS
               WHERE COLLECTION_NAME = 'MY_COLLECTION') loop
        if y.x_key = 0 then  --New record
            insert into MY_TABLE (KEY_ID, COL1,
                COL2, COL3, COL4, COL5)
              values (SEQ_MY_TABLE.nextval, y.x_1,
                  y.x_2, y.x_3, y.x_4, y.x_dt);
        elsif y.x_key > 0 then  --Existing record
            update MY_TABLE set COL1=y.x_1, COL2=y.x_2,
                 COL3=y.x_3, COL4=y.x_4, COL5=y.x_dt
             where KEY_ID = y.x_key;
        else
          --THROW ERROR CONDITION
        end if;
      end loop;
    end;Now I usually include something to distinguish the empty new rows from the full new rows, but for simplicity I'm not including it here.
    Anyway, this works very well and allows me complete control over what I display on the screen and where all the data goes. I suggest using the APEX forms where you can, but for complex situations, this works nicely. Let me know if you need further clarifications.

  • Calling a PL/SQL Procedure from button and then return to same page

    I have a button called "Process" that I want to call the database stored procedure "BUILD_WORKDAYS" with parameters P14_PROCESS_YEAR as an input parameter. I have the button on the page but is this a PL/SQL Page Process or a PL/SQL Branch? I have tried a number of combination but don't seem to be able to get the database procedure to execute. What should the syntax be?
    Thanks

    "I have a button called "Process" that I want to call the database stored procedure "BUILD_WORKDAYS" with parameters P14_PROCESS_YEAR as an input parameter"
    Assuming you are starting with an empty Apex page:
    1) Create a region of some type or other, say HTML.
    2) Create a button of type "Create a button in region position" in this region. Sounds like you've already done this and called it PROCESS.
    3) Create a process of type PL/SQL, On Submit After Computations and Validations.
    4) Call it "Execute BUILD_WORKDAYS" (or whatever you like)
    5) The PL/SQL for the process is:
    BUILD_WORKDAYS(:P14_PROCESS_YEAR);
    6) Specify a success and failure message.
    7) In the final step of the Create Page Process wizard, select your button from the "When button pressed" select list.
    8) Then create an unconditional branch branching to the same page.
    That should be it.
    Andy

  • How to deal with the checkbox columns in the two reports on the same page

    Hi,
    I have 2 reports having checkbox column in the same page. Now how can i differentiate between these 2 checkboxes column and based on them the values in the reports ,while i have to do some processe based on these reports using checkboxes.
    Thnks in adv.

    I just got a new computer and transfered my audio files to the new computer. Itunes made multiple copies of all my files too. I am really hoping there is an efficient way to fix this problem because I have way too many files to go through one at a time.
    Thanks

  • How to share the same QUERY among report, chart on the same page? and more

    Dear HTMLDB experts,
    I am absolute rookie to this tool, so I have some questions need you all's help.
    (1)
    When I build a page with a spread sheet and a chart on the same page, they all use the same query to get the data. However, I have to type in the SQL twice in spread sheet(report region) and chart's attribute sections. It seems so dumb, does it really run the same query twice, is there a way to share the same query?
    i.e. SELECT name, timestamp, value FROM foo WHERE name = :P1_NAME? (by the way, is :P1_NAME case sensitive?)
    (2)
    In the same chart, if I have two series from two columns of the same table, I have to write 2 queries, one
    select null, timestamp, value1 from same_table
    and
    select null, timestamp, value2 from same_table
    Is it possible to use one query: select timestamp, value1, value2 from same_table and define the series on two value columns of this single query? It's really no point to run two queris.
    (3)
    In a chart, when the query has ORDER by clause, it seems the chart is not showing up.
    So instead of using the query below
    SELECT null, to_char(ts,'mmdd') ts, value
    FROM same_table
    WHERE ts >= TRUNC(SYSDATE) - :P2_DAYSAGO - 1
    AND name = :P1_NAME
    ORDER BY ts
    I have to use a walkaround query
    SELECT null, ts, used
    FROM
    SELECT null, to_char(ts,'mmdd') ts, value
    FROM same_table
    WHERE ts >= TRUNC(SYSDATE) - :P2_DAYSAGO - 1
    AND name = :P1_NAME
    ORDER BY ts
    Further more, it seems :P1_NAME in the same subquery is not working for the chart, i get xml parsing errors in SVGviewer, however the same query works for the spread sheet area, I am really puzzeled. Not sure whether it's dumb tool or dumb me :-)
    Appreciate your help!
    Jianhui

    <quote>
    Further more, it seems :P1_NAME in the same subquery is not working for the chart, i get xml parsing errors in SVGviewer, however the same query works for the spread sheet area, I am really puzzeled. Not sure whether it's dumb tool or dumb me :-)
    </quote>
    For this particular issue, I found out that neither is the tool dumb nor is me. It's SVGViewer messed up with the firefox browser, after I rebooted the computer this morning, problem is gone. I didnt reboot after I copied SVGViewer dll and zip file to firefox plugin directory yesterday. Never had that pain with IE and Netscape, oh well :-). So please ignore this section, however other questions are still unsolved puzzles for me. Thank you all if you can share some light on those questions.

  • Multiple branches to the same page

    A few questions about branches...
    1. Having a branch back to the same page with a 'when button pressed=Submit', another branch back to the same page with some other button-press condition, etc are all redundant, right?
    It is sufficient to have just one unconditional branch back to the same page, right?
    2. What is the difference between branch type 'branch to page or url' and simply 'branch to page'? Does the former cover the latter, so why do we need two types?
    3. Anyway, when I choose the latter, there is a checkbox below the page number for 'branch to page using redirect'. What does this mean?
    4. I have always seen the 'On submit: after processing' branch point being used. When would the other branch points be used?
    Thanks

    Vikas,
    1. No, they are not "all redundant" nor is any
    individual one. What if your page is submitted in
    some way other than by one of the buttons evaluated
    in the branch definitions?
    Right, thats why I said "It is sufficient to have just one unconditional branch back to the same page, right?". Why is it not sufficient to have just 1 unconditional branch? That would cover all the cases. Each page process can then check for whatever conditions it needs?Ummm, you say "Right" to my rebuttal and then you restate your original premise -- that logic eludes me. Let me offer this: Ponder my question, exactly as I wrote it, and consider self-submitting items, tabs, javascript, fields that submit the page when you hit Enter, etc., then it might make more sense. I don't think I can help you with that last part "Each page process..." even if it were an actual question.
    2. A Branch to Page (aka direct branch) calls the
    target page directly from accept processing without
    using a URL redirect. The other type redirects.
    Maybe this has nothing to do with HTMLDB, but whats the difference between "directly from accept processing" and "redirect"?Fair question. When you submit a page, wwv_flow.accept processes it. When it finishes, it evaluates the branching logic to determine what page you see next and then either redirects to that page (to f?p=...) or calls wwv_flow.show in the same database session (direct branch).
    3. That's a way of creating most branches as URL
    redirect branches when the developer isn't paying
    attention. Uncheck the box to "really" create a
    direct branch.
    You seem to be implying that a "direct branch" is not really desirable in most cases? Why? (I guess your answer to my question above will clear this up for me)Well, they're usually not the best choice. You end up with "wwv_flow.accept" in the browser location window after the branch and using the browser's back button to go back to those requests gives you that annoying "page contains POSTDATA" message. Those branches can be useful if you want to stay in the same database session for page processing (after submit) and the subsequent page view, such as in the case of inline validation errors where package state is maintained. The checkbox (default checked) technique is to require developers to really think about a choice that may have been reflexive.
    4. Please read the User's Guide.
    I did. Lets take them 1 by one
    a. On submit, before computation: The docs say this is to be used for a Cancel button. But wouldnt a javascript:document.form.reset() do the same thing?A Cancel button that submits the page does just that, it submits the page, allowing session state to be saved and any logic on the page to be performed before the correct branch is taken. You ask whether that javascript would do the same thing. The same thing as what, the Cancel button? No!
    b. on load before header: "...displays another page instead of the current page...". But then why wouldnt I just create a branch of some other branch point with that "another page number" in the first place?Because sometimes it's better for page X to decide to go to page Y before doing much of anything than for N callers of page X to make the same determination.
    I guess I am having difficulty understanding the concept of a "branch point". As you said elsewhere, a branch doesnt contain any logic, it doesnt call anything, it just branches to some page/url.Where did I say that?
    So, why have all these different branch points? What advantage does having this fine degree of control provide us? (as opposed to always 'on submit: after processing'?)Your proposal about reviewing various branch points was "Lets take them 1 by one", but then you skipped three of them. Please read the entire section on branching, create pages with all possible types of branches and a variety of buttons and conditions, experiment extensively with them and let us know if it's still unclear. I think you'll find, over time, that all features
    in HTML DB are there for a good reason. The developers found a need for them developing real applications. Where capabilities were missing, features were invented and added,
    where features seemed useless, they were dropped/deprecated. The tool you see today has been evolving for years. I think it's unreasonable to expect to be able to
    appreciate the value of every single feature until you've been using HTML DB for a couple of years.
    Scott

  • Multiple Galleria Photo Galleries on same page

    I'm trying to use multiple BC Photo Galleries and Galleria to display a project gallery of images on the same page.  Also, I'm a beginer at using Javascript and JQuery, so this might be a fairly simple deal, but my lack of experience is probably getting in the way.
    There are multiple sections to this project gallery;  landscaping, hardscapes, night lighting, pools, etc.  I'd like the user to be able to click on one of the gallery sections and the Photo Gallery switches out to the new selected gallery, so that only one gallery is showing at time, but they stay on the same html page.
    I need help with the following:
    1. When you first visit the page, I only want the first gallery to show up.  Then switch out with the others when you click on the other sections. Is this possible with Galleria, because of the way it computes the measurements of the stage within 5 sec?
    2. Not sure how to fix this error: "Init failed: Gallery instance already initialized".  I know this is happening because I'm running the init function for each project gallery.  Is there a better way to do this?
    This is the page where you can see it:
    http://greenmeadows.carmediadesign.com/project-gallery.htm
    Thanks for any assistance you can give!

    Hi
    Try using something like this http://jqueryui.com/tabs/ to place each separate gallery in its own div
    As for the error, where exactly are you getting that?
    Kind Regards,
    Alex

  • Why can't Primary and Sub accounts be accessed on the same page?

    I have a Primary email account and also a sub account.  I normally use Windows Mail to access my email.  In Windows Mail, I can read emails sent to either account, and can also send from either account.
    The only time I go to the Webmail page is when I am traveling and can't access my home computer.  In Verizon Webmail, I can only check the account I log in with.  It's very annoying and time consuming to log in, check one account, sign out, and then log in to check the other account.  By the way I use the same password for both accounts.  Is there anyway that this can be changed?  It should at least give us the option to add a sub account on the same page as the primary account. 

    If you are wanting the messages to come to the same account, an alias would serve you better than a sub account.
    If you really want all of the mail to be in one inbox, set your sub account up in the primary account to be accessed via pop3, or set forwarding on the sub to the primary. That would cause all of your mail to be accessible via the priamry login, but you would still have to log in with the sub to send from that address.
    If you need help finding these settings, please let me know.
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.
    "All knowledge is worth having."

  • How is when a button pressed a report will come to the same page !!!

    Hi all,
    I wonder that is it possible to bring a report to the page as a region but only when a button pressed in apex .When ı clicked the go button for example ı want to list a report in the same page.
    but I dont know how .If is this possible can you explain me please.I need help!
    Thanks!

    Create your report in a region as normal.
    Create a second region and in this region create an item eg p171_item.
    In the same region create 2 buttons
    Get Report and Reset (branching back to same page).
    Create 2 page processes (PLSQL) on submit after computations
    1. GET REPORT
    DECLARE
    v_item number;
    Begin
    select 1 into v_item from dual;
    :P171_ITEM := v_item;
    end;
    2.RESET
    DECLARE
    v_item number;
    Begin
    select 2 into v_item from dual;
    :P171_ITEM := v_item;
    end;
    Tie the processes to the buttons.
    On your report region put a condition
    PL_SQL RETURNING BOOLEAN
    IF :P171_ITEM = 1 THEN
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    END IF;
    Now by pressing the buttons the report region is opened and closed.
    Now hide P171_ITEM.
    Gus

  • Seperate column numbers for the same page.

    I was wondering how to make one part of a page have like 6 columns, and a different section have 3 columns, all on the same page. I know how to change column numbers but not twice on the same page. I want to be able to do it like it does in the non-profit newsletter template. Open that template and click show layout to see what I mean. I want to do that except on a blank page.
    PowerBook G4   Mac OS X (10.4.4)   My.Computer.Ownz.

    No problem. I had never used the contextual menu to insert a break. When I checked last night, the contextual menu didn't say "break" after the choices, this morning it does. But, I'm finding using the contextual menu to be very "finicky." It won't let me insert a break in the middle of a line & placing the cursor at the end of a line & right-clicking selects the return character & has a check mark next to paragraph break in the contextual menu. It let's me change the character to another. I think the contextual menu would be very helpful to determine what kind of break is in a template or to change a bread from one type to another, but I'll stick with using the Insert menu.
    Peggy

  • Safari don't open same pages

    hi everyone,
           Sometimes i try to connect same web pages like http://www.ije.ir/articles/mypapers/ but safari says same error like "couldn't load the page because you may not connect to internet". At the same time i try to open the same page with another web browser and the the page is opened.
    after a half an hour safari is able to open it. it happens a lot. even it happened with youtube. when i got a error tring to open a video with safari, but at the same time another webbrowser can open it. after i reflesh four or five times or wait 5-10 min. then safari is able to open the same video.
    Do you have any idea what's wrong with my mac?

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a Fusion Drive or a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • WHEN I LOGIN AS DIFFERENT USER, IT TAKES ME TO THE SAME PAGE WHERE THE PREV

    Hu Gurus,
    I log in to portal as user1 and go to a page and then log out of the portal. Then I try to login as user2, it takes me to the same page where the previous user was. It looks like it caches the page information. How can I avoid this. Please post a reply if you have some suggestions.
    Thanks
    Raj
    ----------

    Thanks for checking it, Jason. Yes, the cache settings are for 'Every visit to page'. That was the first thing I thought of. I have a feeling the problem has to do with a cache setting somewhere in our installation. For example, I'm still plagued with a few user accounts returning errors when I try to log in. The users aren't logged in, but when I click "Login" from the Portal Builder page, I see the same error...it's not even letting me get to a login screen. Thanks for all the help. It's great to get some feedback. In the meantime, we'll continue to track it down here.
    Mary

  • How can i display all the Coloumns (Key Figures) in the Report's same page

    Hi All,
    I am currently working on the BI 7.0 reporting. In the BEx Query Designer report, I am having 13 coloumns (7 Key figures and 6 Formulas) in the report. It is now displaying 10 coloumns in the First page of report. The other 3 coloumns can be seen by clicking on the next page. But the requirement is to see coloumns in the SAME PAGE.
    Are there any settings OR any other thing in the Query Designer, which can enable me to see all the coloumns on SAME page. The users are not interested in scrolling next page for 3 coloumns.
    Appreciates the Quick help/Response, please.
    Regards
    Ramana

    In Web Application Designer, for the properties of your analysis webitem under the Paging category, change parameter 'Number of Data Columns Displayed at Once' (BLOCK_COLUMNS_SIZE) to 0.  This will make all columns show instead of paginating as it is doing now.

Maybe you are looking for