Restrict navigation on the basis of value

There is a supplier table. If the status of the supplier row is DRAFT or NEW, then only will I be able to see the details of it by clicking on a commandlink. For this, I had attached a property listener to get the value #{row.Status} and then wrote the logic code in the ActionListener property of the commandlink as below.
public void moveToDetailPageBasedOnStatus(ActionEvent actionEvent) {
        DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
        Map map = bc.getParametersMap();
        String status = ((DCParameter)map.get("p_status")).getValue().toString();
        if (status.equals("DRAFT")) {
            FacesContext context = FacesContext.getCurrentInstance();
            context.getApplication().getNavigationHandler().handleNavigation(context, null, "create");
        } else {
            FacesContext context = FacesContext.getCurrentInstance();
            FacesMessage msg2 =
                new FacesMessage(FacesMessage.SEVERITY_INFO, "", "User can see the details of an Issue in DRAFT Status only.");
            context.addMessage(null, msg2);
    }Then I read the comment by Frank Nimphius in the post below, saying that "+Why don't you use a method call activity or (even better) a router) if it is all about directing different users to different views? The approach of using HandleNavigation is not optimal+".
FacesContext context = FacesContext.getCurrentInstance();
            context.getApplication().getNavigationHandler().handleNavigation(context, null, "create");
http://www.adftips.com/2010/10/adf-ui-navigating-to-next-page.htmlSo then I am passing a parameter to a bounded taskflow where I am defining a pageFlowScope parameter, and then created a method call activity, set it as the default activity. The code is almost the same.
public void checkIssueStatus() {
        String value = (String) ADFContext.getCurrent().getPageFlowScope().get("p_status");
        if ((value.equals("DRAFT")) || (value.equals("NEW"))) {
            FacesContext context = FacesContext.getCurrentInstance();
            context.getApplication().getNavigationHandler().handleNavigation(context, null, "checked");
        } else {
            FacesContext context = FacesContext.getCurrentInstance();
            FacesMessage msg2 =
                new FacesMessage(FacesMessage.SEVERITY_INFO, "", "User can see the details of an Issue in DRAFT Status only.");
            context.addMessage(null, msg2);
    }The problem is in case the p_status is other than NEW or DRAFT, the message is getting displayed, but then detail page is also shown. I only want to display the message only and not navigate to the next page. How to resolve this issue?
And the big question: Is my approach correct and optimal this time?

No as you already know it the same approach you used before.
In your task flow you use a router element as start activity wher you check the parameter using EL and depending on the outcome navigate to the view you like.
<?xml version="1.0" encoding="UTF-8" ?>
<adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
  <task-flow-definition id="router-task-flow-definition">
    <default-activity>router1</default-activity>
    <router id="router1">
      <case id="__1">
        <expression>#{pageFlowScope.pStatus eq 'NEW'}</expression>
        <outcome>outcome1</outcome>
      </case>
      <case id="__2">
        <expression>#{pageFlowScope.pStatus eq 'INIT'}</expression>
        <outcome>outcome2</outcome>
      </case>
      <default-outcome>outcome3</default-outcome>
    </router>
    <view id="view1"></view>
    <view id="view2"></view>
    <view id="view3"></view>
    <control-flow-rule id="__3">
      <from-activity-id>router1</from-activity-id>
      <control-flow-case id="__4">
        <from-outcome>outcome1</from-outcome>
        <to-activity-id>view1</to-activity-id>
      </control-flow-case>
      <control-flow-case id="__5">
        <from-outcome>outcome2</from-outcome>
        <to-activity-id>view2</to-activity-id>
      </control-flow-case>
      <control-flow-case id="__6">
        <from-outcome>outcome3</from-outcome>
        <to-activity-id>view3</to-activity-id>
      </control-flow-case>
    </control-flow-rule>
    <use-page-fragments/>
  </task-flow-definition>
</adfc-config>This way the navigation is handled by the controller without using the navigation handler.
A full sample you can find here: http://tompeez.wordpress.com/2012/12/01/jdeveloper-11-1-1-5-0-use-router-to-create-new-row-or-edit-existing/
Timo

Similar Messages

  • Changing the report displayed on the basis of value selected frm the prompt

    Hi,
    I have requirement in which there is dashboard prompt which has three columns namely year, month and report name.
    The user will select the report name from the prompt, once done the report that has been selected should show up
    on the dashboard page and he should be able to select data on the basis of month and year from it.
    Also, if the user wants to go to the other report he should be able to select it from the prompt and view it.
    Pls shed some light on how to progress about it. As of now think if something like this is possible then it would definitley
    need two prompts one for report name and the other for month and year.
    Thx :)

    Hi Kishore,
    When i click on the link given by you it takes me to a page where a link is given with text as under
    Oracle BI 10.1.3.3/2 - Selecting Reports from Dashboard Prompts and Guided Navigation Sections
    And when i click on this nothing opens up.
    Thx
    Edited by: Phantasm on Jun 22, 2010 3:05 AM

  • Filtering one dropdown on the basis of value from another dropdown in WAD

    Hi All,
    i have a bw dropdown called 'Corporate' and another called 'Facility'. there can be several facilties under a Corporate.
    what i need to do is filter the facility dropdown on the basis of the value selected in the corporate dropdown.
    thanks in advance
    Godhuli

    Hi Godhuli,
    You can achieve this by the following procedure.
    For your Corporate dropdown you need to specify a DataProvider.
    For Your Facility dropdown you need to specify a Dataprovider.
    For the Corporate dropdown there is a property "Affected DataProvider".
    In that property select the DataProvider of your Facility dropdown.
    So now when you select Corporate your Facility will get filtered by the values for that selected Corporate dropdown value.
    Hope it helps.
    Regards,
    Parth.

  • How does WebLogic 8.1 get the BASE HREF value?

    We have a WebLogic 8.1 SP4 server with a Juniper DX load balancer in front. We are trying to get Juniper to handle all the SSL traffic for the WebLogic application. Between Juniper and WebLogic, it would be just HTTP and between Juniper and web clients it would be HTTPS. One of the main issues we are seeing is that Struts HTML:BASE tag is returning the Juniper address as we expected, with the correct SSL port and application context/paths. However, the protocol for this base href is set to HTTP and not HTTPS. Consequently, our pages do not load properly.
    I am trying to understand where this value comes from. The underlying code uses request.getScheme() to get the protocol. So, we could "customize" the tags to work around this, but that is a hack that I am trying to avoid. I assume that the HTTP stack that WebLogic 8.1 uses is providing this info from the HTTP request. Does this come from the web browser? How does WebLogic get this to put it into the request object in the web container? We have sniffed the HTTP headers on the web client side and we cannot see where this is coming from.

    I remember facing a similar issue with webloigc 8.1 and apache
    I dont think its a problem with the tag..
    I think i have changed the transport-guarantee in web.xml
    If you have NONE try setting that to CONFIDENTIAL and vice versa

  • Populate texbox from list on the basis of value in another textbox

    To achieve the above situation i have used the ontextChanged event of textbox.
    But the problem is on postback the value in another texbox get lost .How to handle it ?
    Any Suggestions?

    Hi,
    I had tested again per your description,
    called the same OnTextChanged method for both the textboxes, they were still worked well.
    When I type the value in the first textbox, the second auto populate the value, and vice versa also.
    Test1:<asp:TextBox ID="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged" AutoPostBack="true"></asp:TextBox>
    <br/>
    Test2:<asp:TextBox ID="TextBox2" runat="server" OnTextChanged=”TextBox2_TextChanged” AutoPostBack=”true”></asp:TextBox>
    protected void TextBox1_TextChanged(object sender, EventArgs e)
    TextBox2.Text = TextBox1.Text;
    protected void TextBox2_TextChanged(object sender, EventArgs e)
    TextBox1.Text = TextBox2.Text;
    You can create a new simple project, then check whether it works.
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Issue with sorting results on the basis of specfic values.

    Hello,
    I written an sql that will sort the results on the basis of values defined in 'IN' clause. I have made use of CASE statement in ORDER BY clause. Its not functioning. My code is:
    SELECT GWLO.productcode,
              GWLA.parentsampletype,
              GWLO.sampletype SampleType,
              max(GWLA.loginid) Loginid,
              max(GWLA.modifiedts) modifiedts
         FROM gwloginattribvars GWL,
              gwloginkeyvals GWLO,
              gwloginkeysadmin GWLA
         WHERE GWLO.productcode = GWLA.productcode
              AND GWLO.sampletype = GWLA.sampletype
              AND GWLO.productcode in ('1002124', 'ABPG', 'ABIG')
              AND GWLO.sampletype <> 'CERTIFICATE-OF-ANALYSIS'
              AND GWLA.parentsampletype IS NOT NULL
         GROUP BY GWLO.productcode, GWLA.parentsampletype, GWLO.sampletype
         ORDER BY
              (CASE GWLO.productcode WHEN '1002124'     THEN 1
                   WHEN 'ABPG'     THEN 2
                   WHEN 'ABIG'     THEN 3
                   ELSE 'LL'
                   END) ASC
    I expected the results to be in sequence what it is defined in CASE - ORDER By clause. This code is givin me error. The error is
    (CASE GWLO.productcode WHEN '1002124' THEN 1
    ERROR at line 16:
    ORA-00907: missing right parenthesis
    Please help. Thanks!

         ORDER BY
              (CASE GWLO.productcode WHEN '1002124'     THEN 1
                   WHEN 'ABPG'     THEN 2
                   WHEN 'ABIG'     THEN 3
                   ELSE 'LL'>                END) ASC
    Can u just explain me in this context? I think it should be another number in the else part - since you are returning numbers in all the 'WHEN' option. Pls explain it.
    Regards.
    Satyaki De.

  • How to order CM25 profile on the basis of a field values?

    Hi,
    I'd like to order a capacity planning table on the basis of values (decreasing) of the field USR02, that is already present in the table. Where could I set that records must be shown in that order? I attach a screenshot to explain you better my scenario
    Thank you.
    Angelo

    Hi Angelo,
    Try to use t-code OPDT and define a sort criteria profile with field USR02, after that assign the sort profile into your list profile (With t-code OPD0). Hope it can help you!
    Best regards
    Tao

  • Order colour in CM25 on the basis of

    Hi,
    I'd like to use a different colour on the basis of value in field Priority. Is it possible?
    Thanks

    Hi Angelo,
    Please check below screen:
    you can maintain as per Network Profile but i dont think that according to Priority its possible in standard.
    thanks
    Sunil

  • Can we limit the search count in Webcenter Imaging on the basis of user/grp

    Hi All
    I have a scenario wherein i want to limit the search count in Webcenter Imaging 11g on the basis of user and group.
    For e.g if administrator searches for documents it should return all the search result, whereas when a noraml business user searches for the document only 1000 documents should be returned as search results(if exact search criteria is not met).
    I am aware of the General setting in Enterprise Manager, but i want to restrict it on the basis of user.
    Can somebody help me, it's really very urgent.
    Thanks
    ACM

    Hi
    This is very important and i am not able to figure a way out of this.
    Is this a Product Feature and can not be altered?
    Please help
    Regards
    ACM

  • Particular data in a report, on the basis of the values (0, 1) of a dashboa

    hi
    User should be able to see the particular data in a report, on the basis of the values (0, 1) of a dashboard prompt.
    For e.g. if the user selects 0 then current years data should be filtered out
    and if the user selects 1 then rest all years data should be displayed in a request.
    give me hint regarding this question

    Hi,
    I hope this will help you
    http://oraclebizint.wordpress.com/2008/01/17/oracle-bi-101332-selecting-reports-from-dashboard-prompts-and-guided-navigation-sections/
    In this example he used prompt for selecting Region sales and Brand sales which you can replace with 0 and 1
    Phani.

  • How can i restrict the Expenditure Type values at a specific OU ?

    Dear Guys,
    I would like to ask about the Expenditure Types,
    I have implemented two projects for different Operating Units ,
    when navigating to any Projects responsibilty,and navigating the Expenditure Type field
    the values exist are all the values implemented across the OU not the values entered at this OU
    How can i restrict the Expenditure Type values at a specific OU
    Regards
    Amr Hussien

    Hello
    When you set up a project there is an option called Transaction Control.
    This option allow you to list the allowed or restricted elements of costs for the project.
    You may enter the transaction control on a project template and that will be copied to any new project.
    The cost elements may be expenditure types, expenditures categories, suppliers, employees, etc.
    In your case, I suggest to set up specific project templates for each operating units. On each template enter the list of allowed expenditures types for that OU.
    Doing so, the system restricts users from entering any expenditure item, supplier invoice, purchase cost etc, against an expenditure type, which is not allowed.
    Dina

  • Purchasing: Restriction of creation of PO's on the basis of buyer / user

    Hi,
    We are currently working on a requirement in which the business is expecting to restrict the buyers / users from creating Purchase Orders of some specific GL natural accounts.
    Is there any functionality using which we can provide lock / check on this.
    As the business wants to achieve this lock, since the users (buyers) are using the same responsibility and those responsibilities might have their own independent locks on the usage of Balancing Segment Values and other Cross Validation Rules.
    But, we are looking for something specific which will restrict the creation of PO's based upon the login of user / buyer / PO Creator itself.
    Any inputs in this regard shall be of great help.
    Regards,
    Saurabh Singhal.
    Bangalore, India.

    Pl do not post duplicates - Purchasing: Restriction of creation of PO's on the basis of buyer / user

  • Restrict the list of values retrieved by a model driven LOV

    hi all
    i'm try to restrict the list of values retrieved by a model driven LOV just like the article in this link
    http://www.oracle.com/technology/products/jdev/tips/fnimphius/restrictlovlist/restrictlov.html
    and i'm using the jdev11.2 but i always get this error
    java.sql.SQLException: parameter IN or OUT is missing at index 1
    my code is :
    public void SetSchoolLovVar(LaunchPopupEvent launchPopupEvent)
    String var_val=getOt7().getValue().toString();
    System.out.println("++++++++++++++++++++++++++++++++"+var_val);
    BindingContext bctx = BindingContext.getCurrent();
    BindingContainer bindings = bctx.getCurrentBindingsEntry();
    FacesCtrlLOVBinding lov = (FacesCtrlLOVBinding)bindings.get("DeptCode");
    System.out.print("LOVE "+lov);
    System.out.println("+_+_+_+_+__+_+_+__+_+_+_+_+_+_+_+_+_+_________+++++_+_+_"+lov.getName());
    lov.getListIterBinding().getViewObject().setNamedWhereClauseParam("Rejon_For_Prj_Dept",var_val);
    Rejon_For_Prj_Dept is the bind variable of the Lov Query.
    any good idea

    Hi,
    The error might be due to making the bind variable as required but not using it in the vo query. Edit the bind variable and make it as optional by unchecking the required checkbox.
    Sireesha

  • How to set the where clause of a value set on the basis of a form field

    I am using a DFF(Descriptive FlexField), which needs to display the value of a certain column(say columnA) on the basis of the value of another column(say columnB).
    So i have created a value set which points to the table which has both these columns, and the DFF uses this value set. However, the problem is that I have not put any where clause in the value set, because of which i cannot handle the exact fetch returns more than one rows error.
    The query has to be as follows:
    select ColumnA from tbl where ColumnB = [ a form value ];
    What I want to know is how can i get the value of a certain field of a certain block of the form in the above query.
    Edited by: 981615 on Jan 14, 2013 12:48 AM
    Edited by: 981615 on Jan 14, 2013 12:48 AM

    Just have a look over these two statements if it solves your problem
    one time where clause
    Set_Block_Property('BLOCK_NAME',ONETIME_WHERE,your form item);
    dynamic where clause
    set_block_property('BLOCK_NAME'default_where, your form itme)
    you can where clause at run time from any procedure or some triggers

  • Pricing on the basis of specific group of materials by cumulating values

    Dear SAP Gurus,
    There is a requirement to cumulate the values of a certain group of material AND provide discount on the basis of that on the sales order.For example ,
    group 1 =mat A mat B if 1000 give 5%
    group 2 =mat c mat D if 2000 give 10%
    So at sales order
    mat A 1000
    mat B  500
    mat C  400
    In this situation ,group 1should be activated only and discount should be given and distrbuted on A and B.What will be the method and condition type for this situation.
    Regards,
    Sam Ahmed

    This is part of standard SAP pricing functionality.
    In V/06 check K029.
    Important fields to be activated are -
    In V/06, for your cond type
    Group condition
    Scale basis
    Create Material pricing gr. = G1
    and give it in MMR, MM02, Tab Sales: Sales Org 2, field "Material pricing group" in Materials A, B
    Then create the cond record in VK11 for your cond type (e.g. K029) with scales.
    If all settings are correct, then for sales order
    Mat A shall get discount
    Mat B shall get discount
    Mat C shall NOT get discount

Maybe you are looking for

  • How do I play one album at a time by an artist?

    I have the newest generation ipod touch and i just downloaded the new iOS7.  I would like to play one album at a time by an artist for whom i have multiple albums, but the new design won't let me do it (easily that is).  For example, if I want to pla

  • Preview freezes up when opening a pdf

    Preview freezes when I open a pdf. I have to do a force quit to move on. Help

  • How do I stop desktop icons appearing from the right?

    I'm new to Mac (and loving it!) but when new items (drives, downloads, etc) are added to my desktop that appear on the right hand side (unlike Windows which adds from the left). Now I like to keep the Twitter app open on the right hand side of the sc

  • Swing/Adding Menu's To Layout.

    Hi, I'm having problems trying to add my menu into the frame. I've tried many different options? Put i've been getting no where. I need to also ad BGView as well. Any thoughts? I need to have it split up into 2 classes as well. //---Code---// import

  • IPod Touch 4.0 Spotlight Problem

    I upgraded my iPod Touch to 4.0 - really please with many aspects. The folders, email & locking screen orientation are great. I don't quite get the multi tasking bit. I know a double click brings up the programs that are running in the background - b