[ADF, JDev12.1.3] SelectOneChoiche created from VO instance with 3 fields: how to retrieve the value of all the fields of the selected element?

Hallo,

I defined a VO with 3 fields (A, B and C) and I would like to create a SelectOneChoiche that shows only the field as options from this instance of VO.

In a managed bean, I need to retrieve the values for all areas (A, B and C) of the item selected by the user.

I started dragging the entire VO instance to UI to create a SelectOneChoiche (in which I have chosen to show only the to field).

Then, I created a for the SOC ValueChangeListener read the values A, B and C of the selected element, but the only thing I've done is to get the displayed value:

System.out.println((String) ((RichSelectOneChoice) FacesUtils.findComponent("MySoc")).getValue());

You kindly help me?

Thank you

Federico

Federico, sorry I didn't see your answer.

As you use 12.1.3 you can do this more easily than the code that I posted before. You can use

{} public void onCountrySelection (ValueChangeEvent valueChangeEvent)

FacesContext will involve = FacesContext.getCurrentInstance ();

Make sure that the selection change is processed and the current link lov line has the new selected line

valueChangeEvent.getComponent () .processUpdates (contxt);

BindingContext lBindingContext = BindingContext.getCurrent ();

BindingContainer lBindingContainer = lBindingContext.getCurrentBindingsEntry ();

List JUCtrlListBinding = lBindingContainer.get ("CountryId") (JUCtrlListBinding);

the newindex in not necessary, but ok let's get it (must be equal to the CountryId, the pharmacokinetics of the binding of the lov

String newindex = (String) valueChangeEvent.getNewValue ();

get the selected value in the list that is the selected line of the binding of the lov

Line lFromList = list.getSelectedValue () (line);

now, we can get the attributes of the line of lov

String s = (String) lFromList.getAttribute ("CountryId");

System.out.println ("CountryId:" + s);

String s2 = (String) lFromList.getAttribute ("CountryName");

System.out.println ("CountryName:" + s2);

BigDecimal s3 = lFromList.getAttribute("RegionId") (BigDecimal);

System.out.println ("RegionId:" + s3.toString ());

}

The form that I use is based on the location of the HR DB schema table. The CountryId is configured in the view object to display a lov based on the campagneVoir. This view contains thre CountryId, CountryName and RegionId attributes.

If you want to get to the attributes of an action listener you can use this code

{} public void onGetSelectedCountryLov (ActionEvent actionEvent)

BindingContext lBindingContext = BindingContext.getCurrent ();

BindingContainer lBindingContainer = lBindingContext.getCurrentBindingsEntry ();

List JUCtrlListBinding = lBindingContainer.get ("CountryId") (JUCtrlListBinding);

get the selected value in the list that is the selected line of the binding of the lov

Line lFromList = list.getSelectedValue () (line);

now, we can get the attributes of the line of lov

String s = (String) lFromList.getAttribute ("CountryId");

System.out.println ("CountryId:" + s);

String s2 = (String) lFromList.getAttribute ("CountryName");

System.out.println ("CountryName:" + s2);

BigDecimal s3 = lFromList.getAttribute("RegionId") (BigDecimal);

System.out.println ("RegionId:" + s3.toString ());

}

You must add the valueChangeListener and at least add the lines

FacesContext will involve = FacesContext.getCurrentInstance ();

Make sure that the selection change is processed and the current link lov line has the new selected line

valueChangeEvent.getComponent () .processUpdates (contxt);

to ensure that the selected line is available when you click the button.

And set autosubmit'= true for the field in the UI that displays the LOV.

Timo

Tags: Java

