ADF Faces + BC 10.1.3: prompting to save changes after any navigation

Hello all,
Working on an application that uses ADF Faces + Business Components. We're using the PanelPage component and using a menu tree model bean specified in faces-config.xml for the menu1, menu2, and menu3 facets of the PanelPage.
What we'd like to be able to do is, regardless of what page the user is on, be able to check if the user is trying to navigate via the menu without having saved changes and then prompt them "do you want to save your changes" with a Dialog.
Creating the dialog is the part I know how to do, but how could I, in a generic way:
a). Have some code execute during the navigation. I assume this is a custom ADFPhaseListener/FacesPageLifecycle class, but not sure.
b).Detect whether the model has uncommitted changes. I assume this is something on the Application Module, but could not figure this out.
Has anyone done something like this before?
Thanks for any insight into this.
Regards,
John

OK, gang, here's an update:
I wanted to try to, in a generic way, capture changes that have happened to the data without having to go through a change listener on each field. Since my pages are all based upon BC View Objects with underlying Entity Objects, I have cobbled together some code (with lots of stuff hard-coded for now) that is able to tell me whether the data has been modified or not. The way I have the code right now, it works if the page is based upon one view object that has one underlying entity. Extending this to a view object that has multiple entities should be relatively straightforward (just loop through all of the entities and look for modifed status, instead of looking at only the first one).
    System.out.println("Starting the test");
    FacesContext ctx = FacesContext.getCurrentInstance();
    Application app = ctx.getApplication();
    ValueBinding bind = app.createValueBinding("#{data.AppModuleDataControl.dataProvider}");
    AppModuleImpl svc = (AppModuleImpl) bind.getValue(ctx);
    ViewObject v = svc.findViewObject("InputSheetView1");
    ViewRowImpl vri = ((ViewRowImpl)vo.getCurrentRow());
    EntityImpl ei = vri.getEntity(0);
    int i = (int) ei.getEntityState();
    System.out.println(Entity.STATUS_NEW);
    System.out.println(Entity.STATUS_UNMODIFIED); 
    System.out.println(Entity.STATUS_MODIFIED); 
    System.out.println(Entity.STATUS_DELETED);   
    System.out.println(Entity.STATUS_DEAD); 
    System.out.println(Entity.STATUS_INITIALIZED);     
    System.out.println("The answer is");
    System.out.println(i);
    System.out.println("Finishing the test");Now, how to make this generic. How could I, from the page's backing bean:
1). Determine the name of the data control(s) used on the page? Alternatively, how to determine the name of the application modules used by the page? I know this information is in DataBindings.cpx, but how to find it programatically?
2). How to determine which View Objects from the AM's are used on the page? I know this is in the PageDef, but again, how to do this programatically?
Thanks for any ideas?
Regards,
John

