Model of how APEX handles data (values)?

Reference {thread:id=2486655}
I'm trying to get a model of how APEX handles data (values). There are several places(?) that data (values) can exist. Or so it seems. I'm trying to understand how these work -- to put all the pieces together.
Question:
A) Where data can be?
1) In the database
2) In the session
3) Rendered -- and hence displayed on the screen, if a displayed value -- but not in the session
4) In perhaps(?) some working memory pool(?) but different from the page rendered values I see on the screen?
5) Other?
Why do I think this is relevant?
Question:
B) If there are rendered values and session values different from the rendered values, then when code executes, which of these values (rendered or session) is it executing against?
And maybe the answer is, "You don't understand what's going on." Yes, "Exactly!" Hence the question.
Best wishes,
Howard

Howard (DBA in Training) wrote:
I'm putting this together now. For example:
I set the value of a Page Item (say, :P2_DATA) to "BEFORE" in a Before Region process and change it to "AFTER" in an After Region Process. 'BEFORE' was displayed on the screen but 'AFTER' was in the session state. So I see that PL/SQL changes these values in the session state. But it doesn't "go back" to change the HTML after the region has been rendered -- hence we see BEFORE shown on the screen. (I'll have to think about what a Dynamic Action does.)
Also, if a page item has a default value, say 'DEFAULT' then that value doesn't get into the session state. At least, not with my current settings. Oh, that explains a lot of confusion!! I suppose there's a logical reason for this but who would expect default values to be differently from other PL/SQL operations on the item?
Questions:
1) So why does a default value not get put into the session state?Several reasons, among them:
*1. When/why is the value required?* Region items (and thus their source and default values) are rendered in region/item sequence order. The item's source/default value would therefore not be available in session state until it's rendering point. This is frequently later in page show processing than the value is actually required, such as the common use case of including a data value in the page or region title. Setting the value in a Before Header/Regions computation or process makes it available as required before the item is actually rendered.
*2. The rendered page might not be submitted.* Default values are typically set when a page will create a new row. Consider the situation where the user clicks a "Create" button and is presented with an order entry form containing several default values. They then decide they don't want to create a new order after all, and navigate away from the form page via some mechanism that uses a redirect rather than a submit (such as a default "Cancel" button). This means that no page submit processing is performed, and generally that no session state management is performed. If the default values were set in session state, the order entry page would contain the default values for the non-existent order despite the user never submitting it. This may have unwanted side-effects if these values are referenced elsewhere in the application, and therefore would require extra session state management to be built into the application.
*3. A rendered item might not be submitted with the page.* Per the HTML specification, the values of disabled controls unchecked checkboxes are not POSTed on page submit. Consider a situation where a checkbox item is set with several default values, but the application requires that the checkboxes be cleared and disabled by a dynamic action if the user chooses certain options from a select list. In this case, on page submission no values are submitted into session state for the checkbox item. If the defaults had been set in session state, then the application would be in an inconsistent state, with the user-selected option indicating that none of the checkboxes were checked, but with session state holding values showing that they were. This would require additional processing to ensure that the application's state was consistent before saving it to the database.<sup>1</sup>
2 & 3 are particularly significant in basic wizard-generated applications. Doing things in this way, the wizard-generated DML and navigation "just works", without the need for additional session state management.
2) Is there a Page Item setting that causes the default value to be saved to the session state?No. Hopefully the explanations above provide sufficient reason to show why this is genearlly not desirable. On the rare occasions when it is required, set the session state value using a computation or process.
<sup>1</sup> There are other reasons&mdash;mainly security related&mdash;that make it good practice to perform such checks in more complex and internet-facing applications anyway.

