Can declaratively set the value of some attributes depend on an attribute in a row of VO?

Hi, experts.

In jdev 11.1.2.3,.

Can declaratively set the value of some attributes depend on an attribute in a row of VO?

For example, there is a VO (id, salt boolean, integer status, entire IsValid), how to set status=-1,IsValid=-1 when salt is checked (selected)?

I tried:

Method A:

1 set the status depends on saltand the default attribute value:

If (salt is true)

Returns - 1

on the other

{

If (salt is false)

Returns 0

on the other

Returns a null value

}

2. set IsValid dependent statusand attributes by default as: status.

3. set all of these three attributes can be changed to always.

If the parameter above may work, then apparently it's much simpler to write Java code.

Unfortunately, he is unable to work the way you want.

There is some complex another declaratively to do:

Method B:

1. create a selVO (id, booleanValue1 boolean, integer numberValue1, string stringValue1) with static values:

(1, false, 0, "" false for salt: not selected ' ");

(2, true,-1, "" the true value of salt: selected ' ");

2. put selVO as Data Source list for the list of the salt value and return values from the list:

Salt-> booleanValue1,

Status-> numberValue1,

IsValid-> numberValue1.

But this alternative way has a few weaks a fortiori more complex:

Advice from the interface user of salt can not defined by default list Type "CheckBox".

Cannot, therefore, method A feasible?


Thank you!

BAO

Hello Bao,

You can write THE Expression value of Field2

#{bindings. Field1.inputValue == 'Y '? 1:-1}

(Auto submit True on Field1

Field1 Field2 on partial trigger)

Also, you can write logic in VORowimpl Set accessor methods.

Thank you

Jeet

Tags: Java

Similar Questions

  • [ADF, JDev12.1.3] How to set the value of an attribute of VO 'max (attribute) + 1' when creating a new record?

    Hallo,

    I have a VO that selects records from a table databace where FkId = < value >.

    For example: this is the database table...

    ID RowDetNumber OtherFields FkId

    1   3     1            ...

    2   3     2            ...

    3   3     3            ...

    4   3     4            ...

    5   4     1            ...         |

    6   4     2            ...         | -VO selects these records (where FkId = 4 for example)

    7   4     3            ...         |

    8   5     1            ...

    9   5     2            ...

    When a new record is created the field RowDetNumber must be calculated with the logic of the max (RowDetNumber) + 1.

    So for the example above, the calculated value should be 3 + 1 = 4.

    I would like to know how I can calculate the value and assign to the RowDetNumber attribute.

    I did some experiments using a Groovy expression as a default value for the field, but I got only errors.

    I'm a bit confused on how I can do so a few details / examples / tips are welcome

    In particular, a small example for every possible approach would be happy.

    Thank you

    Federico

    Federico, the solution mentioned in the block will work as it only generates unique numbers without guarantee that the generated numbers are without flaw. However, if you want to use max + 1 this normally means you want to have a sequence without gap. It is very very complicated in nature. It doesn't matter what application you're trying, there is almost always room for error, ending with duplicate numbers.

    The trigger also works as the DB supports triggers on MS SQL.

    If you don't need a number of gap-less for the attribute, you can use the groovy solution and just get a number of a sequence is is guaranteed unique and greater value, like the last number that you asked of the sequence. In this way, you can have the sorted records

    ID RowDetNumber OtherFields FkId

    1  3    1            ...

    2  3    7            ...

    3  3    9            ...

    4  3    10            ...

    5  4    3            ...        |

    6  4    5            ...        | -VO selects these records (where FkId = 4 for example)

    7  4    12            ...        |

    8  5    4            ...

    9  5    6            ...

    Timo

  • How to set the value of an attribute of a button?

    Dear all,

    use developer j 11.1.1.1.3 and I have a master page detail, now I need the user when press the button create - insert on detail to copy a value from the master in an attribute on the details... I added listener set action on the Insert button and on the "of:" I wrote the main attribute binding but did not know what to write on the "to:" field... I tried row.bindings.detail_column_input_value but did not work on the common language runtime, it gave me this message
    -> the input string for the "detail_column_name".


    Best regards
    Lama

    Have you tried using the integrated operation 'Create with parameters' instead of 'CreateInsert '?
    In this way, you will be able to create a new line and set the default values.

    Kristjan

  • How to set the value of a column in a table according to another column?

    Hello world!

    I use Apex 4.1.
    My question is how can I set the value of a column in a table according to another column?
    I have a table and when I insert the value in the column content, I want to change this value in the note column with the note, which is generated with pl/sql function (function of string returned if the typed value is in the range).

    I tried to use javascript as
     $('input[name=f02]').live('change', function(){
    if($(this).val()!='1'){
    $('input[name=f03]').val("test")}
    }); 
    for the development of the column note to test if the value typed in the content of the column is not 1, but this code assigns the value to all the lines and I need to set only the specified line.

    Can someone give me a hint in any way to do this if possible?

    Kind regards
    drama9346

    You will need create a process on your page type PLSQL and develop this process "we demand" of the page. In this process, you can run the PLSQL you need. That is to say to retrieve the note value as described in your PC:

    and when I insert the value in the column content, I want to change this value in the note column with the note, which is generated with pl/sql function (function of string returned if the typed value is in the range).

    In this process, you must provide a return value of the call, and you can do this by using htp.p. Example:

    DECLARE
       --putting x01 in a var to simplify
       l_test_var VARCHAR2(200) := apex_application.g_x01;
       l_return VARCHAR2(200);
    BEGIN
       -- a simplistic test
       IF LENGTH(l_test_var) BETWEEN 10 AND 20 THEN
          l_return := 'String is between 10 and 20';
       END IF;
    
       --this will write l_return to the buffer, and the ajax callback will receive this
       htp.p(l_return);
    END;
    

    And the code that I wrote above, which is javascript, would need to go where your current code is that binds to the onchange event. The result should be that, when a change is made to this element, an ajax request is made on the server. When the call is finished, it will be the value returned in the item you want.

  • Setting the value of the current element

    Hello. Can I set the value of the current time in my trigger when-validate-point without physical coding: block.item name? Can I set the value to: Person.Name to null in some way without using explicit code:

    : person.name: = null;

    The reason why I ask is because I'll be running similar validations for mutiple items and want to reuse the same code in several triggers when-validate-point without having to update the code.


    I tried, but it does not work:

    : system.current_item: = null;


    Any suggestions? Is it still possible?

    Hey,.

    Try in this direction:
    copy (NULL, name_in ('system.current_block') |'.) ' || name_in ('system.current_item'));

    Concerning
    Frane

  • How can I set default values to set the Mode in the config of the AO?

    Hi, how can I set default values to allocate mode in the config of the AO. To be precise, in the attached vi, I need to set the Mode allocate in the AO Config to ' use FIFO memory (6) ' if the value inside the structure of my case is false and 'no change (0)' if the value inside the strusture case is true.

    Create two constants for Mode allocate input (right click > create > constant). A place in the real case of the structure of the case and place it in the case of false. Their son in the same tunnel (border of the structure of the case), then the tunnel of wire to the pole to allocate the AO Config Mode. I do not have traditional DAQ installed, but who should do it.

  • How can I set the scope of the attributes are incompatible error in Windows 8 pro?

    How can I set the scope of the attributes are incompatible error in Windows 8 pro?

    Whenever I try to run a setup.exe file, it gives me this error. What can I do to fix this?
    Help, please!

    WOAH ARE RESISTING NOT EVERYONE!

    THERE IS A MUCH EASIER WAY TO DO THIS!
    Well, I looked for a solution on google (Yes google) for 20 minutes and found four sites that had a bajillion ways to solve this problem.
    Dang, I was wrong.  So, when I dropped, I searched it on youtube, and here's what I got it is frighteningly SIMPLE!
    These are the? indications that I give to you people of the video (easier to look at):
    1 right-click the volume in the taskbar icon, and select sounds
    2. scroll down about 3/4 on the events program: the list and select the option that says Windows user account control
    3. change the sounds: option ( no), and then click OK
    YOU ARE FINISHED NOW, AND THE PROBLEM IS SOLVED... I have no idea how it works, but it doesn't... I AM IN AWE IN FRONT OF
  • Can not set a value by the executed dynamic action on the page element "selection list."

    I created an agenda of the page 'list of selection' and I want to when I change a value in another element of the page set only 'screen '.

    I created a dynamic action on the page element "selection list" for this.

    These are the dynamic action attribute:

    When:

    ======

    Event: change

    Selection type: point

    Article: P29_PURCHASE_ORDER

    Condition: No strings attached

    Advanced:

    ========

    Scope of the event: static

    Identification:

    ==========

    Action: Set

    The ' Action Page when the changed value "attribute of the element of 'list of selection' = 'None', and when I run form the dynamic action run and set the value for once and do not update the value according to the change in the article"list of selection. "

    Note: when I change the previous attribute of 'Redirect and set', dynamic action run and properly value, but the value was hidden soon

    I want to value when the value of change of select list according to this change successfully.

    Please, advice me,

    Best regards

    Mustafa Ezzat

    Hello

    you set the value of the 'Page elements to submit' to P29_PURCHASE_ORDER?

    Then, the SQL statement would use the current selected value.

    This is the help text says: "specify a list separated by commas of the elements of the page that will be submitted to the server and therefore available for use in your"SQL statement"," PL/SQL Expression"or"Body of the PL/SQL function".»

    Kind regards

    Erik-jan

  • Can I create a cursor and set the values by myself

    Can I create a cursor and set the values by myself, and it has not been filled by an SQL?

    Thanks in advance

    Yes, you can.
    Use variables with a default value or nvl (some_parameter, some_variable) in your cursor WHERE predicate.
    They provide an example if it isn't clear, since that's all I can think about reading your post...

  • Set the value of selectOneChoice managed Bean

    Hello Experts,

    My script is as follows: -.

    I have a selectOneChoice in my page and I fill it with values in the loading of the page (in the constructor of my managed bean) and he filled in correctly

    < af:selectOneChoice binding = "#{viewScope.MyBean.select}" >

    < f: selectItems value = "#{viewScope.MyBean.arr}" >

    < / af:selectOneChoice >

    ARR = new ArrayList < selectItem > ();

    arr. Add (new selectItem ("1", "Label 1"));
    arr. Add (new selectItem ("2", "Label 2"));
    arr. Add (new selectItem ("3", "Label 3"));
    arr. Add (new selectItem ("4", "Label 4"));


    Now, I need when I click a button on my page, make sure the value selected from the selectOneChoice '1 '.

    I tried the following, but it does not work:

    1 - select.setValue("1");

    2 - SelectItem TR = new SelectItem ("1", "Label 1");
    select.setValue (si);


    So, how can I do in my managed bean?


    I appreciate your help and thanks in advance

    The has a value property that the component stores the selected value. You can either declare a temporary variabel on the page (http://tompeez.wordpress.com/2013/03/25/creating-variables-and-attribute-bindings-to-store-values-temporarily-in-the-pagedef/) and use this variable to store the selected value, or you can use a bean for this property. Once you have set the value property, you can select the entry by setting the value property to the index that you want to select.

    Timo

  • 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

  • HOW TO SET THE VALUE TO A PAGE OF AJAX ON DEMMAND PROCESS ELEMENT?

    Hi, I have a javascript that calls an ajax on demmand process , and I need a the ajax process variable value is updated about my page: P2_CONTENT:

    • Here's my javascript call:

    doprint() function

    {

    Apex. Server.Process ("GENTICKET", {pageItems: "#P2_PARAM1"}, {async: false});

    }

    • and here is My ajax on demmand process (GENTICKET):

    BEGIN

    declare

    CONT varchar2 (1000); -the return value is less than this length, I have already checked in my table-

    Start

    Here, I call a DB procedure that fills my data. I verifyed and works nice!

    pro_generate (:P2_PARAM1);


    Here, I select the data obtained in the previous step

    Select tic_text

    in cont

    of t_reim

    WHERE f_type =:P2_PARAM1 ;



    Here, I need to set the value to display in my page field


    APEX_UTIL. SET_SESSION_STATE ('P2_CONTENT', CONT);  -< < < < < that doesn't work. I tried: P2_CONTENT: = cont; but does not


    end;

    END;


    Thanks in advance for the help.

    You can do all this declaratively by using dynamic actions, to try jQuery is like trying to swim before you can float.

    You can influence the value returned from JavaScript with this PL/SQL:

    HTP. PRN (cont);

    Then include a function of success (as described in the previous link) to run code like:

    success: function {(pData)

    $s ('P2_CONTENT', pData);

    }

  • How to set the value of a * APPLICATION * with apex.server.process?

    If I have a page named point P1_MY_PAGE_ITEM, I could put its value in the session by doing this:

    $s('P1_MY_PAGE_ITEM', 'I Like Pie!');
    
    apex.server.process(   'dummy'
                           , { pageItems: "#P1_MY_PAGE_ITEM" }
                           , { dataType: "text",
                             async: false,
                               complete: function( ajaxResponse )
                                     {
                                          var ignoredReturn = ajaxResponse.responseText;
                                     }
                             });

    Which works very well. If you check the session, the P1_MY_PAGE_ITEM will now have the value: I like pie!

    However, if I have an Application element (not a page element!) named MY_APP_ITEM, how could I do the same thing? How can I use apex.server.process to set the value of MY_APP_ITEM in the session? I wouldn't be able to use "pageItems" because MY_APP_ITEM is not a page element, it is a part of the application.

    What is the correct syntax to do this?

    Thank you

    -Joe

    Hey Joe,

    Returning to that thread you made a couple of months ago, the answer is here:

    Post adjustment Application items in the apex.server.process for a * process application *.

    Defining a point of application is as easy as providing the name of the application element to p_arg_names Bay and set a corresponding value in the p_arg_values table.

    For example, in an application with article SOME_ITEM of the application, I can put the value as follows:

    (function(){
    var arrNames = [], arrValues = [];
    arrNames.push("SOME_ITEM");
    arrValues.push('some value');
    apex.server.process(   'dummy'
                         , { p_arg_names: arrNames, p_arg_values: arrValues }
                         , { dataType: "text"
                           });
    })()
    

    Any required application process. Should the item be free that you set it from the browser.

  • LOV cascading does not work when you set the value of the parent LOV with DA

    Hi all

    Using APEX 4.2.2.

    I have tow LOVs

    LOV parent article is: P50_TYPE

    Child element LOV is: P50_PROJECT_ID

    In other words in the attributes of the element P50_PROJECT_ID, we have:

    > Cascade LOV Parent article (s): P50_TYPE

    > The items to show page: P50_TYPE

    > The list of values definition: something similar to:

    Select * from mytable where type =: P50_TYPE

    I use DA as run of the JS code to set the value of the P50_TYPE element

    something similar to:

    > $('#P50_TYPE').val (2);

    After doing this, the P50_PROJECT_ID element does not get updated when the P50_TYPE value changes. Namely, P50_PROJECT_ID remains empty, unless the end user manually changes the value of P50_TYPE.

    Any help please?

    Kind regards

    I had a similar experience, he expected a change event, so you can extend the jQuery to be included

    $('#P50_TYPE').val (2) .changes ();

  • How I set the value of a dynamic text field row

    I have a repeated line form that contains a button and several text fields.  There is a text field (input field) above with some information I want to place in the table and several buttons that I want to read the value of and defined on the table.  Excuse me there are several questions I have and I use pseudocode to describe.

    Top shape resembles

    InputField

    | ButtonX1 | ButtonY1 | DescriptionX1 (read the text only field)

    ...

    | ButtonXn | ButtonY1 | DescriptionXn

    OutputRow looks like

    | ButtonOutput | OutputField1 | OutputField2 | OutputField3 |

    So, I want to do

    ButtonX1.click

    {

    OutputTable.OutputRow.addInstance (true) //this works - everything I have questions on

    OutputTable.OutputRow.OutputField1.rawValue = DescriptionX1.rawValue

    /*

    Question 1

    How should I address the location of each table to set a value

    Question 2

    How can I get the value of the description field in the same row as button and table

    I would like to say something to the effect of the OutputTable.OutputRow [?]. OutputField1.rawValue = this.parent.DescriptionX

    */

    OutputTable.OutputRow.OutputField2 = InputField.rawValue

    /*

    Same question as above - how can I specify a dynamic line - it's the syntax appropriate for obtaining the value of the input field?

    */

    OutputTable.OutputRow.OutputField3 is this. ButtonLabel

    /*

    Question 3

    How can I get the value of the label of the button to set the field

    There should be a lot of these buttons and buttons will be added - I'd rather set the value based on the label of the button to facilitate value - not requiring only not to change the code

    */

    Issue 4--unrelated to those at the top.

    Is it possible to build the first table

    | ButtonX | ButtonY | Description |

    from a XML file.  I've seen examples showing how to build if it's just data, but XML can be pushed into a form with the code to perform the above actions?

    Glad you figured it out... nothing wrong with doing it this way.

    Normally XML contains data and no default legends these xml files are bouond to the rawValue property. You can enable the dynamic linking and other properties of the object will be bindable (they appear as links) in the user interface. If you click on the link to legend an Assistant appears allowing you to bind the node in the XML file.

    Paul

Maybe you are looking for