Similar Questions

  • How to retrieve the selected values of the selectOrderShuttle using ADF 11 g

    Hello world

    Did anyone has idea how to retrieve the selected items by using the shuttle and the order of the elements by using the 'SelectOrderShuttle '?

    Thank you

    valuechangeevent of the shuttle would fire when you shuttle points back.

        public void selectOrderShuttle1_valueChangeListener(ValueChangeEvent valueChangeEvent) {
    
            ArrayList list = new ArrayList(Arrays.asList(valueChangeEvent.getNewValue()));
    
            if (list != null){
                for (int i=0; i
    
  • How to get the selected row in a programmatic table of the ADF (table generated from a bean)

    Hi all


    We use JDeveloper Studio Edition Version 12.1.3.0.0 and deployed on GlassFish Server Open Source Edition 3.1.2.2 (build 5) and connect to the SQLServer database.


    How to get the selected line in a programmatic (using a SortableModel custom not a display object) ADF table (generated from a bean)?


    We are trying to get the selected row in a bean of a programmatic ADF table to retrieve data based on the selected line.


    Any idea?

    Well, you can use selectionListener to set the selected line to a variable of bean (but this bean must be in extended view or some superiors)

    Something like this: http://www.awasthiashish.com/2015/07/get-selected-row-singlemultiple-from.html

    Dario

  • After the system recovery running following a power outage, my user profile is lost. Unfortunately, he is also the administrator account. How to retrieve the profile or create a new?

    After the system recovery running following a power outage, my user profile is lost.  Unfortunately, he is also the administrator account.  How to retrieve the profile or create a new?

    ·                        Restore point:

    Try typing F8 at startup and in the list of Boot selections, select Mode safe using ARROW top to go there > and then press ENTER.

    Try a restore of the system once, to choose a Restore Point prior to your problem...

    Click Start > programs > Accessories > system tools > system restore > choose another time > next > etc.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    If the above does not work:

    ·                        http://www.Vistax64.com/tutorials/130095-user-profile-service-failed-logon-user-profile-cannot-loaded.html

    See if the information in the above tutorial will help you.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    http://windowshelp.Microsoft.com/Windows/en-AU/help/769495bf-035C-4764-A538-c9b05c22001e1033.mspx

    Difficulty of a corrupted user profile

    After creating the profile, you can copy the files from the existing profile. You must have at least three user accounts on the computer to perform these operations, including the new account that you created.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    http://support.Microsoft.com/kb/947242

    A temporary profile is loaded after you connect to a Windows Vista-based system

    See you soon.

    Mick Murphy - Microsoft partner

  • [ADF, JDev12.1.3] (1) creating a "select a Choiche" from a query 2-fields and 2) to get the key of the selected element?

    Hallo,

    I have a VO based query, that query is like that...

    Select field1 as keyField, Field2 as valueField

    table

    By dragging the VO istance in the page I want to create a Choiche a Select...

    The list should show only the values of valueFields.

    Moreover, in my bean I need to get the keyField to the selected line (not the valueField).

    You kindly could you tell me which is the right approach to create the list choiche and what code I use to get the keyField to the selected item in the list?

    Thank you very much

    Federico

    Google would be useful.

    https://tompeez.WordPress.com/tag/afselectonechoice/

  • Send with blackBerry Smartphones, how to retrieve data from blackberry?

    Hi, I need to send an email to blackberry and on the user's response, I need to store this data in the database. Can u please help me in this regard. How to send email from web browser, and then retrieve the data in a database.

    khushi289 wrote:
    OK ya... We use Tomact 6. How do you after that

    It is a forum oriented BlackBerry technology, you have questions about web development. I think it's best for you is to find some tutorials on the internet on "how to create a web application on tomcat with a database" or try a forum oriented Tomcat directly.

  • How to retrieve the view coming from Onyx?

    Hello

    I started to use the Onyx project recently. That is truly amazing to see what he does. I wonder if there is a possibility to check the main view... let my try to explain this.

    I want to change the box of esxi5 - Advanced/Logging option to external syslog server.

    While in the interface graphics, I did my steps and Onyx prints the output:

    #---UpdateOptions-

    $changedValue = new-Object VMware.Vim.OptionValue [] (1)
    $changedValue [0] = new-Object VMware.Vim.OptionValue
    .key $changedValue [0] = "Syslog.global.logHost".
    $changedValue [0] .value = "tcp://x.x.x.x:514".

    _this $ = get-view-Id "OptionManager-EsxHostAdvSettings-456.
    _this $. UpdateOptions ($changedValue)

    This does not work as expected. I can throw it to powercli and it will introduce the option. This works only for this area special esxi. I want to create a loop that will change this option to each area of esxi in the cluster.

    The view that uses onyx is: ' Get-View-Id "OptionManager-EsxHostAdvSettings-456'»»

    That he already knows the moref / host of the view.

    But if I would like to have this in a loop, so it will do for each host, so how can I get this kind of view?

    So far, I could build only something like

    foreach($vmhostview_in_(get-view-ViewType_HostSystem-SearchRoot_(get-cluster_"xxyyzz").ID))

    {

    $changedValue = new-Object VMware.Vim.OptionValue [] (1)
    $changedValue [0] = new-Object VMware.Vim.OptionValue
    .key $changedValue [0] = "Syslog.global.logHost".
    $changedValue [0] .value = "tcp://x.x.x.x:514".

    $number = $vmhostview.moref.split("-") [1]

    _this $ = get-view-Id OptionManager - EsxHostAdvSettings - $nombre
    _this $. UpdateOptions ($changedValue)

    }

    Which is totally stupid approach I think it works... splitting moref...

    After a while, I noticed that

    http://pubs.VMware.com/VI-SDK/visdk250/ReferenceGuide/Vim.option.OptionManager.html

    Said OptionManager is owned by configuration manager. So that I could get the id from this point of view:

    ((get-vmhost myHost | get-vue).) ConfigManager.AdvancedOption). ToString()

    which will result in the output: OptionManager-EsxHostAdvSettings-456

    In order to have this I could make my loop at the end:

    foreach($vmhostview_in_(get-view-ViewType_HostSystem-SearchRoot_(get-cluster_"xxyyzz").ID))

    {

    $changedValue = new-Object VMware.Vim.OptionValue [] (1)
    $changedValue [0] = new-Object VMware.Vim.OptionValue
    .key $changedValue [0] = "Syslog.global.logHost".
    $changedValue [0] .value = "tcp://x.x.x.x:514".

    _this $ = get-view-Id ($vmhostview. ConfigManager.AdvancedOption). ToString()

    _this $. UpdateOptions ($changedValue)

    }

    Now I don't know that it was just a chance that I found the location of the view name or it's the way I'm supposed to find the name of view id. I wonder how other people treat such cases, if there is more easy way to do it. If someone could share its experience I would really appreciate it.

    Kind regards

    Greg

    There is not need to build these view ID as you see them from Onyx.

    In fact, I wanted to write this script like this

    $changedValue = New-Object VMware.Vim.OptionValue[] (1)
    $changedValue[0] = New-Object VMware.Vim.OptionValue $changedValue[0].key = "Syslog.global.logHost" $changedValue[0].value = "tcp://x.x.x.x:514"
    
    Get-View -ViewType HostSystem -Searchroot (Get-Cluster "xxyyzz").ExtensionData.MoRef | %{
      $optMgr = Get-View $_.ConfigManager.AdvancedOption  $optMgr.UpdateOptions($changedValue)
    }
    
    • Move the part that does not change with each HostSystem outside the loop
    • The ConfigManager is a table with MoRefs pointing to the respective managers. You can just do a Get - view with a MoRef and it returns the object that represents the Manager
    • From the object manager, you can now call the method

    BTW, you better see the last SDK Reference.

    You can find the HostConfigManager here.

  • How to clear the selection on an ADF faces table?

    I thought I'd call setSelectedRowKeys (null) gives the desired result. However it is not. Can you think of a reason why it would not clear the selection? What should I do?

    Here's the specific scenario:

    I have a two ADF faces table tell A and B with a column each and both of them have simple lines and their rowSelection property is set to "single". Now the requirement is when a line is selected from A, it must clear all selections of B and vice versa. So I registered selectionListeners on the tables and the code that is running inside this method does the following for the table has not been selected :

    tablenNotSelected.setSelectedRowKeys (null);

    lets say, I click on a first line, then on a row of B. So far so good. So if I click on the A, the control won't to the SelectionListener method. I think that SelectionEvent isn't getting fired no doubt because the previous selection has not been erased.

    JDev version I use is JDEVADF_MAIN_GENERIC_121113.1351.6521

    What I'm missing here?

    Published by: 981525 on January 23, 2013 08:20

    try to add addPartialTarget (table) after you turn off the selection.

  • How to retrieve the identifier of ADF security in PL/SQL?

    I would like to create a database trigger to save changes to a table and want to take the username logged through the ADF security configuration.
    How to retrieve this username (not the database user name) in the trigger?

    Thank you
    Richard

    You can override the prepareSession() method in the ApplicationModuleImpl class and call dbms_application_info.set_client_info () or dbms_session.set_identifier () to change the user name to db.
    Then, in the relaxation use sys_context ('USERENV', "CLIENT_INFO") or sys_context (' USERENV', 'CLIENT_IDENTIFIER' "); to retrieve the user name.

    Dario

  • My iPhone was stolen then, how they took my phone from iCloud, after that I locked and then removed from my iTunes account I don't drink my imei number how to retrieve the relics and information the iPhone? How are they aloud to remove the phone?

    MY iPhone 5 has been stolen and removed my iCloud and I tunes blocked even after I have it how is this power to make and how can I recover it? I have more the IMEI on the phone, that I would like to know how to get the imei number so I can get it locked is aloud to have the service on this subject? And I wonder also why it is so easy for Apple allow others to remove your phone from iTunes with notification this phone was my dead fiance, who gave it to our son 7 years, 2 months before his death, I am very disappointed by protection apples that she can be taken so easily! Please help me to get it back

    Have you received an email or a text message indicating that the aircraft had been located and you inviting them to connect to iCloud to follow it?

  • Create Table in Access with AutoIncrement field

    Hello

    I like to create a new table in an access database.

    The problem is to create an ID field with autoincrement. I can add "not null" and "primary key" for the field, but not the option "autoincrement".

    You have a solution to this problem?

    Thank you

    Marcus

    Access autoincrement

    It seems that if the Autoincrement does not work, you can try Counter as specification of column.

    /Y

  • unconsciously I blocked the memory card from my camera with BitLocker. How I unlock my card.

    in fact when I use my computer, unconsciously I clicked on BitLocker and my memory card is locked. After that I've faced some strange problems, even if my card is 4 GB and free space is 3.18 GB; While it shows that the memory card is full. Please tell me how could I unlock my card?

    Hello

     
    What is the brand and model of the memory card?
     
    I suggest you to refer to the links and check if it helps.
    In Windows 7 BitLocker Drive Encryption: frequently asked Questions
     
    How to use the BitLocker Repair tool to help recover data from a volume encrypted in Windows Vista or in Windows Server 2008
    Note: Also applies to Windows 7.
     
    See also:
    BitLocker Drive Encryption

    If the problem persists, try to disable and re-enable Bitlocker.
    Steps to follow:

    (a) click Start and then click Control Panel.

    (b) click on security.
    (c) click BitLocker Drive encryption.
    (d) if the user account control dialog box appears, check the action proposed is correct and then click on continue.
    (e) click on disable BitLocker.
    (f) click on disable BitLocker.
    (g) in the window of the BitLocker Drive encryption, click on turn on BitLocker.
    (h) close to the BitLocker Drive encryption.
     
    Hope this solves the problem. If the problem persists, you can write to us and we will be happy to help you further.
  • [ADF, JDev 12.1.3] Fragment 3 sections (each with a grid + form): best solution to commit / rollback all changes at the same time?

    Hallo,

    I need to create a fragment like page2create.jsff in this picture http://digilander.libero.it/flattit82/OTN_FILES/TotalCommRoll.png

    You kindly could give me some advice on how to achieve the result shown in the picture?

    Could you a panel tabs help keep the 3 sections on the same page and making it simpler handling of commit / rollback as requested?

    Thank you

    Federico

    Hello

    Yes, you can use panelTabbed to create this type of layout and for the handling of commit or rollback

    1. If you want to commit and a rollback for all 3 tabs then place these buttons (Commit and Rollback) outside panelTabbed and allow the creation, update and deletion on all tabs at the same time, after completing the user operation can use commit or rollback for all tabs

    2. If you want to commit separate and operation of catering for the different tab, then create and modify mode disable other tabs except the active tab, and only after a commit or rollback in the current tab allow the user to navigate to the different tab

    Thank you

  • CS6: create a simple extension: how to copy the selected text in the extension?

    Hello

    with this tutorial http://www.DWfaq.com/Tutorials/Extensions/simple_object.asp

    I created a very simple extensions in Dreamweaver CS6.

    But I can't find out how to get the code/selected text "in" this extension.

    I want to reformat the selection with the javascript code for the extension and replace the selected text.

    Thank you!

    mtemp

    Thank you very much for your answer!

    I didn't know the difference between these two methods - my google search for 'extension' led me directly to the old tutorial mentioned...

    And, Yes, I had to search long enough to find the 'object' extension on the fly on the menu...

    Now, I adapted the code referred to in the dreamweaver_cs5_extending.pdf for the creation of such an extension of command - and, wow, it works... with 'copy' the text selected in the extension form.

    So, thanks again! Now I'm on the right track

  • [ADF, JDev12.1.3] Validation happens when LOV "lens" is clicked. How to avoid this?

    Hallo,

    I created a form of a VO istance which some fields are required.

    In the form, there is a LOV.

    When I click on the 'lens' of LOV validation happens.

    I would like to avoid this behavior.

    The solution is simply to set the immediate property of the LOV to 'true '?

    Thank you

    Federico

    I created a form of a VO istance which some fields are required.

    In the form, there is a LOV.

    When I click on the 'lens' of LOV validation happens.

    This was probably not happen.

    So, do you have something specific in your code? (for example, LOV on part of primary key, partially initialized row, etc.?)

    Is autosubmit = true set on your lov component?

    Is there a difference, if you set ChangeEventPolicy = none to your iterator?

    The solution is simply to set the immediate property of the LOV to 'true '?

    If this will solve the problem, then Yes

    Dario

Maybe you are looking for

  • TS140 install Windows 2012 on RAID 1

    Hello I intend to install a Windows Server 2012 on a TS140 using RAID 1 configuration. As I read in the manuals, the RAID is most often used with the CSM (compatibility Support Module), but as Windows 2012 supports UEFI, it could be used with the dri

  • left click of the mouse program

    I have a button on the Panel before the VI. I can set the key Focus on true property node. Then, I want to do a left click of the mouse. Apparently this can be done by calling user32.dll. Is there a better way? Is it possible to help generate the use

  • Ultra maximum admissible height drive to Slimbay

    Does anyone know what is the admissible maximum height in the car in the Slimbay Ultra (more specifically I have the T400), or know a way to find this info?

  • forgotten administers the password

    I am running Vista on my desktop and had it locked, however I forgot the password of the administrater, which of course means that I can't use my account. Is it possible to do it unlocked without reinstalling windows? Thank you Karen

  • How to make "just in time" debugging?

    I get a dialog referring me to the jit debugging when I try to run back to the top. I can't find more than a vague answer to the mod. suggesting that I go on debugging under 'tools '. No luck there.