Validation as well as button set a value of adf faces

Hi all

I have an afform with user input fields. I want to provide a feature with 2 buttons depending on the role
Role: user
There are two buttons at the bottom of the 'Save' and submit form"
When the user clicks on the button Save the record should be committed to the database with a 'SAVE' value inserted in the status column (there is an attribute of the State in the VO that is based on the form but not visible by the user)
Similarly when the user clicks on the button "submit" to the folder should commit to the database with a "SENT" in the status column value.

Role: Manager
There are two buttons at the bottom of the form "Approve" and reject"
When the Manager click the approve registration should be updated in the database with only the value of the status column changing of "SENT" to "APPROVED".
The same for the rejection that the value of the status column should be updated to "SUBMIT" to "REJECTED".

How can I do this?

Thanks in advance.

Hello Adam Pandya.

Used four buttons to solve this use case. "" When the connection of the user show that two button which are 'Save' and submit "and when the role is Manager login show"Approve"and reject". Put condition on each rendering of button property that would be security.userInRole ['User'] for the user and securityContext.userInRole ['Manager'] for the Manager.

Then create four method in backing bean and bind the method to each button. By clicking on the set button the corresponding value in the Status attribute in the VO.

Thank you
Prateek

Tags: Java

Similar Questions

  • With Radio buttons set point values

    I have a radio button that will have either the value of 1 or 2.
    I have 2 items page, one is a selection list and the other a text field.

    What I have to do is, if the radio button value = 1, the select list must be set to 1 and the text field should be disabled.

    I can't disable the text field with no problem using

    [function NMTRadio (pThis) {}
    Test = pThis.value is '1'
    html_disableItems, 'PXX_PRICE');
    }
    ]
    [onChange = "javascript:NMTRadio (this);] »

    I can't change the value of the selection list. I've tried several things, but to no avail.

    See you soon

    Gus

    Gus,

    Try this:

    function NMTRadio(pThis) {
      if(pThis) {
        var lVal = $v(pThis);
        if(lVal == 1) {
          // If radio value is equal to 1...
          $s('P1_SELECT', 1);
          $x_disableItem('P1_TEXT', true);
        } else if (lVal == 2) {
          // What do you want to do when the radio is equal to 2...
    
        }
      }
    }
    

    Also, you don't need the "javascript:" prefix in the Manager of "onchange". This prefix is used only when JavaScript is called on a URL.

    It will be useful.

    Ant.

  • Option button setting the value of digital field display

    I have a Radio button with two elements, if the first button is selected, and then the numeric field should display as a monetary value ($x, xxx.xx) but if the second button is selected the numeric field should show as General numbers (x, xxx) with no decimal point.

    Any help would be greatly appreciated.

    Hello

    You can change the display model at run time, but it requires a bit of scripting.

    There is an example here: http://assure.ly/hVcqlj, if you have a look at the radio buttons on page 2. There is script in the click event that should help you.

    Hope that helps,

    Niall

    Ensure the dynamics

  • Problem of setting a value for the hidden item click on the button with processes action or pl/sql dynamic

    Apex 4.1

    Oracle 11g

    I have a page which consists of a main and several sub-regions area.  I have a pl/sql process in after the header SET_DISPLAY(:P400_DISPLAY:='MAIN';))

    Three subregions have a contional show where P400_DISPLAY = STORE.  It works in the hiding of the sub regions.

    Now, I want to change the value P400_DISPLAY to the STORE to show the subregions when I hit a button.

    I tried to create a dynamic action for the click on the Add button, but get the following error:

    The selected button uses a model of 'button' that does not contain the #BUTTON_ID substitution string #.

    I went to the models and found:

    Substitution strings

    Top

    Substitution strings are used in sub models to reference the value of the components. This report details use of string substitution for this model.
    Substitution string Referenced De Description
    #LINK #.YesModelTo be used in an attribute "href".
    #JAVASCRIPT #.NO.To be used in an "onclick" attribute
    #LABEL #.YesModelButton label
    #BUTTON_ATTRIBUTES #.NO.The attributes button
    #BUTTON_ID #.NO.ID generated button will be ID either the static button if defined, or if not will be a generated ID internally in the format 'B ' | [Internal ID of the button.

    I then tried to create a page process, pl/sql,: P400_DISPLAY: = 'STORE '; If the button is pressed.  The action of the button is submit page. However, it does not change the value of P400_DISPLAY and the subregions are hidden.

    Suggestions please on how to fix the template or change the value of P400_DISPLAY?

    The question of the root, it's that, even if you change the value of the element of your page, it is not visible to other areas of the page until it is in the session. Thus, any other action based on the value of the element of your page. the visibility of a control, a report based on the value of the item, etc. will be affected by changing the value of the item page until it has been changed in the session. Even after that, items are stored in the session, then you must do something to influence the revalued value. To see the effect of this, observe that your page will load and assesses the value of the element of your page, it sees which is the "MAIN" and mask areas. However, he didn't reassess after that.

    Then; your choices for this value set at the session are send the page, or use JavaScript to set the value in the session. If you use the latter, you will have to do extra work to make visibility tests be re - run, so, let's stick with the submit method.

    What you did above sounds correct to do this but, there are a lot of decisions, that you might have done that may have caused things to do not occur in the correct order.

    First of all, we will confirm that what I describe above is your problem. From the development environment, load the page, click on the button to change the value and submit. Now, click on the link marked the Session. He is always at HAND? If the answer is "Yes"; That's your problem.

    Let's start with your calculation after the header. You set it to * only * run if the current value of the element of your page is null? If this isn't the case, it's your problem.

    Load the Page-> Item set to 'Hand' by calculation-> click on the button--> Item set to STORE-> Submit-> Page Load-> point by calculating the value 'hand '.

    See the problem?

    Assuming that's not the question, you have created a branch to the same page, right? What is your process for the branch point? Is it * after * Validation, computation etc.? Because if not, you are not changing the value before that didn't get to submit.

    I bet that's the first question, but take a look at these.

    See you soon,.

    -Joe

  • 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 to set a value of outputText 0 during the click on the button cancel using javascript

    Hi Experts,

    JDEV version 12.1.3.0

    I have an outputText at the foot of the column. And I have a button cancel on the top of the page. Then click on the button cancel. How can I set the outputText zero value.

    Thank you

    AR

    Hello

    Please check the labour code. Make clientComponent = "true" in the output text.

    function customOutputValue (event) {}

    var buttonComponent = event.getSource ();

    Find the client component for the af:outputText 'greeting '.

    var oComponent = buttonComponent.findComponent ("ot1");

    Set the value of the outputText component

    oComponent.setValue("0")

    }

    >

    Thank you
    Amey

  • Setting a value of option button using Javascript

    After much research, I realized that the appropriate command to get the value of a radio button in JavaScript of the APEX is 'html_RadioValue', but I was not able to understand a command that will allow you to that you set the value of the option button. Is there a documentation on the use of the APEX of the JavaScript which covers this issue?

    Here is a simplified version of the script:


    < script language = "JavaScript" type = "text/javascript" >
    function showval()
    {
    var item1 = html_RadioValue ('P19_RADIO');
    Alert (Item1);

    Invert the current selection
    If (item1 == 'Y') then
    {
    < mystery_statement > //set P19_RADIO n.
    }
    on the other
    {
    < mystery_statement > P19_RADIO //set to Y.
    }
    }
    < /script >


    I tried the following, but none of them have worked:

    -document.getElementById ("P19_RADIO") .value = 'n';
    -document.getElementById ("P19_RADIO") .checked = 'n';
    -$x('P19_RADIO').value = 'n';
    -$x('P19_RADIO').checked = 'n';


    Thank you.

    Chris:

    - document.getElementById("P19_RADIO_0").checked = true; // should work. '0' is the index of the first item in the radio group
    

    3.1.2 APEX Javascript APIs are documented here

    http://download.Oracle.com/docs/CD/E10513_01/doc/apirefs.310/e12855/javascript_api.htm#CDEEIGFH

    CITY

  • Is any way to allow the user, set the value of a null datetime-local field

    Dear all,

    During development, I found that it is not possible for the user to set the value of a field to enter a non-empty value to null datetime-local.

    Take for example, the monitoring scenario

    -User set a track the date and time for a task

    -L' user wants to erase track the date and time of the task.

    But the controller of out-of-the-box made by webworks offers no way for the user to clear the values in the input of datetime-local.

    I would like to know, is there additional information about this limitation, or actually, there is a way to do this?

    Any useful information would be appreciated on this topic.

    Kind regards.

    Lawrence.

    It is advisable to add a "Clear" next to your input control button?

    The input control only allows you to select values for the value.  'Nothing' is not a valid date.

  • Set a value for an inputComboboxListOfValues before loading the page.

    Hello

    JDeveloper Version 11.1.2.4.0

    I want to put the PersonName (PersonId) value of the inputComboboxListOfValues as well as the value - PersonName display of the inputComboboxListOfValues before the page loads.

    I have PersonId and I can get the PersonName him. But do not know how to set the value until the page is loaded. If I put two PersonId, PersonName the displayed value is always set to null.

    The way I put the values is on the currentRow of the main object of the view.

                        <af:inputComboboxListOfValues id="personNameId" value="#{bindings.PersonName.inputValue}"
                                                      model="#{bindings.PersonName.listOfValuesModel}"
                                                      rendered="#{pageFlowScope.reportParams['personId'] != null}"
                                                      contentStyle="width:138px" partialTriggers="pcid" editMode="select"
                                                      columns="#{bindings.PersonName.hints.displayWidth}" autoSubmit="true">
                            <f:validator binding="#{bindings.PersonName.validator}"/>
                        </af:inputComboboxListOfValues>
    

    Untitled.png

    1. Get the current row of the object of the main view.
    2. Setting the 'PersonName' attribute that is bound to the inputComboBoxListOfValues and so is used for the display value.
    3. Definition of the attribute 'PersonId' to which the value is bound.

    Looks like that everything is settled in this way.

  • Set the value of the page elements using apex.submit

    Hey,.

    Does anyone have an idea how to set the value of several page elements using apex.submit?

    Here is my request, she works for this element of the page, but I want to first the value of the other elements of the page (i.e. P30_SHOW_REF) as well.

    select s.nr as NRR, 
    '<input type="button" value="clickme2" onclick="document.getElementById(''BUTTONS'').style.display = ''block'';apex.submit({request:''SET'',set:{''P30_KLT_NR'':'||s.nr||'});"/>' Button 
    from klant s
    

    Thanks in advance!

    Hi Julijan,

    Here is the example:

    apex.submit({
      request:"DELETE",
      set:{"P1_DEPTNO":10, "P1_EMPNO":5433});
    

    Concerning

    J

  • Set the value of the element

    Nice day

    I have a form with a data block and two elements in the data block. The first element is a checkbox control, while the second is an id I have set up a trigger on the ID element (after CHANGE) which must set the checkbox item if the ID has a system ID valid. The problem I have is that I can't seem to be able to set the check box. I need advice.

    Data block = VARREQ
    Articles:
    USE_VAR_FLAG (valid values are "Y", "N")
    VAR_ID (valid values are a number)

    The code I've tried so far:

    Start
    : VARREQ. USE_VAR_FLAG: = 'Y ';
    end;

    This does not set the value of the checkbox.

    Hello

    Sometimes we need to test pls create a button insert your code after change of BUTTON-WHEN-PRESSED new trigger
    then display message of your box it will come back?

    happy u solved your problem it comes to choice of trigger is not a code problem :)

    I think you can also use WHEN-VALIDATE-RECORD release...

    Kind regards

    Amatu Allah

    Published by: Amatu Allah on May 15, 2012 15:03

  • setting a value of element print report in BI Publisher

    Hello

    I'm having a problem with the value of the element of a page layout once you press a button (which printed a report BI Publisher). The session state for the element is defined, however, because the page is re-charge not no value appears in the element on the page.

    I use a button as a point with a branch of the Page with the branch Point and the page listed on submit: After Processing (After Computation, Validation, and Processing) with the Page set to 0 and the application to PRINT_REPORT = REPORT

    Is it possible to set the value of the element on the page before branching to the report?

    Your help is greatly appreciated.

    -Marsha

    Marsha,

    I'm glad to hear that!
    If this reslved you issue, pleae markthis correct question and shut up ;)

    Thank you

    Sam
    Please reward the right answers in marking correct o useful!

  • Validation only registration (submit) button

    Hi all

    I have a simple question to ask. I create a form with several fields and dependent drop downs. When I select a value from a drop-down list, the autosubmits form and triggers the validation of field which immediately displays an error. I don't want to do because the user has not tried to save the file, is there a way to bypass validation to the stop button?

    I tried to immediately = true for the dropdown menu, but it does not work. (Works great for buttons)

    See you soon,.

    Peter

    Oh, if you have validators required fields or at the level of the face, you need to [disable validation on the client side | http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps | adfcreate | af_aclientsidevalidate ~ html /] as well.

    If it still does not work, try using showRequired instead of required and use instead the 'Required' parameter in your underlying entity object (or a view object, if it cannot be done at the level of the entities).

    Best,
    Avrom

    Published by: Avrom Roy-Faderman on Sep 15, 2008 08:05

    That ' cha love the forum software? This link, without spaces, should be

    http://www.Oracle.com/webapps/online-help/JDeveloper/10.1.3/State/content/Navid.4/navSetId._/vtTopicFile.jsf_apps adfcreate af_clientsidevalidate ~ html

    where is the online portrait/flat colon.

  • Setting the value of a table of ActiveX control

    When controling a VI through ActiveX, how is possible to set the value of a table control?

    With digital controls, I have a problem: I just use SetControlValue and it works well:

    til SetControlValue ('y', 4) for example.

    However, in trying to do the same thing with a table, the control's value becomes an empty array:

    til SetControlValue ("arr', [3-4-5]") for example.

    What is the right way to do it?

    Hi Calvin,

    Have you tried passing a string and convert it to an array entry?  You can also try to use a 'matrix' control, rather than a table, as they are handled a little differently.

  • How to set the value of adjecent record

    Hello

    For an interactive report, I wanted to know, how set the value for one of the value column taken recording (the visible record in the report) adjecent to the same column in the current record.    The reason behind this requirement is, the table contains cirtain ID which is populated based on cirtain condition.  And the same ID must be set to adjecent different records.  Since this is event based on human evaluation of the data, I can not run the UPDATE command in the background.

    To simplify the requirement, suppose, report IR on the employee.  Based on the user, click one of the dummy 'comlumn link', the value COMMISSION_PERCENT must be copied to the next record.  If I know EMPLOYEE_ID value of the next record, then update SQL will do the job.  But how?

    Thank you

    -Anand

    Hi Anand,

    Please check the sample application you gave, I created the same according to your requirement.

    Here are the steps that I did.

    1. edition your column that you use as a button.

    A class has been added to this button under link attributes

    class="uButton cpycomm" role="button"
    

    URL: javascript:void (0);

    2. edited Page attributes

    Under run when the Page loads

     $("a.cpycomm").click(function(){
        var $el = $(this);
        var nextemp = $el.closest("tr").next().find('td[headers="C725254625175515007"]').text();
        var comm = $el.closest("tr").find('td[headers="C725255480705515009"]').text();
        $("#P1_EMPNO").val(nextemp);
        $("#P1_COMM").val(comm);
    
        if (confirm('Copy Commission to next record ?')) {
           apex.submit('SAVE');
        }
      });
    

    3. a process page to update the commision has created.

    Kind regards

    Jitendra

