Saving bean state on a processValueChange

Hello,
I have a selectOneMenu wich determine the disable state of inputText:
<h:selectOneMenu ... onchange= "submit()"
<f:valueChangeListener ...
<h:inputText id="idIP" value="#{LendingData.IP}" Disabled="#{LendingData.IPDisabled}"/>
Depending of the selectOneMenu selection, I set IPDisabled in the bean
if(menu.getValue().equals("ILL-DM1")
setIPDisabled(true); ...
The next call to getIPDisabled return false, I solved the problem by doing this: FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("LendingData", this);
My question, Is there another way to solve this?
Thanks,
Manuel

Can you explain more clearly what the problem you solved.
And what kind of problem you had an intend to solve.
Regards,
Oleksa Stelmakh

Similar Messages

  • Bean State is not maintained in producer

    Hi,
    In my application, whenever we click on the 'Add' button, document is added to bean and page is submited again and the same apge is displayed. For e.g, I have employeeDetails.xhtml apge and whenver I add any document, document is added to Bean, and employeeDetails.xhtml page is shown again. but now in portal, employeeDetails apge after adding docuemnt is throwing exception. the reason which we found out is that, bean state is not meintained and due to which RenderRequest reinitializes the bean and all saved data is lost.
    Can you pelase help on this?

    In Create Mode od material Master: MM01 Enter the material code & enter the same in Reference material & enter. In the next step select Purchasing, as it refers to not have maintained & enter Organization data & enter. Now maintain Purchasing Tab page.
    This process in SAP is known as Extending Material Master.  You can extend the material master for adding Views not maintained, also for extending material to another plant or combination of Sales Org & Distribution Channel, & so on ...
    Hope this resolves your issue.
    Regards,
    Rajesh Banka

  • Windows domain controller in a virtual machine: how dangerous is saving its state for a short period of time?

    I have a Windows Server 2012 R2 virtualization cluster. All the hosts are connected to an external storage system, and virtual machines' files are stored on external volumes (CSVs). All the hosts and virtual machines are a part of the same AD domain
    (mixed Windows Server 2012 RTM / 2008 R2 domain controllers). All the domain controllers are running in the virtual machines on the hosts of this cluster.
    To prevent problems when all the hosts are turned off and then on simultaneously (for example, because of a power failure) all the domain controller VM files has been placed on local disks of the virtualization hosts (not on the Cluster Shared
    Volumes). As Hyper-V services don't depend on other Windows Server services (except its networking components), it means that my domain controllers can always start, providing the virtualization host can start at all. However, it also means
    that those DCs cannot be (quickly) migrated to other hosts while their current hosts are being rebooted. So if I need to reboot a virtualization host to install new updates, for example, I have to shut down the corresponding DC, reboot the host
    and wait for the DC to finish cold boot and come back online. It means some interruption of service for our users, which, in turn, requires me to perform the reboots late in night.
    The downtime can be significantly decreased by saving the state of the VM in which the DC is running. However, all the articles I've found on the Internet strongly recommend against it. I'm trying to understand why this recommendation was issued in the first
    place. However, I'm unable to find a clear explanation. I've found some statements that saving state of a DC can cause serious AD replication problems because of tombstoning, and that the password of a DC computer account may be changed
    while the DC itself stays in the saved state, which could prevent the DC from connecting to the domain after its state has been restored. However, those considerations are non-significant when we discuss a short-time
    (5 to 10 minutes) saved state.
    I work with AD and virtualization long time, and I fail to see any danger in saving state of a DC for several minutes. In my opinion, after its state has been restored it would simply replicate all the AD changes from other DCs, and that's all.
    What's your opinion?
    Evgeniy Lotosh
    MSCE: Server infractructire, MCSE: Messaging

    Hello,
    as stated in "http://technet.microsoft.com/en-us/library/virtual_active_directory_domain_controller_virtualization_hyperv(v=ws.10).aspx"
    Operational Considerations for Virtualized Domain Controllers
    Domain controllers that are running on virtual machines have operational restrictions that do not apply to domain controllers that are running on physical machines. When you use a virtualized domain controller, there are some virtualization software features
    and practices that you should not use:
    Do not pause, stop, or store the
    saved state of a domain controller
    in a virtual machine for time periods longer than the tombstone lifetime of the forest and then resume from the paused or saved state.
    This may sound as it is supported to store it for shorter times and use it.
    BUT recommendation also from the Hyper-V Program manager in
    http://blogs.msdn.com/b/virtual_pc_guy/archive/2008/11/24/the-domain-controller-dilemma.aspx recommends against using them.
    Also best practices
    http://blogs.technet.com/b/vikasma/archive/2008/07/24/hyper-v-best-practices-quick-tips-2.aspx
    Best regards
    Meinolf Weber
    MVP, MCP, MCTS
    Microsoft MVP - Directory Services
    My Blog: http://blogs.msmvps.com/MWeber
    Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights.
    Twitter:  

  • How to get to folder in /Library/Saved Application State/com.adobe.flashplayer.installmanager.savedState

    I have a file saved in a folder which according to a find ?/ -name "" search is located here /Library/Saved Application State/com.adobe.flashplayer.installmanager.saved
    But I can't browse through this folder structure in Finder (I have run command to allow me to see hidden folders if that is required).
    Please can someone help me to find out how to get to this file. It's an excel spreadsheet.
    Thank you

    When I try to save another excel file that I have also opened from a password protected zip file, the automatic folder selected is "wzQL.8t0UHS". When I try to save a file with exactly the same name as the file that is missing into the folder "wzQL.8t0UHS" it tells me that the file already exists and asks if I want to replace it.
    My assumption was therefore that it was some kind of cache where the file is intact.
    When I've done a search on the name of the file I am looking for in Finder, I do not find the file.

  • Java.beans.Statement

    I have a program which is reporting the rather useless error:
    java.lang.NullPointerException
    Continuing ...I finally traced it down to the java.beans.Statement class, which has the following bit of useless code:
    static ExceptionListener defaultExceptionListener = new ExceptionListener() {
            public void exceptionThrown(Exception e) {
                System.err.println(e);
                // e.printStackTrace();
                System.err.println("Continuing ...");
        };You will note the commented out stack trace ! I have no way of knowing where the exception occured and every time it occurs an element of a CORBA conection I have (using third party libraries) falls over.
    Any Ideas how I can get it to report something useful ? Note that I cannot debug it as the error occurs on a live environment which handles thousands of interactions an hour.

    I don't think you understand the problem. The code quoted is JRE code, notice the class name "java.beans.Statement". I searched the entire JRE source to find something that could be generating the "phantom" exception, as niether my code, nor the third party CORBA code (according to the supplier), output that message.
    java.beans.Statement is the only class in the entier JRE that outputs that message in that format, hence it has to be the class reporting the error. Unfortunately, someone in thier wisdom commented out the stack trace code before compiling the JRE, so I have no way of telling what casused the error.
    So I need to know if there is a way of rerouting or overriding or something, just so I can see the stack trace.

  • Java.beans.Statement & java.sql.Statement

    My old code from jdk1.3.1 throws the ambiguous class thingie-mo-bob. Why did they implement the new java.beans.Statement, and is there anyway to make it default to the old java.sql.Statement without having to go through all the old code and add import java.sql.Statement. I have like 200 jsp files 'n it will take a loooong time!
    Pete

    There r two ways to do this.
    (i) One is Implement the java.sql.Statement
    like
    package java.beans;
    public interface Statement implements
    java.sql.Statement {
    }What? Are you suggesting he edit the source code for java.beans.Statement and make it implement java.sql.Statement?? I would most certainly not suggest that solution- beside violating the licensing agreement, it has troubling consequences since you are basically redefining the structure of a class in a way that makes no functional sense- that is, there is no reason for java.beans.Statement to implement methods like getConnection() and the other signatures of java.sql.Statement.
    I'm not sure if I'm reading your response correctly or not, but I would definitely not refactor java.beans.Statement just to get this problem solved with out editing files ... ... since java.sql.Statement is used so widely, perhaps they should have considered a different name for java.beans.Statement , although you hate to base a name off of what's going to cause the least problems, rather then what makes the most sense ... ... any way, I guess it doesn't matter now: the name has been selected .... I'd be interested to hear how you solved the problem.

  • I am unable to print bank statements and saved bank statements with my Mac.

    When I updated Firefox to 5.0, everything worked out fine printing the bank statements and saved bank statements. Now, I am unable to print statements from one bank only. No problem with statements from other banks. Where is the hang-up?

    You should try to start in safe mode which runs a file check. You hold the shift key down during a start up till there is a progress bar towards thr bottom of the screen. This start will take a longer time than normal. In safe mode try the functioins you are having problems with to see if there is an improvement. Some links below to read.
    http://support.apple.com/kb/ht1564
    http://support.apple.com/kb/ht1455

  • Applescript to delete caches and folders in Saved Application State

    I don't know if this can be done, but I'd like to write and Applescript to perform these functions:
    1) to delete caches from all 3 cache folders and the ~/Library/Saved Application State folder
    2) to run at  logout, shutdown or startup (any of those is fine)
    3) to run  with admin credentials already provided
    Can this be done?
    Thanks.

    You're not going to find anything useful in that folder. To clear an application's saved state, launch it while holding down the shift key. I very strongly advise you not to use the shell unless you're sure you know what you're doing.

  • Saving model state in ApplicationHandler (or where?)

    Where is the right place to save the state of a model bean during the request lifecycle? In the ApplicationHandler?
    Suppose I have a form and want to persist the data to a database after the user submits the form (and validation is complete).
    <jsp:useBean id="user" class="my.User" scope="session"/>
    <faces:usefaces>
    <faces:form id="simpleForm" formName="simpleForm">
    <faces:textentry_input id="name" modelReference="user.name"/>
    <faces:command_button id="submit" commandName="save"/>
    </faces:form>
    </faces:usefaces>
    In my ApplicationHandler, I have:
    User user = (User)(context.getHttpSession().getAttribute("user"));
    boolean returnValue = false;
    String treeId = null;
    if (formEvent.getCommandName().equals("save")) {
    user.save(); // update the database here?
    treeId = "/faces/acknowledge.jsp";}
    return returnValue;
    This doesn't seem to work for me because the bean properties do not seem to be set from the form at this stage. I have to intervene with something like
    user.setName(context.getServletRequest().getParameter("/simpleForm/name"));
    to get the properties set from the form. (This doesn't seem right!)
    Are the form values supposed to be applied to the model properties by the time the ApplicationHandler is called? If not, where is the right place to save the state of a model?
    I'd rather not save state from the ApplicationHandler if possible. It'd be nice if after all the properties were automatically set in the model, some finalize method could be called to save state or otherwise process before the next page is displayed. Is there a way to do this?

    Hi, I'm not yet an expert an JSF but aas far as my comprehension goes,
    the lifecycle state for updating model values should be prior to the application events phase.
    You can see this as well in the JSF spec chapter 2, where the "Update Model Values" phase comes prior to the "Invoke Application" phase.
    From what you have written, I assume that you are interested in persisting the state of all UIComponents of a page, since there is a difference in saving state ob business objects or their corresponding components. The JSF spec seems to mention the possibility of persisting state automatically, which I think might be a very interesting and powerful feature. Such state should be persisted to a distributable cache so that clustered systems work fine with JSP and are at the same time capable of preserving user specific UI state accross all nodes.
    However, I do not understand the concrete ideas of the tree-factory and I also do not yet understand, what exactly gets stored in the user session: whether only the current UI tree gets persisted there, or ALL trees that a user accesses during a session. The last scenario would not be so good, since clustered systems are often not capable of replicating more than 20K of session data without preformance degradation.
    Renderers could save UIState by coding it into an html form param, but if this approach is not chosen, then I agree that I am also a little bit puzzled as to where and when and how UIComponents are to be persisted.
    What I dislike is that UIComponents jsut have to implement the Serializable interface. Somehow I'd rather like the JSF people to address Serialization of UI components in a more general way. Java 1.4 comes with Long term beans persistance, other people might want to persist components to either databases or caching frameworks. There should be a more elaborate persistance approach for components in my view...

  • Saving session state

    Hi Everyone!
    We are looking for an easy-to-use solution for saving the session state in whole.
    (We are aware that it is possible to save the sesion state for a single item.)
    Our goal is to get a single commando which restores an whole session to another session. We would like to be able to save a session, purge the session (because of old age) and restore it's session state again to a new session.
    any ideas?

    Hi,
    I was thinking that a pointer to the Session object could be stored in a database on the initial loginAre you by any chance referring to the pointer similar to the one that is used in C? If so I guess it is not available in java.
    One possible solution where you can persist data across sessions is by the use of stateful session beans. Also you could experiment with the different scopes of the object for achieving your goal.
    I hope this helps you. In case I have missed out something please do post again.
    Cheers
    Giri :-)
    Creator Team

  • Saving session state during pagination

    See
    http://htmldb.oracle.com/pls/otn/f?p=24317:152
    I hacked into the PPR function to save the checkbox value into session state during pagination.
    Is there a way to do something similar for checkboxes in the report itself rendered using htmldb_item.checkbox()?
    Or is this an ill-advised effort?
    [The UI requirement here is clear...I have a bunch of items over many pages and I want to select them using checkboxes and have the selections remembered as I paginate back and forth.
    If you use Yahoo Mail, Compose a new message, click on the Insert Addresses link and it pops up a window with all your contacts, you can select them using checkboxes and go to the Next/Previous page and it remembers the selections]
    Thanks

    See
    http://htmldb.oracle.com/pls/otn/f?p=24317:152
    Click on the Create/Reset collection button to initialize your own private collection to play with.
    The checkboxes are remembered as you paginate thru the resultset. Basically, the state of the checkboxes is saved into session state using htmldb_Get before calling the PPR function to get the next/previous rows.
    Carl, let me know what you think of the approach. Is it a viable approach? Any caveats?
    [Unfortunately, I had to to make a copy of the builtin html_PPR_Report_Page function to make the above modification in it, didnt see a way to avoid it]
    Thanks

  • Saving session state on authentication

    Hey all...
    In all my applications that interact with each other, I am running an application-level process on authentication which loads two preferences into applicaton-level items. I am seeing different results when jumping into different applications even though the executing code is the exact same in all applications, a stored procedure in the database. Here is a simplistic example.
    When application A calls a page in application B, an "on authentication" application-level process of application B reads two preferences and appropriately populates them into two application-level items of application B. When application A (or B for that matter) calls application C, the same-coded application process in application C attempts to populate two application-level items, but one of them is not being populated.
    It appears that the problem lies only with application C because regardless of whether I come from application A or application B, the same problem happens.
    When I go from application A to application B in debug mode, I see the following in reference to this problem:
    0.05: Computation point: ON_NEW_INSTANCE
    0.05: ...New Session = True
    0.05: Processing point: AFTER_AUTHENTICATION
    0.05: ...Process "Setup Seed Data": PLSQL (AFTER_AUTHENTICATION)
    1.11: ...Session State: Save Item "ORIGINAL_APP_ID" newValue="104" "escape_on_input="Y"
    1.11: ...Session State: Save Item "ORIGINAL_PAGE_ID" newValue="7" "escape_on_input="Y"
    When I go from either application A or application B to application C, I see the same debug messages except for an additional line that doesn't make sense to me. Following is an example:
    0.05: Computation point: ON_NEW_INSTANCE
    0.05: ...New Session = True
    0.05: Processing point: AFTER_AUTHENTICATION
    0.05: ...Process "Setup Seed Data": PLSQL (AFTER_AUTHENTICATION)
    1.11: ...Session State: Save Item "ORIGINAL_APP_ID" newValue="104" "escape_on_input="Y"
    1.11: ...Session State: Save Item "ORIGINAL_PAGE_ID" newValue="7" "escape_on_input="Y"
    <strong>1.11: ...Session State: Saved Item "ORIGINAL_APP_ID" New Value=""</strong>
    In all three applications, the exact same code is being run which determines if the preferences "is not null", and if so, sets the two preferences in the "current" application. I'm happy to show you the code of my stored procedure that does this if you like.
    The only thread I've seen in the forum that looks similar is the following:
    Re: Session state issues
    I've followed its suggestion of deleting and recreating the application-level item, but that did not solve my problem.
    I'm confused as to why the new line indicating "Saved Item" is showing up in the application C. Is there documentation available to explain the difference between "Save Item" and "Saved Item" when running a page in debug mode?
    Shane.

    Here are the different componets that are in play and some notes that may help understand the situation:
    - the failure happened when the two application-level processes below were just one process. works fine when they are split up.
    - the trick of using the SESSION as the USER_ID is because I want the preference to only be good for the session, not everytime the user logs in. ( i learned this trick from the ApEx forum! )
    - the stored procedure is in a package owned by a separate schema than the built-in ApEx user.
    On-Authentication Application-Level process with Sequence 10:
    begin
    :person_id := iv_portal.iv_emp_pkg.get_person_id ( v('USER') );
    apex_util.set_session_state ( 'PERSON_ID', :person_id );
    :core_app_id := iv_htmldb.iv_gen_pkg.get_core_app_id;
    apex_util.set_session_state ( 'CORE_APP_ID', :core_app_id );
    :user_vax_id :=
    substr ( iv_portal.iv_emp_pkg.get_vaxsub_id ( :person_id ), 1, 6 );
    apex_util.set_session_state ( 'USER_VAX_ID', :user_vax_id );
    :user_sub_id :=
    substr ( iv_portal.iv_emp_pkg.get_vaxsub_id ( :person_id ), 7, 1 );
    apex_util.set_session_state ( 'USER_SUB_ID', :user_sub_id );
    :proxy_person_id := apex_application.fetch_app_item
    ( 'PROXY_PERSON_ID', :original_app_id );
    apex_util.set_session_state ( 'PROXY_PERSON_ID', :proxy_person_id );
    end;
    On-Authentication Application-Level process with Sequence 15:
    declare
    l_username varchar2(50) := v('SESSION');
    begin
    iv_htmldb.iv_gen_pkg.setup_homepage_preferences ( l_username );
    end;
    SETUP_HOMEPAGE_PREFERENCES Stored Procedure
    procedure setup_homepage_preferences ( l_username in varchar2 ) is
    l_app_id varchar2(5) := v('APP_ID');
    l_page_id varchar2(5) := v('APP_PAGE_ID');
    l_pref_app_id varchar2(5) := null;
    l_pref_page_id varchar2(5) := null;
    begin
    -- clean up old sessions
    -- cannot do this however due to lack of access to the ApEx tables.
    delete from flows_020200.wwv_flow_preferences$ p
    where user_id != v('SESSION' )
    and user_id in ( select to_char ( id )
    from flows_020200.wwv_flow_sessions$ s
    where s.cookie = v('USER')
    and s.last_changed < sysdate - ( 0.5 ) );
    commit;
    if apex_util.get_preference ( 'ORIGINAL_APP_ID', l_username ) is null
    then -- then set the preference to the current application and page.
    apex_application.debug ( 'setting the ORIGINAL application items.' );
    apex_util.set_preference ( 'ORIGINAL_APP_ID', l_app_id,
    l_username );
    apex_util.set_preference ( 'ORIGINAL_PAGE_ID', l_page_id,
    l_username );
    else null;
    end if;
    -- set the application level items to the preference values
    l_pref_app_id := apex_util.get_preference ( 'ORIGINAL_APP_ID', l_username );
    l_pref_page_id := apex_util.get_preference ( 'ORIGINAL_PAGE_ID', l_username );
    apex_application.debug ( 'about to set ORIGINAL APP ID to ' || l_pref_app_id );
    apex_util.set_session_state ( 'ORIGINAL_APP_ID', l_pref_app_id );
    apex_application.debug ( 'just set ORIGINAL APP ID to ' ||
    apex_util.get_session_state ( 'ORIGINAL_APP_ID' ) );
    apex_application.debug ( 'about to set ORIGINAL PAGE ID to ' || l_pref_page_id );
    apex_util.set_session_state ( 'ORIGINAL_PAGE_ID', l_pref_page_id );
    apex_application.debug ( 'just set ORIGINAL PAGE ID to ' ||
    apex_util.get_session_state ( 'ORIGINAL_PAGE_ID' ) );
    end setup_homepage_preferences;
    Shane.

  • Saving checkbox-state to table in Interactive Report

    Hi,
    I have been working with the information on http://www.apexninjas.com/blog/wp-content/uploads/2012/03/Checkboxes_in_Interactive_Reports.pdf to create an interactive report with a column containing a checkbox for each row.
    My report contains the following (simplified):
    Task_id, Employee_id, Checkbox_column
    The checkbox_column keeps track of which employees work on which tasks, so it could be:
    Task_id, Employee_id, Checkbox_column
    1               1                         0
    1               2                         1
    1               3                         0
    signifying that only employee 2 works on task 1.
    Now, I need to be able to change the 0 to 1 by clicking the checkbox, which already is possible, but I have problems saving that row to the database. Saving the checkbox state is also included in the PDF I used (page 12-14, 'Saving the checkbox state #2'), but I don't really understand where to put the scripts, I haven't worked with scripts and processes before so I could use some help understanding which script I need to put where. All in all, it's not too much code, I just don't understand where to put it.
    The scripts mentioned in the PDF are:
    The first one is a SQL-statement or a package, I imported the package in my environment, so I won't put the SQL here
    This is the only one I know where to put:
    <script type="text/javascript">
    function getCurIRTab()
    var temp_base_report_id = $v('apexir_report_id');
    return temp_base_report_id;
    </script>
    This I don't know where to put:
    <script type="text/javascript">
    document.getElementById('P_IR_REPORT_ID').value = getCurIRTab();
    </script>
    the PDF says:
    Now, create a hidden (just hidden, not protected!) item called P_IR_REPORT_ ID inside a HTML region.
    Important! This region has to be rendered afterthe Interactive Report, so create it in the “after footer” display point!
    In this regions’s footer paste the following JavaScript code, that will assign the hidden item P_IR_REPORT_ID the value of the Interactive Report ID.
    But can we create a region in the after footer?
    This I don't know where to put because the document doesn't specify it:
    apex_ir_query.ir_query_where
    (:APP_ID,--application id
    99,--page id
    :SESSION,--sesion ID
    : P_IR_REPORT_ID -–interactive report ID);
    This I don't know where to put, but I guess it's a 'processing' process:
    declare
    whereStmt varchar2(2000);
    sqlStmt varchar2(2000);
    begin
    whereStmt := apex_ir_query.ir_query_where(:APP_ID,
    99,
    :SESSION,
    :P_IR_REPORT_ID);
    sqlStmt := 'update CHK_TEST set SELECTED = 0 where SELECTED= 1'||whereStmt;
    execute immediate sqlStmt;
    if APEX_APPLICATION.G_F01.COUNT>0 then
    FOR i in 1..APEX_APPLICATION.G_F01.COUNT LOOP
    update CHK_TEST
    set VALID_LINE = 1
    where SELECTED_ID = APEX_APPLICATION.G_F01(i)
    and VALID_LINE = 0;
    END LOOP;
    end if;
    end;
    Can I please get some help understanding where exactly to put these scripts?
    I've been looking around on the forum and Google but I can't find the detailed answer to what I'm looking for anywhere.
    I am currently working with the test environment Oracle supplied us, because we are testing if we can use APEX at our company.
    The version is Application Express 4.2.2.00.11 and it's running on Oracle 11g.
    Just ask if you need any more info.
    Thanks for the answers!
    NDG

    Please put together an example application on apex.oracle.com and provide developer credentials.  This would help prevent multiple posts back and forth about try this, try that, now try this, now try that......
    But until you do that try this:
    I think you already know that the following goes in the page html header.
    <script type="text/javascript">
    function getCurIRTab()
    var temp_base_report_id = $v('apexir_report_id');
    return temp_base_report_id;
    </script>
    Alternately, since you are on apex 4.2 you could just add it to the Page Attributes->JavaScript->Function and Global Variable Declaration field (without the script tags):
    function getCurIRTab()
    var temp_base_report_id = $v('apexir_report_id');
    return temp_base_report_id;
    Now you need to create an HTML region (in display point "after footer").  Then you create the P_IR_REPORT_ID hidden item inside your new region.
    In the region definition you will put the following code into the region footer:
    <script type="text/javascript">
    document.getElementById('P_IR_REPORT_ID').value = getCurIRTab();
    </script>
    Alternately, you could try to add the line to the Page Attributes->JavaScript->Execute when Page Loads field:
    document.getElementById('P_IR_REPORT_ID').value = getCurIRTab();
    This is just an example of the procedure call you will make in your page process.
    apex_ir_query.ir_query_where
    (:APP_ID,--application id
    99,--page id
    :SESSION,--sesion ID
    : P_IR_REPORT_ID -–interactive report ID);
    It is included in this code which you will put into a page process.
    declare
    whereStmt varchar2(2000);
    sqlStmt varchar2(2000);
    begin
    whereStmt := apex_ir_query.ir_query_where(:APP_ID,
    99,
    :SESSION,
    :P_IR_REPORT_ID);
    sqlStmt := 'update CHK_TEST set SELECTED = 0 where SELECTED= 1'||whereStmt;
    execute immediate sqlStmt;
    if APEX_APPLICATION.G_F01.COUNT>0 then
    FOR i in 1..APEX_APPLICATION.G_F01.COUNT LOOP
    update CHK_TEST
    set VALID_LINE = 1
    where SELECTED_ID = APEX_APPLICATION.G_F01(i)
    and VALID_LINE = 0;
    END LOOP;
    end if;
    end;
    Ok, clear as mud!

  • Save point with POJO DataControl not saving model state

    Hi Guys,
    JDEV 11.1.1.6 64bit
    I was able to get save points working with ADF BC (AppMod, View & Entity objects)
    but when I tried to do the exact same with Pojo DataControls, I won't save
    the current state of the model - meaning things are not "selected" to the
    proper record when the SP is restored. I don't get any errors, it just
    shows the wrong data.
    Example:
    The BTF is marked as must have transaction(tried either way), but this is Pojo, and doesn't support Trx.
    edit-emp-dept.jspx (with BTF Region)
    BTF START
        STEP 1: RichTable with bindings to Pojo DataControl (value="#{bindings.allDepts.collectionModel}")
                     (user selects the 3 record => sales department)
        STEP 2: Edit Sales Dept & on click to next step create SP
        STEP 3: View Emps (Rich Table of ALL emps in that DEPT)
        STEP 4: Edit Emp
        FINAL: COMMIT (save to pojo list) or CANCEL (don't save to pojo list)
    /BTF END
    At STEP 1 -> STEP 2, the SP is created, and when I close the browser at STEP2, 3  or 4, and
    restart, and choose SP to restore, it takes me to proper page (STEP 2)  but the wrong Department is
    selected to edit (it shows "Finance" instead of "Sales") & if I hit my ADF back button, it shows
    the table with "finance" selected.  In the ADF BC world it works perfectly.
    I know the docs say: the ADF Model is saved, so the question is why bindings.allDepts.collectionModel
    not "saved" here for Pojo DC and the ADF BC af:table value="#{bindings.DepartmentsView1.collectionModel}"
    it is "saved".
    Thanks for any insight or work-around.
    Sincerely,
    Joel
    edit-emp-dept.jspx:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1">
          <af:form id="f1">
            <af:region value="#{bindings.btfpojodc1.regionModel}" id="r1"/>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>

    Hi,
    the problem with POJO DC and other non-ADF BC models is that they don't passivate their state. In JDeveloper 12c we allow developers to extend their POJO classes with ADF lifecycle methods that allows them to save the model state themselves. Its a known issue that the transaction state cannot be saved for non-ADF BC models. I checked the bug database for bugs filed against this behavior but could not find one- I can imagine that with 12c we would have a chance to allow developers to handle passivation / activation for non-ADF BC model states. So if this is a feature you need then filing an enhancement request would make sense
    Frank

  • JSF Backing Bean State Being Lost Prior to Submit

    ISSUE
    I have an attribute in a backing bean for a drop-down list in a JSF that loses its state before I submit the page, which causes data updates to the backing bean dependent upon its state to be ignored.
    CONTEXT
    The JSF in question has a selectOneMenu drop-down list that determines whether or not several inputText fields will be rendered. The selectOneMenu is bound to an enum in the backing bean, and there are conditional accessors allowing the JSF to determine which inputTexts should be included in the current view. The three valid values of the drop-down are "ALL", "RANGE" and "SINGLE". The page is request scoped, a requirement of this project.
    Here is the JSF tag for the selectOneMenu drop-down list:
    <h:selectOneMenu disabled="#{not backingBean.newEntry}"
        id="tCriteria"
        value="#{backingBean.tCriteria}"
        onchange="submit()">
        <f:selectItems value="#{backingBean.possibleTCriteria}" />
    </h:selectOneMenu>And here are the RANGE selection-specific inputText controls:
    <h:inputText disabled="#{not backingBean.newEntry}"
        rendered="#{backingBean.tRange}"
        id="startTIndex"
        value="#{backingBean.tIndex}" />
    <h:inputText disabled="#{not backingBean.newEntry}"
        rendered="#{backingBean.tRange}"
        id="endTIndex"
        value="#{backingBean.endTIndex}" />Here is how I initialize the backing bean for the drop-down list attribute:
    * The current "t" criteria.
    private TCriteria tCriteria = TCriteria.ALL;And there are basic accessor/mutator methods for it. All of this works pretty well, with one problem. If I select "RANGE" in the drop-down, the appropriate inputText fields appear in the view. When I submit the page with values in the inputText fields, the value of the drop-down in the backing bean has been reset to its default initial value ("ALL") without having been updated through its mutator. Thus, when values in the backing bean are updated from the JSF, the conditional inputText fields are ignored, as they appear to have been deemed irrelevant during the update phase by the invalid state of the backing bean for the drop-down.
    To test my theory, I changed the default value of the backing bean attribute for the drop-down to be "RANGE", and made it final. The page behaves perfectly in updating the backing bean with the values entered for the conditionally-displayed inputText controls. This tells me that the invalid state of the backing bean drop-down list attribute must be the problem. Furthermore, I have tried using "disabled=", "readonly=" and "rendered=" on the conditional inputText fields, and none of that seems to make a difference. I also tried using a ValueChangeHandler, but that didn't do anything about it.
    Note - the backing bean does realize that the correct state for the drop-down should be "RANGE", but only AFTER the backing bean has received its updated values from the page controls.
    Has anyone seen anything like this? I haven't read anything in previous posts about an issue like this, but it has to be something someone has seen before. Maybe related to using the enum type? Thanks.

    Hi,
    did your web.xml file had any parameter regarding explicitly indicating the way to save state?
    I mean something like
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
      </context-param>One last question: did you stay with request scope beans or session ones?
    Greetings.
    MogaRick

Maybe you are looking for