10g: Initialize State object?

I like the idea of using the State object on the Page to manage State. I've coded the EventHandler to read the parameters and store them on the state, and I see how to read them back from the state when re-rendering the page. My object model also knows what the default selections should be when the user first opens the page, but I don't know how to get these into the State before the user makes their first set of selections and submits those to the EventHandler.
This seems to be related to the suggestion in the documentation that one "should always gracefully handle the absence of a State object." I'd rather not have to code the equivalent of "selectedValue = (uix:pageState == null ? getDefault : uix:pageState.selectedValue)" throughout the forms. What would be the most elegant way to put "if uix:pageState == null then pageState = getDefaultState" in the page? I was thinking about just creating a defaultState property on my dataSource and using that.
Am I barking up the wrong tree? Are there recommended patterns to "gracefully handle the absence of a State object"?

I'll ask around tomorrow.

Similar Messages

  • Error: The report source could not be retrieved from the state object.

    I have been trying to create a report in a JSF page. The relevant parts are below:
    Inside the JSP page, this is the code:
                  <jsp:useBean id="MyBean" class="com.nm.facade.rto.POJOViewerBean" scope="session" />
                    <jsp:setProperty name="MyBean" property="reportLocation" value="Report1.rpt" />
                   <v:reportPageViewer reportSource="#{MyBean.reportSource}"
                                           displayToolbarPrintButton="true"
                                           printMode="ActiveX"
                                           zoomPercentage="100"
                                           displayToolbarExportButton="true"
                                           displayToolbarRefreshButton="true"
                                           viewerName="My Viewer"
                   ></v:reportPageViewer>
    In the backing bean, this is the relevant code:
        public Object getReportSource() throws ReportSDKException
            if (propertiesChanged || reportSource == null)
                propertiesChanged = false;
                if (reportLocation == null)
                    throw new RuntimeException("The reportLocation property must be set before a report source is retrieved");
                ReportClientDocument rcd = new ReportClientDocument();
                rcd.setReportAppServer(ReportClientDocument.inprocConnectionString);
                rcd.open(reportLocation, 0);
                DatabaseController dbc = rcd.getDatabaseController();
                //Create the POJO collection and populate it with data
                ReportData[] data =
                  new ReportData("B.B.", "King", 6, new Date(25, 9, 16)),
                    new ReportData("Muddy", "Waters", 7, new Date(15, 4, 4)),
                    new ReportData("John Lee", "Hooker", 8, new Date(16, 8, 16)),
                    new ReportData("Otis", "Rush", 9, new Date(34, 4, 29)),
                    new ReportData("Buddy", "Guy", 10, new Date(36, 7, 30))
                //Create the result set from the collection of POJOs
                POJOResultSetFactory factory = new POJOResultSetFactory(ReportData.class);
                factory.setVerbose(true);
                POJOResultSet results = factory.createResultSet(data);
                ResultSetMetaData metaData = results.getMetaData();
                //Set the resultset as the report datasource
                      //Get the table name from the 'Set Datasource Location' dialog in the Crystal Reports designer
                String reportTable = "getReportDataDataSource";
                dbc.setDataSource(results, reportTable, reportTable);       
                IReportSource reportSource = rcd.getReportSource();
                if (reportSource == null)
                    throw new RuntimeException("Unable to get a report source.");
            return reportSource;
    In the CRConfig.xml, this is what is there:
    <?xml version="1.0" encoding="utf-8"?>
    <CrystalReportEngine-configuration>
        <reportlocation>../reports</reportlocation>
        <timeout>0</timeout>
        <ExternalFunctionLibraryClassNames>
             <classname></classname>
        </ExternalFunctionLibraryClassNames>
    </CrystalReportEngine-configuration>
    The report template 'Report1.rpt' is packaged under WEB-INF/reports in the war file.
    When I try to generate the report by accessing the JSF page, I am getting an error: "The report source could not be retrieved from the state object. "
    I am not sure what is wrong. Can someone help me in resolving this issue?
    Edited by: renshai on Jul 9, 2009 3:21 AM

    My formatting gets lost and the message looks unintelligible. After some experimentation, I found that if the message exceeds some length, the formatting is removed. Since I couldn't find any way to delete this post, I made another post with the same subject. Please ignore this post and help me to find a solution for the problem posted in the other thread with the same subject. Thanks in advance.

  • Re-using statement objects

    Hi,
    I am new to jdbc and sql in Java. So this is my question.
    If I want to to a select statement and depending on the result a second select, can I do this on the same statement object, or do I have to create a new one? And what about the resultset? Can you re-use this? And do you always close this statement after using it, or can you just close it when the program finishes?
    My code is something like this :
    Connection con = .....
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery(blablabla...);
    if (rs.next() = ...)
    ResultSet rs = stmt.executeQuery(blablabla);
    }

    If I want to to a select statement and depending on
    the result a second select, can I do this on the same
    statement object, or do I have to create a new one?You can reuse your first statement and execute another query with it. But this would close your first resultset. If you want to use two resultsets at the same time, they must be created by different statements.
    Note that not all combinations of DBMS / driver support different active statements in 1 connection. In that case you would use a second connection for the second statement.
    And what about the resultset? Can you re-use this?You created a simple statement. So you can only position in it downwards by next() and retrieve values. If you execute another query by the same statement, your statement will close the first resultset and return a new one.
    And do you always close this statement after using it, or
    can you just close it when the program finishes?If you close it, you must create a new one if you need it again.
    No problem to let it remain open.
    At the end of your program then close them all in the right order:
    1. resultset (if still remained unclosed)
    2. statement (if still remained unclosed)
    3. connection (if still remained unclosed)

  • Is there a maximum number of "multi state objects" per article? Indesign keeps crashing

    Hi, i have 12 multi state objects on a page, and indesign keeps crashing.
    i know this seems like a high number, but I have done this to create a work around - ticker (like an old style airport board e.g. https://www.google.co.uk/search?q=airport+board&espv=2&biw=1306&bih=653&source=lnms&tbm=is ch&sa=X&ei=TkYUVb3ZJIb0PJ7DgZg… each set of 3 creating one graphic e.g. 3.35
    After creating these Indesign keeps crashing when i try to preview?
    Any advice would be appreciated.

    It sounds like you're running in to a memory problem: Memory Handling in DPS
    That said, usually multiple MSOs on the page don't usually cause memory problems because only the first state of the MSO is loaded into memory. If the first state of each MSO is loading a web overlay displaying ticker information, then that's the most likely culprit. Consider redesigning the page so that only a few tickers are loaded into memory and the user needs to tap to reveal additional tickers.

  • ORA-13786: missing SQL text of statement object - Unable to profile a sql_id in oracle 11g -

    11.2.0.3.5 / 2 node rac on rhel-6 / 64-bit
    I would like to a profile a sql_id since its following 4 plans and one of them is the optimal.
    But im unable to do it as it throwing ORA-13786.
    Steps I followed :
    {code}
    SET SERVEROUTPUT ON
    -- Tuning task created for specific a statement from the AWR.
    DECLARE
      l_sql_tune_task_id  VARCHAR2(100);
    BEGIN
      l_sql_tune_task_id := DBMS_SQLTUNE.create_tuning_task (
                              begin_snap  => 29676,
                              end_snap    => 29707,
                              sql_id      => 'fjndcnvzkjkb5',
                              scope       => DBMS_SQLTUNE.scope_comprehensive,
                              time_limit  => 60,
                              task_name   => '420tavt57dxkx_tuning_task',
                              description => 'Tuning task for statement 420tavt57dxkx in AWR.');
      DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
    END;
    EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => 'fjndcnvzkjkb5_CFO_tuning_task');
    SET LONG 10000;
    SET PAGESIZE 1000
    SET LINESIZE 200
    SELECT DBMS_SQLTUNE.report_tuning_task('420tavt57dxkx_tuning_task') AS recommendations FROM dual;
    SET PAGESIZE 24
    SQL>  execute dbms_sqltune.accept_sql_profile(task_name =>'420tavt57dxkx_tuning_task_task', replace => TRUE,force_match  => TRUE);
    BEGIN dbms_sqltune.accept_sql_profile(task_name =>420tavt57dxkx_tuning_task', replace => TRUE,force_match  => TRUE); END;
    ERROR at line 1:
    ORA-13786: missing SQL text of statement object "1" for tuning task "420tavt57dxkx_tuning_task"
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_SQLTUNE_INTERNAL", line 16442
    ORA-06512: at "SYS.PRVT_SQLPROF_INFRA", line 31
    ORA-06512: at "SYS.DBMS_SQLTUNE", line 7544
    ORA-06512: at "SYS.DBMS_SQLTUNE", line 7568
    ORA-06512: at line 1
    {code}
    Can somebody help me out on this?

    Hi Experts,
    i too getting this error while attaching the tuning task to the sql profiler, below are the details, appreciate any help on this.
    SQL> SQL> VAR profile_name VARCHAR2(30);
    SQL> BEGIN
       :profile_name := DBMS_SQLTUNE.ACCEPT_SQL_PROFILE(task_name => 'sql_tuning_task');
    END;
    /  2    3    4
    BEGIN
    ERROR at line 1:
    ORA-13786: missing SQL text of statement object "1" for tuning task "sql_tuning_task"
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_SQLTUNE_INTERNAL", line 16442
    ORA-06512: at "SYS.PRVT_SQLPROF_INFRA", line 31
    ORA-06512: at "SYS.DBMS_SQLTUNE", line 7544
    ORA-06512: at line 2
    SQL> select banner from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production

  • Can I assign the text in a multi-state object?

    I want to assign InCopy files to the captions that are part of a slideshow, but I can't seem to create assignments for the text boxes that are in a multi-state object. Is this possible?

    Currently there is no capability to add text frames withing an MSO to an InCopy assignment. There is limited support for this edit workflow when using solutions such as WoodWing or K4. Please make sure to fill out the feature request form: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform so that we can capture the demand for this function.

  • My multi-state object disappear's when I export to PDF but works in Preview mode?

    I created a multi-state object which is a series of logos that appear when a button is clicked. There are two buttons one is set to go the the previous state and one is set to go to the next state. When I view it in the preview mode it works fine but when I export it to PDF nothing happens when I click the buttons. Any help would be greatly appreciated.

    Multi-state objects are NOT supported in PDF. The PDF standard preceded the development of multi-state objects. It's now under the control of the ISO so may be slow to adapt.
    They work when exporting to SWF or with the Adobe Digital Publishing Suite.

  • Hyperlinks in Multi-state object?

    I can't find the answer in the Help PDF, maybe because it is maybe even impossible to achieve it... or maybe there is a trick...
    How can I make hyperlinks to work in a Multi-state object?
    Thank you

    Wait a few days for the release 18 tools.

  • Image buttons in multi-state-object

    Hello,
    I created 3 articles in Indesign for the iPad. The 3 articles come in a liquid format (landscape and portrait) and are all quite picture heavy. Nevertheless, I am very surprised of the folio file size, it's over 500 MB big.
    The biggest Indesign file of these 3 articles has 115 MB as there are many statuses (multi-state-objects) (please see screenshots attached). I checked these resources out: Digital Publishing Suite Help | Best practices for creating overlays and Structuring Files for DPS
    According to these resources, the images in my 9 big circles should be resampled when I export the folio in PDF format. So by theory the image sizes cannot be the problem here. But what else can be the problem? I can't think of any other issues.
    What can I do to reduce the folio size. Please help!

    I don't have any web overlays, no. Just normal URL links (In-App-Browser opens). I have 1 video file embedded (nearly 400 MB), so I am well aware of that. But 150 MB for the rest when it's only 3 articles (despite having 2 formats) seems a bit too much to me. I did add the articles to the folio once at a time, yes. And it is the article with the many buttons and MSOs (as seen in the screenshots above) that is so big. This is also the article with the video in it, but still. I have the feeling buttons or the images in the buttons are making the folio so big. I often do app magazines with approx. 15 articles and 3-4 videos embedded (200-300 MB per video!) and that is normally 650 MB or so. So comparing that with my 3 articles makes me wonder.
    Do MSOs and buttons make a folio big, is that possible? Or is it the images in the 9 big buttons not being resampled correctly (even though the documentation - 2 links in my original post - say something else). When I export the article, I always export it as PDF and when looking at the loading bar, it says "saving as PNG". So that should mean that all my buttons are resampled, I don't have to worry about image file size and it's exported as PNG in the PDF. Hm...

  • 10g Automatic Stats Collection -- AUTO ( METHOD_OPT)

    I have implememted Oracle 10g Auto Stats collection feature. To generate new stats on 10g optimizer I deleted the schema stats and then scheduled the DBMS_SCHEDULER to collect stats in AUTO method_opt.
    I see that the new 10g optimizer is collecting stats differently in different databases eben through they have the same data.
    For exampl I see that it collected Histograms on 10 columns in one table in one environment but it generatd histograms only on 9 columns in another env.
    I am concerned that the stats difference will result in the execution plan getting changed across different instances.
    Can someone please clarify the cause of the same. How can I make sure tha the 10g optimizer is collecting stats uniformly across different envs.
    Thank You

    You wrote:
    "I am concerned that the stats difference will result in the execution plan getting changed across different instances."
    and you should be concerned.
    I would recommend not collecting stats the way you are but rather to use a nuanced approach where you collect only when they are stale or only when you know that changes have rendered old statistics invalid.

  • Can't Create Statement Object - Help

    Hi:
    I'm using NetBeans 5.0
    which is pointing at:
    Java\jdk1.5.0_07
    The IDE can't see the Statement object:
    'cannot find symbol Statement'.
    It won't compile.
    I've included: import java.* at the top of the file.
    It's not having a problem creating the connection object, just the Statement object.
    Can you tell me what I'm missing or what I need to make the IDE 'see' the Statement type?
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    oCn = java.sql.DriverManager.getConnection(getConnectionUrl), userName,password);
    Statement stmt = oCn.createStatement(); //<<-- IDE cant' see this

    Never mind. I figured it out:
    import java.sql.
    In general, these forums are GREAT!!
    Thanks very much for all the answers you 've given me.
    You're better than ANY support team:o)

  • Slideshow Using Multi-State Objects

    Hi,
    I created a slideshow in an Indesign document using multi-state objects. The slideshow has foward and backward buttons to navigate the slideshow. The slideshow works fine in Indesign but when I export the document as an intereactive pdf, the slideshow no longers works. What am I doing wrong? I'm using Indesign CS 5.5.
    Thank you,
    Kristie

    What you're doing wrong is expecting it to work. MSOs are for SWF and DPS output only.
    The only workaround is doing it in its own file, exporting to SWF and placing that in the PDF.
    Bob

  • Multi-State Object Change Speed

    How can I adjust the speed and style how the multi-state object changes its states? I find the fade to be too long. Any ways that that can be shortened?

    Select the MSO and use the options in the Folio Overlays panel.

  • How to highlight State of Multi-State object?

    hi,
    I have created 3 states of object State1, State2, State 3. and want to highlight state in object state panel programmatically. can any one have idea abt it?

    @Priyanka – you did not mention a specific scripting language.
    In ExtendScript (JavaScript) you can set the "active" property of the 3rd state of your MultiStateObject to value "true".
    //ExtendScript (JavaScript) example
    //Make sure a MultiStateObject is selected; nothing else, then run this JavaScript:
    app.selection[0].states[2].active = true;
    The expression from left to wright (for lurkers who never saw a line of code):
    app => application (that's InDesign, of course)
    selection => your current selection in the UI (could be one item, could be many)
    [0] => index number 0 is the first item in your selection; be cautious with the expression "first", it depends on the InDesign version what that does exactly mean, if you selected more than one object
    states => obviously the "state" object (always with the plural "s", it's the collection of all states in that selected MultiStateObject)
    [2] => index number 2 is the 3rd element of the states collection
    active => property for the active status; boolean, could be "true" or "false"
    = => with the "=" sign, you are setting the value
    true => the value of the property; self-explanatory, I hope…
    ; => end of expression, all that comes after is a different expression.
    The different parts are held together with a dot-notation. The index  is directly glued to its object, no dot notation between object and index.
    If you want learn more about ExtendScript and the InDesign DOM see Jongwares' documentation at:
    http://www.jongware.com/idjshelp.html
    Uwe

  • DPS HTML to activate multi state object

    Is there a way to have an HTML asset placed in a DPS folio, to activate a specific state of a multi state object?

    I don't think there is a way to use hyperlinks to change an MSO's state.
    Two approaches you might try:
    1 - Lose the MSO and create it as an html overlay and use jQuery to create a similar MSO change state experience
    2 - Try overlaying a blank button on your html link and use that to change the MSO state

Maybe you are looking for

  • Resolution problems with Acer aspire 5520

    Hello, I'm having trouble making both tty and Xorg resolution be native. I have an nVidia 7000M gpu.With nouveau drivers I managed to get KMS working, but realized Xorg resolution is wrong. If I set the right resolution with xrandr the problem with t

  • Accessing element in a nested arraylist

    Hi, I have a LinkedHashMap that contains ArrayLists. Something like this: {color:#3366ff} ArrayList list = new ArrayList(); ArrayList list2 = new ArrayList(); LinkedHashMap<Integer, ArrayList> map = new LinkedHashMap<Integer, ArrayList>(); list.add(0

  • Has anyone successfully managed to get VZW to raplace Fascinate with a different phone?

    Has anyone successfully managed to get VZW to raplace Fascinate with a different phone? If so, could you share with me on how you convinced VZW to do it?(which department?) I love my Fascinate, but not when it can't get calls.  I would prefer to have

  • Major 10.6.7 update problem

    I have downloaded the 10.6.7 update and after restart my 15" macbook pro is slow and unresponsive. I can't do anything without it locking up and getting the spinning wheel. I am typing this right now without seeing the words as i type because it is f

  • Cannot find Datasource Explorer View tool in Eclipse 3.1

    I have added the Oracle plugin for Eclipse but still could not find the Datasource Explorer View. Basically, I would like to configure datasource using Eclipse but unsuccessful. Your suggestion is appreciated. TT