Similar Messages

  • Reusable prompt to save changes component

    Using jsf/adf 10.1.3.4. I've implemented a reusable prompt to save changes component as described in john's blog (http://stegemanoracle.wordpress.com/page/3/). In that blog he mentions some questionable/buggy behavior regarding the dialog framework. Specifically, there's an issue with using something other than partialSubmit="true" on the component that launches the dialog box. Using something other than partialSubmit="true" on the button/link results in not being able to navigate in the return listener of the dialog. I think I'm a victim of a similar issue and wanted to see if there were any ideas/suggestions.
    I'm launching my dialog using partialSubmit = "true" on the commandButton and my navigation (in the return listener) is not working in a certain scenario. I think what is causing the navigation not to work is the fact that on my page I have an input text that fires a value change listener method, which means the autoSubmit property on that inputText is set to 'true'. If the user changes a value in that inputText (w/o tabbing out of that field) and immediately clicks the button that launches the dialog, the navigation after dialog closes doesn't happen. If I change the inputText value, then tab out (firing the autoSubmit), then click the button that launches the dialog, navigation occurs properly when the dialog closes. Am I stuck with this limitation or is there some workaround? I was also curious as to whether this type of thing has been addressed in the latest 11g version, as we're thinking about migrating our apps soon. Thanks.

    Hi kcjim,
    11g has capability for this behaviour out-of-the-box, so no need to use my approach there. I was never able to find a satisfactory solution in 10.1.3.x to the issues described.
    John

  • ADF Faces RichTable doesn't validate but still display changed data

    Hello,
    I think I miss something in the ADF Faces lifecycle management. Can you help me?
    In a adf faces/jsf page,
    1- I have a RichTable which DataModel is based on a List<Department> stored in a managed bean (session).
    2- I have a button "Cancel" with immediate=true partialSubmit=false (I don't use PPR) and an ActionMethod that does a few changes (not in the model) and return "success".
    When I modify a value in the table (that has some af:inputText) and click on the Cancel button, the underlying List<Department> instance isn't changed (Which I expect because of the immediate=true property!). But the table still display the changes I've typed in the page. How can I reverse the data displayed in the table to before my change in the UI (in a simple manner)? What do I miss?
    Best Regards
    Gregory

    Hi,
    immediate = true makes sure that the component is evaluated before all the other. In addition the value change event fires before the model update to give you the opportunity to prevent the update. I don't know what your managed bean code is doing, but the fact that the table has the update indicates the RC table component to work properly. Your table model isn't updated, which I don't think will be automatic. So I assume you will have to access the current selected row, get the row object and pass it to the list for an update
    Frank

  • Disable prompt to save file after signing

    I have created a PDF with digital signatures, then added submit button to submit form to next approver in the chain.  I do not want the signer's to be prompted to save the file locally, just forward the document with signature.  Can the prompt to save be disabled yet still send email with signature?
    Thanks,
    David

    Hi,
    You need to update the numeric value: RunState.InitialSelection.SelectedFile.ChangeCount. Add 1 if a change in your edit has occured.
    Regards
    Tom Andres Lomsdalen, CTD

  • Prompted to save changes before closing when there's been no changes

    When opening some PDFs I am prompted with thie dialog box "Do you want to save changes to .........before closing?".
    This is not displayed for all PDFs I open, just some.
    Does anyone know if there is a way I can stop this message being displayed?
    We have version Acrobat Reader 10.1.3 running on XP SP3.
    Thanks for your help.

    I don't see the "being repaired" message, but it likely just disappears before I can see it.  Given that, Adobe Reader's behavior makes sense - the document has been repaired, so it has been changed.
    The bad files I had were downloaded a while ago from ProQuest and produced by "image2pdf.c".  It looks like they were aware of the problem, because if I download the same document now, it looks the same, but the PDF file is a different size and the problem does not occur.
    Thanks for your help.

  • Preview doesn't prompt to save changes

    I have finally made the switch from Windows PC to a new iMac 21" with Mac OS X Yosemite. However I have found that any information I have entered into PDF forms on a PC is lost when Preview saves the file.
    I tend to use the excellent free Foxit PDF reader on PC but there isn't a Mac version available.
    Thanks
    Caltor

    I also have this issue on my Dell XPS 15 laptop with the Nvidia Geforce 540M and the temporary fix is turning off hardware acceleration. I do believe that this should only be a temporary fix and that the Mozilla developers should figure out a way to work around this or fix this hardware acceleration issue with the nvidia geforce 540m.

  • Prompt to Save Changes

    I am writing an application using WPF and C#. This application is using Navigation Service. I currently have a page defined which has several textboxes for the end user to fill in which will ultimately be sent to a SQL database.
    What I need to know is how to prevent the user from navigating away from the page if the information entered has not been saved. I know how to do this if were to place a button on the page which would allow the user to navigate to another page, but
    not if the user uses the navigation arrows.
    Thank you.

    The nav service raises the
    Navigating event before the request is processed. Handle this event and cancel it if you don't want navigation to continue.
    Please post further WPF questions in the WPF forums. This forum is for general C# questions unrelated to UI technologies.
    Michael Taylor
    http://blogs.msmvps.com/p3net

  • Why not Jdeveloper10.1.2  support ADF Faces?

    Thanks.

    ADF Faces is still in active development and is changing on a very regular basis with the release of Early Access builds. JDeveloper 10.1.2 on the other hand is production software and was released with production components.
    However you can plug ADF faces into 10.1.2 see the article:
    http://www.oracle.com/technology/products/jdev/howtos/10g/adfjsf/how-to-adf-faces-10gjdev.htm

  • ADF Faces : Oracle Chooses Flex

    hi
    On the home page on http://flex.org/ it says "Check out how large companies like ... Oracle ... and others use Flex ...".
    Which lead me to find ...
    - "Oracle Chooses Flex (part 1)"
    http://www.jamesward.org/wordpress/2007/11/12/oracle-chooses-flex-part-1/
    - "Oracle Chooses Flex (part 2 - BI Publisher)"
    - "Oracle Chooses Flex (part 3 - Enterprise Manager)"
    - "Oracle Chooses Flex (part 4 - Siebel CRM)"
    - "Oracle Chooses Flex (part 5 - Sales Prospector)"
    - "Oracle Chooses Flex (part 6 - Sales Library)"
    - "Oracle Chooses Flex (part 7 - Sales Campaign)"
    Also, Frank Nimphius has commented on Flex before, "Re: JDev 11 - should we start to learn Flex and ActionScript ?".
    Could someone from Oracle please remind us how all this fits in with the direction JDeveloper 11g is taking with ADF and ADF Faces?
    many thanks
    Jan Vervecken

    The standard UI technology for the Fusion apps user interface is the ADF Faces Rich Client components. This hasn't change and is the way most of the teams are developing their new applications.
    In an organization with 70,000 people it is a bit hard to make sure that all the project follow the guidelines. Unfortunately out of the about 150 projects we are building, there were a couple of projects that diverted from the standard recommended technology stack. Some of these projects are planning a migration to ADF Faces.
    Oracle continue to believe that ADF Faces RC combined with the ADF framework back-end provides the most powerful development experience.
    As far as adopting Flash - you can actually see that some of our components in 11 use Flash as a one of the possible rendering technologies - check out the graphs provided by ADF data visualization components for example.

  • Adding ADF faces in Sun studio Creator

    Pls Help me by giving step by step procedure for adding ADF Faces in sun Studio Creator. The version of ADF Faces is EA 17.

    Hi Pablo and Eric,
    Just to calrify things a bit about ADF Faces. ADF Faces are standard JSF components and are fully compatible with any JSF implementation. What you guys are asking for is tools support. Currently Sun Studio Creator is experience difficulties importing any large custom component sets to their IDE. This is due to bugs in their prodcut and the fact that ADF Faces does not come with the Sun specific configuration required to import components to their IDE. We are working with them on a new proposal for design time metadata and a solution to get ADF Faces into to the Sun SC IDE.
    But, this is ultimately a Sun issue, not a JDeveloper nor ADF Faces issue.
    - Jonas
    Jdev team

  • OBE : ADF Faces in Model project

    hi
    The tutorial "Examining ADF Business Components New Features"
    at http://www.oracle.com/technology/obe/obe11jdev/11/adfbc_new_features/adfbc.html
    says, in its "Create a New Application and Project" section, to "... set the project name to Model, and in the Project Technologies tab, shuttle ADF Faces into the Selected pane ..."
    The screenshot ADFFacesInModelProject.png shows how both ADF Business Components and ADF Faces are part of the Model project.
    - (q1) Why would it be a good idea to have both ADF Business Components and ADF Faces in the same JDeveloper project?
    many thanks
    Jan Vervecken

    The screenshot ADFFacesInModelProject.png shows how both ADF Business Components and ADF Faces are part of the Model project.Can't see any valid reason why. For what the article is trying to do , there isn't any valid reason to add Faces libs to the model project.
    Not that there's a technical limitation to this - but looks like a mistake (also causes deployment issues).
    - (q1) Why would it be a good idea to have both ADF Business Components and ADF Faces in the same JDeveloper project?if it's some ugly throaway test code.
    Not in production code anyway.

  • (2nd POST) The correct way to do "custom layout" with ADF Faces

    Hi all,
    I need the capability to do custom layout of ADF Faces page (other than the default layout we got after we drag data controls). For example I need layout like below :
    Order Number : xxxx ............................................................Gross : 999,999
    Order Date : xx/xx/xxxx ........................................................Discount : 999,999
    Customer : code - name.........................................................Tax : 999,999
    Salesman : code - name.........................................................Netto : 999,999
    (the dotted line represents spaces)
    Currently I do it with </afh:rowLayout> plus.. many..many </h:panelGrid>, so I am looking a better way. what is that ?
    Below is sample of my code :
    <afh:rowLayout>
    <h:panelGrid columns="1" width="100" style="font-size:80.0%;">
    <f:verbatim>
    Order Number.
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1" width="10">
    <f:verbatim>
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1" width="400">
    <af:outputText value="#{bindings.SphView1Spno.inputValue}"
    inlineStyle="font-size:80.0%;"/>
    </h:panelGrid>
    <h:panelGrid columns="1" width="10"/>
    <h:panelGrid columns="1" width="60" style="font-size:80.0%;">
    <f:verbatim>
    Gross
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1">
    <f:verbatim>
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1" width="100" style="text-align:right;">
    <af:outputText value="#{bindings.SphView1Gross.inputValue}"
    inlineStyle="font-size:80.0%; text-align:right;">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.SphView1Gross.format}"/>
    </af:outputText>
    </h:panelGrid>
    <h:panelGrid columns="1" width="100"
    style="padding:1.0%; text-align:left;">
    <af:outputText value="#{bindings.Valuta.inputValue}"
    inlineStyle="font-size:80.0%;"/>
    </h:panelGrid>
    </afh:rowLayout>
    <afh:rowLayout>
    <h:panelGrid columns="1" width="100" style="font-size:80.0%;">
    <f:verbatim>
    SP Date
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1" width="10">
    <f:verbatim>
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1" width="400">
    <af:outputText value="#{bindings.SphView1Spdate.inputValue}"
    inlineStyle="font-size:80.0%;">
    <f:convertDateTime pattern="#{bindings.SphView1Spdate.format}"/>
    </af:outputText>
    </h:panelGrid>
    <h:panelGrid columns="1" width="10"/>
    <h:panelGrid columns="1" width="60" style="font-size:80.0%;">
    <f:verbatim>
    Discount
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1">
    <f:verbatim>
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1" width="100" style="text-align:right;">
    <af:outputText value="#{bindings.SphView1DiscBp.inputValue}"
    inlineStyle="font-size:80.0%;">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.SphView1DiscBp.format}"/>
    </af:outputText>
    </h:panelGrid>
    <h:panelGrid columns="1" width="100"
    style="padding:1.0%; text-align:left;">
    <af:outputText value="#{bindings.Valuta.inputValue}"
    inlineStyle="font-size:80.0%;"/>
    </h:panelGrid>
    </afh:rowLayout>
    Thank you very much,
    xtanto

    Xtanto,
    yes. The way to build such layouts is to nest containers
    Frank

  • The correct way to do "custom layout" with ADF Faces

    Hi all,
    I need the capability to do custom layout of ADF Faces page (other than the default layout we got after we drag data controls). For example I need layout like below :
    Order Number : xxxx ............................................................Gross : 999,999
    Order Date : xx/xx/xxxx ........................................................Discount : 999,999
    Customer : code - name.........................................................Tax : 999,999
    Salesman : code - name.........................................................Netto : 999,999
    (the dotted line represents spaces)
    Currently I do it with </afh:rowLayout> plus.. many..many </h:panelGrid>, so I am looking a better way. what is that ?
    Below is sample of my code :
    <afh:rowLayout>
    <h:panelGrid columns="1" width="100" style="font-size:80.0%;">
    <f:verbatim>
    Order Number.
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1" width="10">
    <f:verbatim>
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1" width="400">
    <af:outputText value="#{bindings.SphView1Spno.inputValue}"
    inlineStyle="font-size:80.0%;"/>
    </h:panelGrid>
    <h:panelGrid columns="1" width="10"/>
    <h:panelGrid columns="1" width="60" style="font-size:80.0%;">
    <f:verbatim>
    Gross
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1">
    <f:verbatim>
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1" width="100" style="text-align:right;">
    <af:outputText value="#{bindings.SphView1Gross.inputValue}"
    inlineStyle="font-size:80.0%; text-align:right;">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.SphView1Gross.format}"/>
    </af:outputText>
    </h:panelGrid>
    <h:panelGrid columns="1" width="100"
    style="padding:1.0%; text-align:left;">
    <af:outputText value="#{bindings.Valuta.inputValue}"
    inlineStyle="font-size:80.0%;"/>
    </h:panelGrid>
    </afh:rowLayout>
    <afh:rowLayout>
    <h:panelGrid columns="1" width="100" style="font-size:80.0%;">
    <f:verbatim>
    SP Date
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1" width="10">
    <f:verbatim>
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1" width="400">
    <af:outputText value="#{bindings.SphView1Spdate.inputValue}"
    inlineStyle="font-size:80.0%;">
    <f:convertDateTime pattern="#{bindings.SphView1Spdate.format}"/>
    </af:outputText>
    </h:panelGrid>
    <h:panelGrid columns="1" width="10"/>
    <h:panelGrid columns="1" width="60" style="font-size:80.0%;">
    <f:verbatim>
    Discount
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1">
    <f:verbatim>
    </f:verbatim>
    </h:panelGrid>
    <h:panelGrid columns="1" width="100" style="text-align:right;">
    <af:outputText value="#{bindings.SphView1DiscBp.inputValue}"
    inlineStyle="font-size:80.0%;">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.SphView1DiscBp.format}"/>
    </af:outputText>
    </h:panelGrid>
    <h:panelGrid columns="1" width="100"
    style="padding:1.0%; text-align:left;">
    <af:outputText value="#{bindings.Valuta.inputValue}"
    inlineStyle="font-size:80.0%;"/>
    </h:panelGrid>
    </afh:rowLayout>
    Thank you very much,
    xtanto

    Unfotunately nesting layouts or creating custom layouts is the best approach at this time. You may want to take a look at the folloing library to replace of your verbatim tags.
    http://jsftutorials.net/htmLib/

  • ADF-Faces Migration from EA11 to EA13

    I tried to migrate my ADF-Faces application from version EA11 to EA13. Change taglib definition in *.jspx and some changes at tag level (e.g. showOneTabs). Recompile everything and deployed it to an OC4J 10.1.3. Deployment OK, but if I try to contact my application I got following error:
    javax.servlet.jsp.JspException: oracle.adf.view.faces.context.AdfFacesContext.getAgent()Loracle/adf/view/faces/context/Agent;
         at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:117)
         at index2e_jspx._jspService(_index_2e_jspx.java:49)
         [SRC:/index.jspx:8]
    Please tell me what's wrong!
    Thanks, Peter

    I got it!
    The reason was, in directory ../public_html/WEB-INF/lib there was still a jar (adf-faces-api-ea11.jar) from the old EA11 (only this one - funny), and this jar was also included in deployed WAR. I removed this old jar, deploy my application again and the error no more occures.
    Thanks!

  • Prompts for save chages even if it is an EXE

    Hi All
    I have a program which I made into an exe but when the program closes the front panel to exit, it will prompt to "Save changes". 
    Some items on the panel are repositioned when it is running and I do not need to save the changes.  But I dont understand why it will ask this even if the program is turned into an EXE
    Any ideas on how to stop the "save changes" prompt from comming up?

    I haven't tried this but try adding a revert vi method in your clean-up/shut down code since you don't want to save the changes anyway- tossing em out seams sensible.
    Whoops revert method won't work(not available in run-time not writable while running)
    Hmmmm....
    Jeff

Maybe you are looking for