Redirect the loading of the page (table-driven rules)

ADF 11 GR 1 material PS1

Hi all

On some pages, I need to redirect the user based on a table, based on rules (for example the page is live only between dates x and y, etc.). Because there will be many pages with this feature, as well as configuration of table in which concerns rules (for example what page is affected, what dates are valid, the user, the what url should be redirected to), and because this can happen for both consolidated and submitted tasks, I do not know if you are using a router is the best way to do it.

By this thread
Redirect in adfc

I would try to do it via a bean method that is called when the page is loaded. Here's what I can't understand:

(1) is there a way that the method of beans can include the name of the calling page?
(2) how to call the method of bean on loading the page that would allow a redirect.

About #2, in the previously mentioned thread, someone said a PhaseListener on RESTORE_VIEW, but I do not understand how to do that.

Thank you.

Hello

the phase RESTORE_VIEW after can be listened to in a PhaeListener that you configure in the file faces - config.Xml. This phase RESTORE_VIEW has access to the FacesContext and so the ViewRoot, which provides information on the requested viewId. You can then change the this ViewRoot ViewId depending on your needs of redirection.

A router activity is recommended here because the use case you describe is conditional navigation. So if you need to have the logic in a managed bean, then why don't you point the case of the router?

Frank

Tags: Java