Maybe you are looking for

  • Some pages don't load on Firefox. They charge after changing the proxy settings back.

    I have a very annoying problem with Firefox. Some pages not loading, randomly. Other browsers work fine. I tried to disable all add-ons, I reset firefox, I tried safe mode. Nothing works. When a page does not load, I go to advanced/network/configurat

  • Re: Internal microphone Feedback makes it annoying when the loud noise from speakers

    Hello I have an annoying problem when I turn the volume on my speakers, there is a strong sound feedback from the internal microphone, I do not know how to get rid of. When I turn my speakers down it goes, but what's the point of having great speaker

  • Unable to set up an Open Directory replica server

    I'll put up a second server, and I get the following error in the slapconfig.log file, during an attempt to set up the server replicates Open Directory from the application server: 2016-02-28 22:09:13 + 0000, the machine is bound to the specified ser

  • Tecra M5 PTM51E: line white on the screen all at stake

    Hallo, My problem starts when I changed my settings to a chart in a match.I change 1280 x 1024 to 800 x 600 and a few other things.Change in the weather was quite long so I get nervus and reset my laptop. After that, my laptop screen make a strange t

  • Error 2100 HDD

    Morning everyone, My T420 has error 2100 HDD0 on a few days ago. I went to the IT Help Center and found that the hard drive is completely dead. My original hard drive is seagate 500G. So sad, that all the music and good memorries disappeared. I have