Set the value with XPath dynamically

Dear all,

I am wonder if what follows is possiable with service set the value using XPath, * simple * workaround is also welcome.

If I have a variable myXML =

< root >

< item region "A" = > 1 < / item >
< item region = "Two" > 2 < / item >

< / root >

I can refer to /root/item [1] by:

Set /process/@myNum = 1

Set /process/@dummy = / process_data/myXml/root/item [number (\process\@myNum)]


[' But how can I access to /root/item[@region="One '] ?

I tried the following, but all have failed:

1)

Set /process/@myString = @region = "One"

Set /process/@dummy = / process_data/myXml/root/item [string (\process\@myString)]

2)

Set /process/@myString = a

[Set /process/@dummy = /process_data/myXml/root/item[@region='string (\process\@myString)']

And is there a way to set a variable using the pattern string? (that is, you name is {$/process/@yourName$})

Concerning

Bill

Bill,

I created 2 simple samples that I enclose the answer as one. File ACL.

First to get the value of a node using an attribute, what you need to do is create a variable that will contain the dynamic data - in your case, the value of the region. Then create another variable that you receive the value of the desired XMl element - I called mine 'value '. If your setValue would look like this:

The location expression

/process_data/@region "One"

/process_data/@value process_data/xmlIn/root/item[@region=/process_data/@region]

As you can see, there is no need to use the string() function, because by default, while XML is a string. This is precisely why you should use the number() function when trying to identify an item by its index. Index must be a number, not a string.

Second, about the value of model with xPath. I created an example of process of e-mail to demonstrate this solution. You are on the right track, it's just that your syntax is incorrect. You have:

Your name is {$process/@yourName$}

It should be:

Your name is {$/ process_data/@yourName$}

Tags: Adobe LiveCycle

Similar Questions

  • 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

  • Set the value hidden with dynamic action

    This is probably very simple, but I don't know exactly what I'm doing wrong.  I would like to use a dynamic action to set the value of an item hidden in the value of a selection list when that select list of changes.  So what I have is:

    Event: change

    Selection type: point

    Article: P1_SELECT

    Action: Set

    Set type: PL/SQL Expression

    PL / SQL: P1_SELECT

    Items concerned:

    Selection type: point

    Point: P1_HIDDEN

    where P1_SELECT is my list selection and the P1_HIDDEN is my element hidden.

    It doesn't seem to work.  I don't know that I'm doing something very simple, bad.  This should be easy points for someone!

    Thank you!

    John

    It's actually a session typical State missunderstanding. When the selection list is changed, it does not change the value of session state, but only the value of the side (browser) client. If you set value action will set the status value for current session on the element hidden, which will probably be NULL (or any value it is on, you can see in the session tab in the developer bar).

    Instead of a type of expression plsql for your set value action, must change to a javascript expression:

    $v ("P1_SELECT")

    who will get the value of the element of page P1_SELECT currently on the page.

    PS: also, in your affected items your article is ": P1_HIDDEN"-is two points in front of deliberate? It shouldn't be there

    PS2: If you mean to send the page, then you can set the property to 'protect the value' of the hidden element to 'No', otherwise you will receive a checksum error!

  • How to use PL/SQL to create dynamic action to set the value of a selection by another list?

    Hello

    I would like to know how to use PL/SQL to create dynamic action to set the value of a list of selection by another selection list.

    1.PNG

    I wish can create dynamic action to manage the two above the Room select list (: P9_ROOM) and building (: P8_BUILDING).

    When you select "1074" in the bathroom, building highlights like "BRM BLD 5"

    When you select 'Area of the black box' in the room, building must assign the value "7 BLD BRM"

    When the room is Null, building should also be Null.

    I thank you,

    Alice

    I forgot to mention, for the PL/SQL Code, because you are working with items in the selection list, the return values are different from the display on your LOV values, you must instead use the return values.

    Thank you

    Erick

  • dynamic action sets the value of the element, but not save to DB on submit

    I'm working on a page where the value of several to show only the page elements are defined using a dynamic Action.  They are set when the user selects a value in a list of selection (and is based on the value of the selection list).  Dynamic action is triggered on a list selection change event and then runs the real action "set the value.  The selection list displays the names of sales representative.  The three fields dynamically filled are the org structure (that is, their chain management).

    For the action to set the value, I use a defined Type of SQL statement:

    Select VP, DIR, MGR

    of SALES_ORG where SSR =: P20_SSR

    In the affected elements, I have fixed Type of selection to the 'item (s)"and the value of the Item (s) for 'P20_GVP, P20_DIR, P20_MGR.

    Dynamic action works fine for the display of the page (that is, when I select a sales representative in the selection list dynamic action properly updated only display value fields three).  This page is a form in which the user submits information relating to the rep.  When the page is sent, all fields are filled in a new record of DB with the exception of three that were populated dynamically above.  These fields get the values NULL.

    When the dynamic action updates the values in the three fields is - it does not set the value of session?  Why these fields don't are not taken into account in the submit other ideas > process Page?

    I use 5 APEX with Chrome on Mac (Yosemite).

    Thanks for the note.  I didn't only display the items could not be used in this way.  I think I'll take a different approach with the design; given that the org structure is in another table that I can simply refer to that by rep when necessary rather than saving the information uploaded to the page of the form.  The reason why I have not fill the screen only the points of loading the page is because I don't know what the values should be until the user selects a sales representative in the selection list.

    I'll change the design to one of the following:

    1) change the display only items of standard text field.  NOTE: if I make the text read-only field that causes other problems when loading (I get the message "violation of protection Session state").

    OR

    2) do not include org structure in the download folder and just refer to table org Rep when necessary.

    Thank you!

    Steve

  • How do dynamic actions using work to set the value in all browsers?

    I'm having a problem of incompatibility between browsers with dynamic actions to help to set the value.  Dynamic action works like a charm on Chrome but has no effect on IE or Firefox.  The code in oracle.apex.com and here are the credentials:

    Workspace: DDBA

    Username: [email protected]

    Password: redtruck12

    These codes is on page 3 and here are the details:

    There are two lists of report (Standard and special) and some reports require additional information provided in the lists of selection or text boxes.

    If the user selects a report select Standard requiring a list/text box, then the dynamic action sets the value of the special reports to NULL (and vice versa).

    Dynamic action is to prevent a simultaneous Standard reports and special selection.  To see how it works on Chrome, follow these steps:


    1. Run the Page 3
    2. Select the "Search report" option in the list Report Standard .  A text 'Search criteria' box
    3. Select the option 'Release report' in the list of special reports .  A selection list appears and disappears from the text box 'search criteria '.

    If you do the same on IE or Firefox, the text box does not disappear.

    Hi Edward,.

    Please check page 4 of your app, I made a copy of your page and made a few changes:

    I have set up an example of dynamic action 1 this hanles the report and special report selection list.

    Dynamic action games, select the value of the selection list and he accompanies in detail the report lists to null and then submits the page.

    For this I have deleted the page submit events to the time the report and special report select lists. Instead I handed them a HTML class. The dynamic action is triggered by a change of this category of html.

    When the trigger is the report selection list, select special report is set to null. Also underlying selection sub lists are set to null.

    When the trigger is the special report selection list, the selection of the report is set to null. Also underlying selection sub lists are set to null.

    The two end of the action with a "Send" page to manage the show and hide appropriate items. Note that there is a lag in time due to the submission of the page. As I have suggested, it would be treated better by a refresh of the region. On the other hand you depend on now submit for the continuation of the treatment of your page. With the help of an update of the region would require a work more javascript and cost more redisgn of your page. If you need IE8 support, additional javsascript likely to cause other unexpected behaviors. In other words, a page is maybe in your case probably better then an update of the region after all.

    I checked this page 4, Chrome, Firefox and IE (latest version) and I get the same behavior in all browsers.

    Kind regards

    Vincent

    http://vincentdeelen.blogspot.com

  • Dynamic action to set the value to select the text box list

    Hello

    I want the value in the list box select text box i.e list selection with 5 static values and on the user's selection, this value must be added in a box.

    I am using dynamic measurements. I tried with dynamic action and created the change list box select evnent but now how to set the value of the selection list to
    text box that I don't know.

    Help, please.

    Thanks in advance

    Hello

    I changed the dynamic on this page action to make it work now. I changed the "value Type" action 'Set value' 'Expression JavaScript' and "JavaScript Expression" do the following:

    $v(this.triggeringElement)
    

    This example gets the value of the page element 'DESPROGES', bypassing the server for nothing, as you did before.

    I hope this helps. Let us know if you have any other questions.

    Kind regards
    Anthony

  • 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.

  • List of selection with redirection sets the values to null

    I saw another post with a similar issue. However, the answer given does not work for me.

    I have a "Site" text field whose value depends on a list of select 'customer '. I am able to set the value of "Site" based on the select list with redirect. However, other values on this page are reset to null.

    I saw an answer that says to change the display of selection list type to "select the list to submit." But this type of display requires a page that deals with the process is created. This solution did not help either.

    Any solution?

    If you follow this example, you will be able to set the status of the session without redirection / layout page:

    http://Apex.Oracle.com/pls/OTN/f?p=31517:229

    Denes Kubicek
    ------------------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    ------------------------------------------------------------------------------

  • 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 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);

    }

  • Set the values in cascade LOV (Skillbuilders SuperLOV used)

    Hello

    I install a simple page with a SuperLOV cascading.

    I'm trying to set the values of the first and the second SuperLOV based on the selection of a report.

    After the selection, a javascript function is called that sets the variable state and browser session P1_EMPNO

    function editRecord(pValue) {
       //set session state of P1_EMPNO to use in pl/sql query
       var a=new htmldb_Get();
       a.add('P1_EMPNO', pValue);
       var r=a.get();
    
       //set variable to trigger dynamic action
       $s('P1_EMPNO',pValue);
    }
    

    I use this point (P1_ITEM) to trigger a dynamic Action (when the value changes AND is not null) to SET the VALUE for the first LOV. This method works.

    Then one created a second dynamic Action that uses the event AFTER REFRESH for the first LOV to SET the VALUE for the second SuperLOV. It does not work

    Just to test the logic, I created a third standard LOV which is the same as the second SuperLOV and respective dynamic action. This one works.

    It's the http://apex.oracle.com/pls/apex/f?p=49044:1 application

    (PATRICK, demoadmin, 1234) application WORDERS.

    I would be very grateful for any help

    Thank you.

    OK, I discovered what was going on.

    I used a $('#P1_EMP').apex_super_lov of javascript for dynamic Action action to set the value of the SuperLOV.

  • Update process variable (XML) to help set the value

    Hello

    I'm having a problem to update the value in the variable XML using SetValue (by the XPATH expression). It is removing my original XML and replacing it with a new one. I'm off clue why this happens.

    My steps:
    1. I created a variable of XML type and set it as a STARTER, REQUIRED.

    xmlData.jpg

    2. I am updating this variable using the activity set the value. In my process, it is "locUpdate1".

    setVal.jpg

    The original XML is: (xmlData value)

    <xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/" xmlns:dd="http://ns.adobe.com/data-description/" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" timeStamp="2011-01-03T07:31:26Z" uuid="009257fd-3f66-449d-b554-6a095f917b74">
    <xfa:datasets>
            <xfa:data>
                <GetUserRoot>
                    <applicantInformation>
                        <UserInfo>
                            <UserID1/>
                            <UserName1/>
                            <UserID2/>
                            <UserName2/>
                            <UserID3/>
                            <UserName3/>
                            <CurrentUserID>6967A5DE-D5EB-102D-BF7F-0000C0A8010C</CurrentUserID>
                            <CurrentUserName>Sarah Rose</CurrentUserName>
                        </UserInfo>
                    </applicantInformation>
                    <FSTARGETURL_/>
                </GetUserRoot>
            </xfa:data>
            <dd:dataDescription dd:name="GetUserRoot">
                <GetUserRoot>
                    <applicantInformation>
                        <UserInfo>
                            <UserID1/>
                            <UserName1/>
                            <UserID2/>
                            <UserName2/>
                            <UserID3/>
                            <UserName3/>
                            <CurrentUserName/>
                            <CurrentUserID/>
                        </UserInfo>
                    </applicantInformation>
                </GetUserRoot>
            </dd:dataDescription>
        </xfa:datasets>
    <pdf xmlns="http://ns.adobe.com/xdp/pdf/" href="-4608764380271080676-28"/>
    <xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
            <annots/>
        </xfdf>
    </xdp:xdp>

    After operating, it evolves to

    <GetUserRoot>
        <applicantInformation>
            <UserInfo/>
        </applicantInformation>
    </GetUserRoot>
    
    

    should not be done.

    I want to just copy the value of the an element in the other.

    /process_data/xmlData/GetUserRoot/applicantInformation/UserInfo/UserID1 = /process_data/xmlData/GetUserRoot/applicantInformation/UserInfo/CurrentUserID
    
    

    Output should be:

    <xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/" xmlns:dd="http://ns.adobe.com/data-description/" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" timeStamp="2011-01-03T07:31:26Z" uuid="009257fd-3f66-449d-b554-6a095f917b74">
    <xfa:datasets>
            <xfa:data>
                <GetUserRoot>
                    <applicantInformation>
                        <UserInfo>
                            <UserID1>6967A5DE-D5EB-102D-BF7F-0000C0A8010C</UserID1>
                            <UserName1>Sarah Rose</UserName1>
                            <UserID2/>
                            <UserName2/>    
                            <UserID3/>
                            <UserName3/>
                            <!-- this is to be coiped in above -->
                            <CurrentUserID>6967A5DE-D5EB-102D-BF7F-0000C0A8010C</CurrentUserID>
                            <CurrentUserName>Sarah Rose</CurrentUserName>
                        </UserInfo>
                    </applicantInformation>
                    <FSTARGETURL_/>
                </GetUserRoot>
            </xfa:data>
            <dd:dataDescription dd:name="GetUserRoot">
                <GetUserRoot>
                    <applicantInformation>
                        <UserInfo>
                            <UserID1/>
                            <UserName1/>
                            <UserID2/>
                            <UserName2/>
                            <UserID3/>
                            <UserName3/>
                            <CurrentUserName/>
                            <CurrentUserID/>
                        </UserInfo>
                    </applicantInformation>
                </GetUserRoot>
            </dd:dataDescription>
        </xfa:datasets>
    <pdf xmlns="http://ns.adobe.com/xdp/pdf/" href="-4608764380271080676-28"/>
    <xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
            <annots/>
        </xfdf>
    </xdp:xdp>

    Any help to what I'm doing wrong.

    Thank you.

    -

    Afonso

    Your mission is incorrect. Note that you need to reference all the XML nodes (to the right of the ROOT node)

    Since your reference node is not absolute, it will create the nodes that you have defined in your expression on the left.

    The following code should work as expected!

    /process_data/xmlData/xdp/datasets/data/GetUserRoot/applicantInformation/UserInfo/UserID1 = /process_data/xmlData/xdp/datasets/data/GetUserRoot/applicantInformation/UserInfo/CurrentUserID
    

    Nith

  • How to set the value of a field from the LOV of another field.

    I'm trying to figure out how to set the value of a field (P_PROGRAM) to the value of another field of based lov (P_STATE).

    The P_PROGRAM field is a hidden field. The P_STATE field is a required field and is based on a list of values for the State Codes.

    When a user selects the State to P_STATE, the field of the P_PROGRAM should be set to this value, as well.

    I tried different ways to get there via a function call on the post for the calculation of the field P_STATE, defining the source P_PROGRAM to the value of the page item P_STATE put varialbles, creating a process before SENDING, and they all still come back as having a NULL value for P_PROGRAM, therefore impossible to create the file in the db as the PROGRAM is a mandatory field in the table.

    Can you please help? Thank you, Laura

    Laura,

    It is always helpful if you provide information about the Apex version you are using. The Apex 4 you can use Dynamic Actions to achieve this. In earlier versions is possible using processes to submit or javacsripts, as well.

    Heres how you do in 3.x with treatment to submit, to make it work in 4.0 as well.

    1 do the P_STATE ' select list submits the Page.
    2. Add a calculation on the point P_PROGRAM, or write to him assign a value based on a process. The treatment should be OnLoad after the header
    3. If the page does not have an unconditional branch that loops on itself, add a. NOTE: The direction must be the last branch (larger sequence number) and should have checked "Save Session State".

    This is what will happen
    a. when the State is selected Page will be submitted
    (b) it will take the unconditional branch to himself and save the value of P_STATE
    c. the calculation process / fills the value of the P_PROGRAM element when the page reloads

    Kind regards

  • Set the value of the parameter in the call sequence by programming

    Is there a way to set the value of the parameters of a call sequence with a vi with the context of the sequence in the order which is called? Cases not the same subseqence with a vi in the mainsequence maybe?

    In your VI, I think you should be able to set the value of Step.TS.SData.ActualArgs.paranumber.Expr to the value of the setting that you want. (This property is visible in the Variables pane, only if you have configured the Options of Station to display hidden properties). Note that the purpose of the step should refer to the sequence of your call step.  Also, remember that the property represents an expression, so if you want to pass the value 33, you must enclose the value in quotes ("33").

    Jeff

Maybe you are looking for