Similar Questions

  • confirm the dialog box and to redirect the page when a button is click

    Try to cancel a button would pop up a confirmation dialog box if ok redirect as 1 page (homepage)

    I tried to copy the code
    JavaScript:apex.confirm ("are you sure you want to cancel ', 'CANCEL'");

    but im having a hard time finding how to redirect the page.

    I guess you get the page shown.

    If so, then create a branch with a Condition where ask = CANCEL and go to the redirect page to. Make sure you to another branch does not exist with a lower sequence that would fire until this new branch may trigger.

    Be sure to mark answered questions if in fact they are.

    Published by: Bob37 on January 18, 2012 09:48

  • submit the form and redirect the page at the same time?

    Im having abit of trobble trying to get a form to present, then redirect the page. Its for a contest, so when they complete the form, click on submit, it comes up with a "congratulations msg'..."

    Help would be appreciated, by a factor here

    Yes, check with your host. They often provide scripts for your hosting plan details.

  • Redirect the Page programmatically

    Hello

    How can I redirect page by programming?
    I mean if I have processes of pl/sql that contains the 'IF' condition, how can redirect the page depnding on this condition?

    Thanks in advance

    Create a branch.
    Branch of Service Type back Page...

    Write a pl/sql function this page back not...

    if condition then
       return 1;
    elsif condition then
       return 2;
    ....
    else
       return 10;
    end if
    

    Kind regards
    Shijesh

  • After the loading of the page table to display an another componet

    I have use cases

    A table of the ADF is bordered to read only the object view and table a toolbar that

    < f: facet name = "toolbar" >
    < af:toolbar binding = "#{MyBean.downloadTableToolBar} '"
    Visible = "false" >
    < af:commandToolbarButton shortDesc = 'delete '.
    Icon="/images/icon_delete.gif".
    action = "#{MyBean.deleteFile} '"
    Binding = "#{MyBean.deleteFileButton} '"
    Visible = "false" >
    < af:showPopupBehavior popupId = "p1" / >
    < / af:commandToolbarButton >
    < / af:toolbar >
    < / f: facet >

    What I want to do is loading the page and table is also get filled and first line of the table is selected automatically, the visibility of the commandToolbarButton 'delete' is available depending on some condition check as if the user is the owner of the line (there is no ADF in place security), I am able to do when the line is changed after loading using RowSelectionListener , but how to handle when the initial page loading?

    Published by: shibi.ns on June 22, 2012 09:52

    You can have a phase listener method that is called when the page is loaded. Set the visible property for the button according to your logic & do the logic needed by this method.

    TestPage.jspx:

    
    
        
        
            
                
                    
                        
                        
                        
                            
                        
                        
                        
                    
                
            
        
    
    

    TestPageBean.java:

    package com.samples.view;
    
    import javax.faces.event.PhaseEvent;
    
    import oracle.adf.view.rich.component.rich.nav.RichCommandButton;
    import oracle.adf.view.rich.context.AdfFacesContext;
    
    public class TestPageBean {
        private RichCommandButton deleteButton;
    
        public TestPageBean() {
        }
    
        public void setDeleteButton(RichCommandButton deleteButton) {
            this.deleteButton = deleteButton;
        }
    
        public RichCommandButton getDeleteButton() {
            return deleteButton;
        }
    
        // METHOD THAT IS INVOKED WHEN THE PAGE IS LOADED
        public void phaseListener(PhaseEvent phaseEvent) {
            if (phaseEvent.getPhaseId().equals(phaseEvent.getPhaseId().RENDER_RESPONSE)) {
                if (!AdfFacesContext.getCurrentInstance().isPostback()) {
                    // DO THE NECESSARY LOGIC AND POPULATE THE VARIABLE isDeleteButtonVisible
                    Boolean isDeleteButtonVisible = false;
                    if(this.deleteButton != null){
                        this.deleteButton.setVisible(isDeleteButtonVisible);
                    }
                }
            }
        }
    }
    

    Thank you
    Nini

  • any solution for wyciwgn redirects the page?

    Whenever I chose Web site 'http://www.dittomusic.com/dittomusic', 'wyciwgn' of Firefox performs some type of redirection, then displays the note: 'www.google-analytics.com data transfer '. The page never loads and the message does not go away. This also happens on other sites. Most recent pages including displays wyciwgn://1/http://www.dittomusic.com/dittomusic , my antivirus scans indicate zero points and also our anti-virus software is updated.

    This site makes it OK in IE 7 +, any suggestions on what is happening here? Can there be something that requires activation or deactivation?

    The wyciwyg: Protocol (what you Cache is What You Get) is used internally to access the pages in the cache and you should never see it normally.

    Clear the cache and cookies from sites that cause problems.

    "Clear the Cache":

    • Tools > Options > advanced > network > content caching Web: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Tools > Options > privacy > Cookies: "show the Cookies".

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance).

    • Do not click on the reset button on the start safe mode window or make changes.
  • How can I redirect the page to the URL of another whenever I hit the Cancel button for the site of windows authentication in sharepoint.. ?

    I'm trying to redirect the error page 401 for the SharePoint site to windows authentication?

    Hello

    I suggest you to report the problem in this forum:

    http://social.technet.Microsoft.com/forums/EU/sharepoint2010setup

    It will be useful.

  • Apex 5 after execution of a dynamic action, want to display message and redirect the page

    Hello Experts,

    I use 5 Apex on XE 11 g.

    One of my page, I have 1 button that performs a dynamic action.

    Right now, I've added two real actions on the key. First of all is PL/SQL code, and the second is on the alert, which shows the success message.

    I want to show the message (box Apex message and not the simple alert message JavaScript box) on successfully executing this dynamic action and post that redirect to another page.


    Can someone help me please in the present.


    Thank you

    Thierry

    Thierry says:

    I use 5 Apex on XE 11 g.

    One of my page, I have 1 button that performs a dynamic action.

    Right now, I've added two real actions on the key. First of all is PL/SQL code, and the second is on the alert, which shows the success message.

    I want to show the message (box Apex message and not the simple alert message JavaScript box) on successfully executing this dynamic action and post that redirect to another page.

    Use the simple way to do this:

    • A button that submits the page rather than perform a dynamic action
    • A process of PL/SQL after presented with the necessary success message page
    • A branch to the landing page with the option include the success process message verified

    General management and the process should be contingent on the button that is clicked.

  • How to redirect the page when custom authentication is on?

    Hello gurus:

    I'm working on a APEX 4.2 x asks, when the authentication scheme is set to Custom - which means, the validation is done through a PLSQL package against a custom table.

    I have 3 buttons on the homepage viz, Login, forgotten password, register. This page has nothing other than these three buttons.

    If I click on the " login " button, it takes me to the login page. If I click on the forgotten password button, it takes me to the password screen. However by clicking the register button, only takes me to the login Page.

    I don't understand why this happens. Can anyone help?

    Thank you

    Srini

    Srini.Ramanujam wrote:

    I'm working on a APEX 4.2 x asks, when the authentication scheme is set to Custom - which means, the validation is done through a PLSQL package against a custom table.

    I have 3 buttons on the homepage viz, Login, forgotten password, register. This page has nothing other than these three buttons.

    If I click on the " login " button, it takes me to the login page. If I click on the forgotten password button, it takes me to the password screen. However by clicking the register button, only takes me to the login Page.

    I don't understand why this happens.

    This happens if the registration page requires authentication. The page must be accessible to the public.

  • Repeat all the page tables

    I have four tables in the model.

    I want to display the first three pages and the fourth table (which also has lines of repeatng) to be displayed after three early paintings.

    I don't want to use the concept of the header.

    This is possible.

    AJ

    Send me the model to [email protected] and I'll take a look.

    Thank you!

  • How to redirect the page using af: Poll?

    Hi people,

    How to redirect the jsf page to another page, after af:poll run a method?

    For example:

    The user is connected to A page, after 5 minutes of af: poll of the object, an execute method. This method must redirect page A to page B...
    Is this possible?

    Thank you

    Hi William

    Create a pollListenerMethod in backing bean code using a code like this:

    public void poll1_pollListener (PollEvent pollEvent) {}
    ExternalContext ectx is FacesContext.getCurrentInstance () .getExternalContext ();.
    HttpServletResponse response = (HttpServletResponse) ectx.getResponse ();
    response.sendRedirect ("http://domain.com/app/faces/index.jspx");
    }

    Good luck

  • Passing a value of item to another page via the button set to redirect to the page

    Hello

    I'm new to APEX and I develop an application to manage Oracle database user accounts.  I have a (8) page that has text elements for the user name and the database name.  I have a submit button (this works very well) who deliver... the ALTER USER statement to reset his password and unlock the account.  I have another button that if:

    1. get the value of username - P8_USERNAME
    2. assign to an element of application - FIND_USER_IN_DB
    3. redirect the page application - page 11

    The issue is that FIND_USER_IN_DB does not get filled and page 11 which is a simple report with the following query:

    SELECT *.

    OF valid_db

    WHERE username =: FIND_USER_IN_DB;

    How to achieve this?

    Thanks for your help.

    Steve

    A page redirect is actually nothing more than the rendering of an anchor tag or call apex.navigation.redirect. The link provided by these is generated when the page is rendered. Thus, when the page is rendered (in charge) and P8_USERNAME session state is NULL, then the link will be an empty value. There is nothing sad about the fact that when you change the value of the element on a page that session state will not change automatically and it's just about understanding session state.

    Let's say that you will present the session before the redirection if status point. Would it change anything? N ° the link, as I pointed out, has already been made, and no substitution of session state not be made on a redirect.

    You'd better be off by submitting the page via the button instead of a redirect. This will set the session state of your object to the desired value. You can then use a branch to redirect to the correct page setting the value of an element whose state of session of P8_USERNAME. You can even choose to use a process or a calculation to set the value of the application instead of by a link element, so that you can keep the application not manipulable by the user element.

  • How will I know which pages are selected in the Pages panel?

    I have a JavaScript that exports each page of the separate document as PDF file. I would do the same thing, but with a script that exports only the selected pages in the Pages table. Is there a way to tell which pages are selected in the Pages panel? Thanks in advance.

    -Rick

    I asked a similar question here: information on signs in Javascript

    The answer, @Harbs, was not. You could do your own dialog box to allow users to select pages, but it doesn't seem to be possible to integrate with the existing this way Committee.

  • Determine the area of the page through FacesContext

    11 g, what is the best way to determine which region (jsff) is currently used?

    In 10g to provide ' Condition conditional Requery "I used to use #{facesContext.viewRoot.viewId} on the group in order to check if the table or view for the form has been used. It works fine for the stand-alone pages, but not for the new regions. How can I accomplish the same thing?

    The other place, I need this feature is for wizards where I re - uses a group of detail between two pages of the various Wizard (regions). On the entry page, the details group is editable, but on page summary of the Group should be read-only. For this, I was able to duplicate of the retail group classes, do a modifiable and a read-only and use different groups on different pages always pointing the same data collection. I would fix the "Update Allowed" property instead such that I could use the same group in two different regions.

    Thank you very much!

    See you soon,.
    Brent

    Brent,

    You can use

    #{controllerContext.currentViewPort.viewId}

    This will return strings such as "/ EmployeesTaskFlow/EmployeesTable" for the page table and "/ EmployeesTaskFlow/employees" of the form page.

    Steven Davelaar,
    JHeadstart team.

  • Several namespaces in the document of a rule

    I'm a newbie using the OPA, to write rules for the first time. I see that I can use the "entity"s as a namespace for my attributes." I created two namespaces (entities): "Vehicle" and 'Speed up the rules'.

    The rules Table (marked italic) fails with the validation of message "" Vehicle"is not available here. You must use the function of the entity to designate the "vehicle category" ' if I change the namespace of the maximum road speed [km/h] rules of speeding to the vehicle, validation passes. How I use multiple namespaces?

    Thank you

    George

    Speeding rules Max road speed [km/h]

    120 vehicles of category = 'B' or

    Vehicle category = "A".

    80 vehicles of the class = "C".

    Otherwise 100

    Vehicle category = 'B', if

    Vehicle wheels = 4 and

    Vehicle weight [kg] < 3500

    Vehicle category = 'A' If

    Wheels = 2

    Vehicle category = 'C' If

    Vehicle wheels = 4 and

    Weight [kg] > = 3500

    Maybe I can help some too.

    Support in the first table on rules of speeding, it's that there is only one vehicle, Correct?  If so, then change the relationship between Global and vehicle a "one-to-one" rather than "a lot" and it will compile.  Problem solved.  This relationship is probably called "all the instances of the vehicle."

    Unfortunately, you may miss some nuances related to entities and word tables.  The nuance is why OPA is complaining about your rules.  OPA does not know the rules 'who' vehicle to the Basic acceleration on.  OPA has assumed that there could be a lot of vehicles on the road.  My tip above simply removed the ambiguity, allowing only a single vehicle.  So, OPA was actually somewhat intelligent.  If you want a lot of vehicles, then we must discuss the relationship between the rules of speeding and vehicles with a little more clarity.

    I also recommend to vehicle category rules in a word table.  Thus, there is nuance here, but you will usually find more sensible things if Boolean values are put into word or excellent tables.  Anything that can hold an "else" clause can be a good candidate for a table.

    Finally, if you need only one of something, then as a "general rule" (which I constantly violates myself to model clarity), you probably don't have an entity...

Maybe you are looking for