Similar Messages

  • HOW TO HANDLE MULTIPLE VALUES IN BDC FOR A PARTICULAR FIELD.

    I THINK IT IS HANDLING OF TABLE CONTROLS IN BDC
    PLEASE LET KNOW WHETHER THESE TWO ARE SAME CONCEPT OR NOT
    HOW TO HANDLE TABLE CONTROLS IN BDC
    Moderator message - Please do not use all caps. Please do not ask interview questions -  post locked
    Edited by: Rob Burbank on Jun 26, 2009 10:02 AM

    Hi,
    To handle table control in BDC you will have to enter at least one record in the table control and there after use the index number to increment to the next line item.
    Say you run a recording for a transaction which has a table control (ME21), here after you have completed the recording, you'll see the code which will have sometjing like <fieldname>(01) and the entered value. that valeu has been entered as the first line item (01 being the index).
    You will have to replace the hard coded line item index with a variable and inside a loop increment the item index. Once you reach the maximum allowed line items on your screen juct press the pagedown button (or insert new row) and reset the index to 1.
    Following is a code snippet I used while uploading data for ME31K (vendor contract). It is not the complete code but does show how your code needs to be changed with using index for line items.
    Here we assumne that the maximun number of lines displayed at a time on the screen is 14.
    << Unformatable code removed >>
    Hope this helps.
    Regards,
    Sachin
    Edited by: Rob Burbank on Jun 26, 2009 10:03 AM

  • Multiple pages, how ApEx handle it? (iframe)

    Hello,
    I have a application used by many teams in my company. This application have a stantard layout for all the teams and now I´m developing a personalized layout for each team.
    How it will work?
    The application will have a page (main page) with some stantard fields, and a iframe with the personalized fields. The main page will call the page (iframe) correspondent to each team dynamically, this page is also a ApEx page.
    Page 1
    [Common layout]
    [Team A page 2 (iframe)] or [Team B page 3 (iframe)] or [Team XPTO page N (iframe)]
    [Common layout]
    My question is: Can I use iframe in ApEx without problems? I saw some topics that said to dont use iframes, but they dont explain why. How ApEx will handle those pages?
    Thanks in advance,
    Felipe

    Hi,
    I think i coldn´t explain what I´m trying to do, and my picture doesn´t help either! (Well, it´s already done :C)
    Sorry for that guys, let me try to be more specific:
    I´m developing a issue tracker system. That application is used by many teams in my company. Every team use the same interface. I made some authorization schemes, and other DB logics to make the data accessible only for those who can access that data, like, Team A cannont access/see/modify Team B data.
    The new chalenge: Some teams need aditional/different fields.
    What we already have, for example:
    Page "BUGS"
    [Bug_ID]
    [Creation_TS] [LastDiffe_TS]
    [Product][Component]
    [Reporter][Assigned_TO]
    [Summary]
    [Description]
    [Add comments]
    [Choose STATUS]
    (Submit)
    What we need?
    Page "BUGS" that Team A will see
    [Bug_ID]
    [Creation_TS] [LastDiffe_TS]
    [Product][Component]
    [Reporter][Assigned_TO]
    [Summary]
    [Description]
    [Source][Environment]
    [Contact][Phone][Location][Email]
    [Problem ID][Probaly Solucion]
    [...] <-- here we have anything that Team judge to be necessary to have here
    [Add comments]
    [Choose STATUS]
    (Submit)
    Page "BUGS" that Team B will see
    [Bug_ID]
    [Creation_TS] [LastDiffe_TS]
    [Product][Component]
    [Reporter][Assigned_TO]
    [Summary]
    [Description]
    [Problem root][Afected subsystems]
    [Solution Roadmap]
    [Estimed time to solution]
    [Responsible][Detected in version]
    [Correction PKG ID]
    [...] <-- here we have anything that Team judge to be necessary to have here
    [Add comments]
    [Choose STATUS]
    (Submit)
    Resuming:
    [Bug_ID]
    [Creation_TS] [LastDiffe_TS]
    [Product][Component]
    [Reporter][Assigned_TO]
    [Summary]
    [Description]
    [Dynamical content using iFrames]
    [Add comments]
    [Choose STATUS]
    (Submit)
    That´s what I was trying to show in that picture. Do you understand now? :)
    Thanks in advance,
    Felipe

  • How to handle null values in RTF templates

    Hi - I have two groups in a report for different SQL and two formulas for each group, CF_ELE_CNT and CF_ELE_CNT1. In the template I use the below code to print or not print a section.
    <?if:number(CF_ELE_CNT +CF_ELE_CNT1) >0?>    
    The problem is when there is no data in the second group its not creating the XML tag for CF_ELE_CNT1, though CF_ELE_CNT has 13, it still does not print that partucular section. If I remove CF_ELE_CNT1 from the condition it works fine. I was wondering how to handle this.
    Any help would be appreciated!!
    Thanks,
    Rav

    Hey Rav,
    You can add a check to identify it the element/tag is present or not
    <?if:(CF_ELE_CNT1)?> will give true, if the element is present otherwise falsesince you are adding the two elements, you have to add a or condition.
    <?if:(CF_ELE_CNT and number(CF_ELE_CNT) >0 ) or ( CF_ELE_CNT1 and CF_ELE_CNT1 >0)?>

  • How to pass date value to an UDF

    Hi,
    I am working in SDK UI. I have created a form. In this form there is a edit text box. I have to pass a date value to that object. I have taken a variable and pass a date value in "yyyy/mm/dd" format. When I am assign this variable to the object to pass the date value to that object then I am getting an error. The error is "Unable to cast object of type 'system.string' to 'system.IFormatProvider' ".
    I have written the code like this :------>
    Dim AtenDate As String   
    AtenDate = '2007/08/01'    ' format "yyyy/mm/dd"
    Dim txtEditDt As SAPbouiCOM.EditText
    oItem = oForm.Items.Item("11")
    txtEditDt = oItem.Specific
    txtEditDt.String = AtenDate.ToString("dd/MM/yyyy")
    After the last line the error is getting fire.
    Please help me how I can pass the date value to that object.
    Please help me. It is very urgent.

    Date and Double conversion is really a confusing thing in B1-SDK programming in the beginning.
    But once you got it it's okay.
    When working with date-time and doubles (System and SBO-Price/SBO-Quantity),  you should always take care about the language of...
    ...system (windows)
    ...SBO User Interface
    These two formats could make trouble when the programming has been made only for a specific configuration of these two.
    The third format for SDK-Programming is
    ...the SBO-DB-Format, which is language-independent and always a String
    Here are some rules:
    <b>EditText.String</b> ALWAYS returns the value you see on the SBO GUI. It depends on the SBO Date, Price etc.-Format the USER has configured in the Administration. Consider that the user has (for example) the possibility to choose a "#" (or whatever) as decimal-seperator. Direct (implicit) conversion of such a string to a double will fail at the latest now.
    The savest way to get a .NET-Double or DateTime- Value from EditText.String are the conversion methods of  SBOBobs-Object (see SDK-help -> BoBridge, Format_MoneyToString...etc.).
    I think it's a good idea to write some wrapper functions for that methods, cause they always need a recordset which blows up the code too much.
    <b>EditText.Value</b> always (system/sbo-language independent) returns the value as a String in DB-Format (Double as "12345.126700" and date as "20070930".
    For that you must asure that the EditText is bounded to a format-corresponding datasource. Price, Quantitiy.... if you need a double.
    If your "price"-field would be bound to ShortText and the user wants (assuming the example from above) a "#" for decimal-point, then a GUI-seen value like "12,421#12" is also returned as "12,421#12" by EditText.Value. But If bound to Price-DataSource it's "12421.120000"
    => So always do a DataBind to the Data - Type which is needed is recommended for this to work!
    In my case EditText.String and -Value is mostly (only...? needed for B1-System-Forms where using of DataSources is restricted.
    The prefered way of read/write values is the
    <b>UserDataSource.ValueEx and DBDataSource.GetValue/SetValue</b>-method. It's also always in DB-Format as EditText.Value before, but gives much more performance.
    Once you got some conversion-functions for "DB-Format-String" to ".NET-DataType" and vice verca (I've defined some .NET - System.Globalization.XXXFormatInfo-Objects for that) all of your problems are things of the past
    Regards,
    Roland
    null
    Message was edited by:
            Roland Toschek
    Edited by: Roland Toschek on Jan 22, 2008 5:32 PM
    Trying to clarify a sentence

  • How to validate Date value in Text Column

    Hi All,
    I have entered DATE value in text item field(Char Data Type), Now how can i validate, the entered date is valid or not.
    Thanks in advance.

    Well, the easiest way would be to make the item of datatype DATE.
    Another possibility is to try to convert the given value to a date in the WHEN-VALIDATE-ITEM-trigger, like
    DECLARE
      dt DATE;
    BEGIN
      dt:=TO_DATE(:BLOCK.ITEM);
      -- if code comes here, the date is valid
    EXCEPTION
      WHEN OTHERS THEN
        -- seems to be no valid date
        MESSAGE('Error');
        RAISE FORM_TRIGGER_FAILURE;
    END;Edited by: Andreas Weiden on 19.12.2010 12:23

  • How to insert date value into oracle?

    hi,
    iam reading date from xml using vb.net and inserting it into oracle table.
    the date value in xml file is in the format of "01012003".
    i want to insert into oracle table.but iam getting an error "ORA-1843: not a valid month".
    how to solve this problem.
    Any suggestions or examples...

    That's not a date. It's just a string. Convert it to a date using,
    DateTime d = DateTime.ParseExact("01022003", "MMddyyyy", null);
    or
    Dim d As DateTime = DateTime.ParseExact("01022003", "MMddyyyy", Nothing)
    and then bind it to a parameter. ODP.NET will take it from there.
    You should never be hard-coding the date literal into your SQL query.
    David

  • How to handle DATE type problems in migrating from mysql to oracle.?

    Hi,
    I'm migrating only the data from mysql to oracle with the help of sql loader.But with this type i cannot able to insert the date values from mysql to oracle.In mysql i have defined date as "DATETIME" type and in oracle it is in TimeStamp.Whenever i'm inserting the values thru CTL file ,i'm getting an error invalid date format entered.How to solve this problem?
    Thanks in Advance
    JAI

    you need to supply a mask to the timestamp entry. see http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_field_list.htm#i1006714 for details on datatypes within the ctl file
    B

  • Script task how to add date value

    hi
    i have following code i am trying to add date into script task
     Public Overrides Sub CreateNewOutputRows()
            Dim vars As IDTSVariables100
            Dim vars1 As IDTSVariable100
            Dim recordCount As Integer
            Dim rdate As Date
            ' Dim recount As Integer
            '  Dim rcount As Integer = 0
            'Get the record count
            Me.VariableDispenser.LockOneForRead("RecordCount", vars)
            recordCount = CType(vars("RecordCount").Value, Integer)
            ' rdate = CType(vars("CurentDate").Value, Date)
            vars.Unlock()
            Me.VariableDispenser.LockOneForRead("CurrentDate", vars)
            rdate = CType(vars("CurrrentDate").Value, Date)
            ' rdate = CType(vars("CurentDate").Value, Date)
            vars.Unlock()
            'Me.VariableDispenser.LockOneForRead("rcount", vars)
            'rcount = CType(vars("rcount").Value, Integer)
            'vars.Unlock()
            '  rcount = rcount + 1
            'Output one row with record count
            Output0Buffer.AddRow()
            Output0Buffer.FooterRow = String.Format("ABC" & recordCount & rdate)
            Output0Buffer.SetEndOfRowset()
    in SSIS i have declare CurrentDate in datetime and i need to use it here , but i am getting error.
    how to append its value to       Output0Buffer.FooterRow = String.Format("ABC" & recordCount & rdate)
    its in vb ,i dotn know anything about VB ,please help me.
    i havent put anything in  readonly,readwrite in script task.ecordCount is working but i did same  for rdate and its not working

    how to get that value in yyyymmddhhmmss format in ssis.
    whats expression i need to use.
    also how to give single  space here between recordcount and variables.rdate
    Output0Buffer.FooterRow = String.Format("ABC" & recordCount & Variables.rdate)

  • How to handle data that got from SAP by Webservice?

    Hi, Gurus.
    I am working on IFbA with ABAP and Adobe LiveCycle Designer.
    I've developed a function module in R/3 system and created webservice, connected the WSDL address to the form. The problem is how can i handle data that got from SAP by Webservice?
    It's Ok if i bind the dataconnection node to the form element, but how can i handle data without binding to the form element? I mean that how can i use the data retrieved from Webserivce in the Javascript, please give me some sample code or script method.
    Thanks.

    Hi Yang,
    If you are using Web Service, then the binding will be done automatically.
    It can't grow automatically, what else should i do to achieve this?
    1.Select the table(make sure you are not selecting subform) in Hierarchy view
    2. Under table select the Row which is having the required fileds for data
    3. In the Binding of that row, check the checkbox "Repeat Row for each item data" and under that check the Min Count which will set the default row **** to 1
    Regards,
    Sachin

  • How HANA handle NULL values

    Hi frzz,
    Can any one explain me how exactly HANA handles NULL values??
    Best Regards,
    Krishna.

    Hi Krishna,
    You can use IFNULL for the SQL queries/script instead of ISNULL . Since ISNULL is binary function and will be mostly used for the CE Functions based Calc views.
    Try using the same queries with IFNULL instead of ISNULL, it should work
    Best Regards
    Rahul Jha

  • How to handle data in a request object

    I want to know the best way to handle data received from sql query to display on a jsp page and for page navigation. If I store data in a request object then the data is lost after displaying first page. When user hits Next link to view more data I need to do another query to database which I want to avoid. I display only 20 rows at a time. So if my query returns 100 rows I display 5 pages. I need to retain data when user hits next to view other pages. What is the best way to handle this?
    - Raj

    By caching your resultset. There are caching custom tags that perform this function. Check out http://www.servletsuite.com/jsp.htm.

  • How to show data value labels in the charts without moving my mouse on the data point?

    Sometimes I need to show a chart with data value labels which is not necessary to move my mouse on the data points. However, it seems Xcelsius does not support this simple feature. Any alternative ways?
    Many thanks!

    Currently, Xcelsius does not support display of labels at data points. It would be difficult to move and update labels on a chart with dynamically updated data. However, a work around for a static chart would be to add a Label component in the desired location. This can be done for multiple static charts by using dynamic visibility.

  • DB: How to handle the value results.GetString("NAME")

    Hello.
    I'm trying to handle the value of a field from my DataBase:
    PreparedStatement sql = Conn.prepareStatement("SELECT NAME FROM MY_TABLE");
    ResultSet results = sql.executeQuery();
    String Name = results.GetString("NAME");
    out.println(myName);
    I'm able to display the value of 'myName' (Tom), but if try:
    if (myName.equals("Tom")) {...}
    or
    if (myName == "Tom") {...}
    There is no response.
    Does anybody have any experience?
    Thank you.

    hey,
    String myName = results.getString("NAME");
    then u can use
    if(myName.equals('Tom'){
    }else
    The above condition will be true if myName has Tom in it.. it has to be T o m . even if it is TOM or tOm or some other case it will never match.. if u are not bothered about the case then
    use
    if(myName.equalsIgnoreCase('Tom'){
    }else
    which will ignore case .
    hope this will help u ....
    Hello.
    I'm trying to handle the value of a field from my
    DataBase:
    PreparedStatement sql = Conn.prepareStatement("SELECT
    NAME FROM MY_TABLE");
    ResultSet results = sql.executeQuery();
    String Name = results.GetString("NAME");
    out.println(myName);
    I'm able to display the value of 'myName' (Tom), but
    if try:
    if (myName.equals("Tom")) {...}
    or
    if (myName == "Tom") {...}
    There is no response.
    Does anybody have any experience?
    Thank you.

  • SMP 3.0: how to handle header values in the SOAP WS using Integration Gateway

    Hi Experts,
    We have a requirement from our current customer where they are providing us a SOAP WS.For one of the method we are passing “username” & “password” as input parameters and getting one security key (some unique number) in the response. We are able to do OData modeling for the same method. So far, it is fine.
    For other method, we have to pass that ”security key” in header along with some other parameters in the body section. While doing the request mapping for this method, we don’t see any option for this key parameter apart from those parameters (in that body section).
    We found one publicly available WSDL to reproduce the same scenario:
    e.g http://api.geosvc.com/services/soap?wsdl . To access its one of the method/operation GetPlace,We have to pass APiKey and Cursor value in the header section.
    <wsdl:message name="GetPlaceRq_Headers">
    <wsdl:part name="ApiKey" element="tns:ApiKey"/>
    <wsdl:part name="Cursor" element="tns:Cursor"/>
    To get APiKey, we have to register first. http://www.geosvc.com/register , once its done, you will get one APiKey as below:
    The same API key has to pass to access “GetPlace” method. So we tried it in SOAP UI to understand how exactly it should work:
    As you can see below, for the method “GetPlace”, we are passing values as in:
    Header Value
    Cursor
    blank
    ApiKey
    df7f8cc90e3345b4980cf6631f33a32d
    Body
    Country
    US
    Place
    HOLLYWOOD,CA
    Also got the response.
    When we do modeling (more precisely request mapping as below) for the same method we don’t see any Header related parameters. We can see only parameters which are available in the BODY section.
    We thought if we can get APIKey parameter in the body sections only, then it would be easy to map with. Right?
    What do you suggest how we should handle this kind of scenarios?
    CC: Mustafa Saglam, Jeff Gebo, Bjoern Woppmann
    Regards,
    JK

    Unfortunately the public example is a slightly different use case.  You have to register to get a static API key that is used in all calls.  That is something you would hard code into the headers.
    I think you are asking about a dynamic key they changes on each login.  It would be great if we had a public one that upon login returned a unique session key to be used in subsequent calls so we could better test and model accordingly.
    If you were using Agentry the answer would be yes you can do this.
    --Bill

Maybe you are looking for

  • Installed Firefox 3.6.8 for the first time and it keeps crashing

    I just installed Firefox for the first time and when it is finished installing I tell it to start. It tries and as soon as it does I get a crash report. Every time I click Restrt Firefox it comes up with the same crash error, which is the following:

  • Flash player 11.0.1.152 installation problem with Windows Vista 64-Bit

    Hello, I just can't get Flash Player to install on my computer with Windows Vista 64-Bit - doesnt matter if I try with Firefox, Opera or IE (I usually use Firefox). The download isn't a problem, but when I start the downloaded .exe, this file just di

  • Z10 won't boot up due to error "[A:0x00000049]"

    Please help somebody.. My Z10 seems bricked with flashing red LED. This issue happens on my Z10 (STL100-3) phone. I was trying to load an leaked BB 10.3 OS to take a look as mentioned in crackberry, auto loader name: Z10_10.3.00.0140_STL100-2-3.exe.

  • Payment reversed after sending client purchase

    Hi. So I sold some items on eBay. 4 people wanted to get refund so I canceled the purchase, but couldn't refund because my funds were in pending balance. I waited couple of days, but the money  still was in  pending balance. After that I contacted Pa

  • MailItem.SaveAs doesn't save attachments?

    When I drag over an outlook message to a folder on my computer, it will save the email "*.msg" file and embedded in the email are the attachments.  Why doesn't the MailItem.SaveAs() method do the same thing? Is there something different I need to do