?? Figure out which JSF UIComponent caused a BackingBean "get" method call?

Hi,
I have a little problem with using JSF UIComponents and Backing beans.
I have an JSF Input TextField and this textField points to a backing bean attribute "Data.value" (to store the input). Code:
<h:inputText styleClass="entryInput"
id="textNumberOfServersInput"
value="#{AllData.value}">
</h:inputText>
The Backing bean for that looks like this (just the really important stuff):
public class AllDataBean
String value = null;
public String getValue()
return value;
public void setValue(String string)
value = string;
Now my problem is that, when calling the "getValue()" method I want to know which UIComponent caused that getValue() method call. I would like to know that UIComponent's ID. In the above example (textField) this id would be "textNumberOfServersInput" . HOW CAN I GET THE requesting UIComponent 's ID ?
At the end my getValue method should look like this:
public String getValue()
String requestingUIComponentID = IWouldLikeToKnowThat();
return value;
Thanks

Ahh, that's interesting. But any component can do a get. In other
words, you can have several components that point to the same bean
property. Assuming your pages are fairly static in nature, you could
instrument them with JSTL c:set calls to manually stick an identifier
into the namespace. Something like this:
<h:form id="form">
<c:set var="doAGet" scope="request" value="button" />
<h:commandButton id="button" value="#{bean.label}" />
<c:remove var="doAGet" scope="request" />
<c:set var="doAGet" scope="request" value="text" />
<h:outputText id="text" value="#{bean.label2}" />
<c:remove var="doAGet" scope="request" />
</h:form>
Then, in your backing bean, you could do:
public String getLabel() {
FacesContext context = FacesContext.getCurrentInstance();
String id = (String)
context.getExternalContext().getRequestMap().get("button");
id = "form:" + id;
UIComponent component = context.getViewRoot().findComponent("id");
It's clunky but it works. I'll ask the EG if they think we should add
the ability for the get() to more easily discover the calling component,
if any.
Ed (EG Member)

Similar Messages

  • How can if figure out which contacts are in both iCloud and on my Mac?

    I keep contacts on my Mac and on iCloud.  I want to see which ones are in both databases.  Some of them automatically "linked" and others did not.  The search for showing contacts that are both a member of "my Mac" and a member of "iCloud" does not seem to work.  I also want to figure out which contacts are not in a group and this has been difficult as well.

    If you change your preferences so that the defaul is not iCloud then you get two sections like this:
    When I don't have it set to On My Mac then I only get one section because all of my cards are in the cloud.

  • HT4943 Newsstand shows a 1 but I can't figure out which magazine needs updating...help!

    Newsstand shows a "1" but I can't figure out which magazine needs updating.  Help?

    I have no idea why you are doing what you are doing so I will make a couple of related points.
    1. Put your table partition, and its indexes, into a single tablespace and leave them there. If you do not understand why there has been volumes written on the subject by everyone from Tom Kyte, Jonathan Lewis, Richard Foote, etc. Essentially the entire membership of the Oak Table Network has weighed in on this one.
    2. If you are going to create partitioned indexes leverage the built-in capabilities in DBMS_PCLXUTIL.
    http://www.morganslibrary.org/reference/dbms_pclxutil.html

  • Can't figure out which upgrade (from 7 Pro) is smartest: 9 Pro? or X Pro?

    Can't figure out which upgrade (from 7 Pro) is smartest: 9 Pro? or X Pro?
    Should I just ignore the nay-sayers and go ahead with X Pro?
    Thanks in advance for anyone willing to bring me up to speed.
    Dharmamitra
    Kalavinka Press
    Optional & Extraneous background data:
    I've taken a break from book design, layout, and publishing since finishing 10 books 2 years ago (Kalavinkapress.org). But now I'm back into the thick of it with a another flock of long-doc books in my lap.
    Result, I'm now faced with upgrading my IDCS3 & Acrobat 7 Pro. (I'm still OK with my P-shop & Illustrator versions), but am utterly clueless about the advisability of Acro X Pro over the still-available Acro 9 Pro. (I've seen some fairly loud squeaking about X Pro problems.)

    It depends a bit on what you're going to use it for. I do mostly forms work and have both versions, but do most of my work with Acrobat 9, and even use Acrobat 7 for some things. There are some initial bugs with Acrobat 10 that need to be worked out, but I'd probably recommend it for most folks.

  • I'm trying to install OEM SR 2.1: Windows 95B in Qemu...  How do I figure out which brand of CD-ROM drive Qemu emulates since I have three different drive specific boot disks...?

    I'm trying to install OEM SR 2.1: Windows 95B in Qemu...  How do I figure out which brand of CD-ROM drive Qemu emulates since I have three different drive specific boot disks...?

    Not exactly...; all MS produced Win9X/ME install CDs are ISO-9660 & maybe even Joliet too...  The really confusing part is that not all Windows 98 SE full install CDs are even bootable in the first place (they tend to only ship one if the PC is capable of booting directly from its optical drive...; the vast majority of PCs have to use the chain loading method due to buggy, poorly written, outdated BIOSes...; etc.).  OEM SR 2.1/Windows 95B is really quite special & innovative for its time in that it was the first Service Release of Windows 95 to support larger HDs via FAT32 which back then was still brand new: i.e.: exciting technology & it still has proven to be quite useful & versatile since most flash memory storage devices come pre-formatted FAT32.
    There's also a hidden X:\Usbsupp folder on the CD that contains the MS USB 1.1 supplement patches/upgrader: a common mis-nomer is that you don't need to install it unless your PC has USB 1.1 ports.  Even without USB 1.1 ports the upgrades to C:\Windows\system make it a lot less buggy, more secure & stable.  For anyone else that enjoys emulating OEM SR 2.1 there's also a great unofficial SP 1 for it which has so many useful patches in it I'm considering integrating it into all of my install CDs... 
    Unfortunately I've found that getting it to run decently requires tracking down a bevy of essential but according to MS's not releasing them in patch form optional DLL upgrades...  I guess not all machines are that unreliable but better to have them...; just in case you encounter a PC with a buggy BIOS that has hardware coniptions and/or ACPI/APM bugs.

  • [svn:fx-4.x] 14337: Revert this file from mirroring PARB change 14431 until I can figure out why it is causing a graphic test failure .

    Revision: 14337
    Revision: 14337
    Author:   [email protected]
    Date:     2010-02-22 12:31:24 -0800 (Mon, 22 Feb 2010)
    Log Message:
    Revert this file from mirroring PARB change 14431 until I can figure out why it is causing a graphic test failure.
    QE notes:
    Doc notes: None
    Bugs:
    Reviewed By:
    Tests run: checkintests
    Is noteworthy for integration: No
    Modified Paths:
        flex/sdk/branches/4.x/frameworks/projects/spark/src/spark/primitives/supportClasses/Graph icElement.as

    Revision: 14337
    Revision: 14337
    Author:   [email protected]
    Date:     2010-02-22 12:31:24 -0800 (Mon, 22 Feb 2010)
    Log Message:
    Revert this file from mirroring PARB change 14431 until I can figure out why it is causing a graphic test failure.
    QE notes:
    Doc notes: None
    Bugs:
    Reviewed By:
    Tests run: checkintests
    Is noteworthy for integration: No
    Modified Paths:
        flex/sdk/branches/4.x/frameworks/projects/spark/src/spark/primitives/supportClasses/Graph icElement.as

  • How to figure out which tables are using Extensible Optimizer?

    Hi guys,
    I'm sure that there're several tables those are associated with Extensible Optimizer in my database, I can also find the Extensible Optimizer relevant type and the implementation of interface functions ODCIGetInterfaces, ODCIStatsTableFunction.
    I'm curious to know is there a way to figure out which tables are associated with this Extensible Optimizer, does anyone have any clues?
    Database: oracle 11.2
    Thank you in advance.

    Hi,
    Can you please check the below link.It may help you:
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28425/ext_optimizer.htm
    Best regards,
    Rafi.
    http://rafioracledba.blogspot.com

  • Help...Can't figure out which AirPort card I need...

    I need help figuring out which is the correct AirPort card for my old emac. (see specs below)
    I don't know if this model is too old. I don't know how to tell if the emac is "ATI Graphics" or "USB 2.0." These are listed separately as two different emac models in the "compatible" computers for the AirPort Express card.
    Any help/direction would be GREATLY appreciated!
    _**Hardware Overview:**_
    Machine Name: eMac
    Machine Model: PowerMac4,4
    CPU Type: PowerPC G4 (2.1)
    Number Of CPUs: 1
    CPU Speed: 700 MHz
    L2 Cache (per CPU): 256 KB
    Memory: 640 MB
    Bus Speed: 100 MHz
    Boot ROM Version: 4.4.2f1

    Hi LVT and Welcome to Apple Discussions,
    The 700 takes the original Apple Airport 802.11b Wireless Card like here:
    http://eshop.macsales.com/item/Apple/M7600LLE/
    Here's how to install it if you don't already know. It's a weird one:
    http://support.apple.com/kb/HT2596
    Richard

  • Trying to figure out which older GPIB I have

    I have an old GBIB I want to put in a new Dell computer, Win2000. I know I need to download new drivers, but can't figure out which ones. The GPIB is marked 429C(handwritten) 488EX. A small sticker is marked NEC REV Q 0295. Thanks.

    Hello,
    Sometime's it's the simplest answer.
    We were told our computer had a NI GPIB. After your response, I checked again and found CEC on the board. A quick internet search and I found the manufacturer.
    Thank you for your quick response. I really appreciate it!

  • Figuring out which JRadioButton is selected

    Hey guys. I have a simple program that calculates tempurature in Fahrenheit, Celcius and Kelven.
    There are 6 Radiobuttons in a ButtonGroup. I need to know how to get which radiobutton is selected.
    Here is my code....I already have an action listener for the buttons that runs the code to do the calculations and display the answer, I just need to know how to figure out which radiobuton is selected.
    Thanks!
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.text.DecimalFormat;
    public class DegreeConverter extends JFrame{
    JLabel lblFah, lblConversion,lblShowConversion;
    JTextField getFah;
    JButton btnConvert;
    JRadioButton btnFahToCel, btnFahToKel,
                   btnCelToFah,btnCelToKel,
                   btnKelToFah, btnKelToCel;
    ButtonGroup radioGroup;
         public DegreeConverter(){
              super("Degree Converter");
              super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JFrame.setDefaultLookAndFeelDecorated(true);
            Container container1 = getContentPane();
            SpringLayout layout = new SpringLayout();
            container1.setLayout(layout);
            lblFah = new JLabel("Enter Temperature:");
            container1.add(lblFah);
            getFah = new JTextField(5);
            container1.add(getFah);
            lblConversion = new JLabel("Conversion Answer:");
              container1.add(lblConversion);
              lblShowConversion = new JLabel("...");
             container1.add(lblShowConversion);
            btnConvert = new JButton("Convert");
            btnConvert.addActionListener(
                   new ActionListener(){
                        public void actionPerformed(ActionEvent event){
                             String strFah = getFah.getText();
                             double dblFah = Double.parseDouble(strFah);
                          lblShowConversion.setText(Double.toString(convertDegrees(dblFah)));
            container1.add(btnConvert);
            btnFahToCel = new JRadioButton("Fahrenheit To Celcius", true);
            container1.add(btnFahToCel);
            btnFahToKel = new JRadioButton("Fahrenheit To Kelvin", true);
            container1.add(btnFahToKel);
            btnCelToFah = new JRadioButton("Celcius To Fahrenheit", true);
            container1.add(btnCelToFah);
            btnCelToKel = new JRadioButton("Celcius To Kelvin", true);
            container1.add(btnCelToKel);
            btnKelToFah = new JRadioButton("Kelvin To Fahrenheit", true);
            container1.add(btnKelToFah);
            btnKelToCel = new JRadioButton("Kelvin To Celcius", true);
            container1.add(btnKelToCel);
            radioGroup = new ButtonGroup();
            radioGroup.add(btnFahToCel);
            radioGroup.add(btnFahToKel);
            radioGroup.add(btnCelToFah);
            radioGroup.add(btnCelToKel);
            radioGroup.add(btnKelToFah);
            radioGroup.add(btnKelToCel);
              //layout for btnFahToCel
            layout.putConstraint(SpringLayout.WEST, btnFahToCel,
                                   5,
                                   SpringLayout.WEST, container1);
              layout.putConstraint(SpringLayout.NORTH, btnFahToCel,
                                   5,
                                   SpringLayout.NORTH, container1);
              //layout for btnFahToKel
            layout.putConstraint(SpringLayout.WEST, btnFahToKel,
                                   5,
                                   SpringLayout.WEST, container1);
              layout.putConstraint(SpringLayout.NORTH, btnFahToKel,
                                   5,
                                   SpringLayout.SOUTH, btnFahToCel);
              //layout for btnCelToFah
            layout.putConstraint(SpringLayout.WEST, btnCelToFah,
                                   5,
                                   SpringLayout.WEST, container1);
              layout.putConstraint(SpringLayout.NORTH, btnCelToFah,
                                   5,
                                   SpringLayout.SOUTH, btnFahToKel);
              //layout for btnCelToKel
            layout.putConstraint(SpringLayout.WEST, btnCelToKel,
                                   5,
                                   SpringLayout.WEST, container1);
              layout.putConstraint(SpringLayout.NORTH, btnCelToKel,
                                   5,
                                   SpringLayout.SOUTH, btnCelToFah);
              //layout for btnKelToFah
            layout.putConstraint(SpringLayout.WEST, btnKelToFah,
                                   5,
                                   SpringLayout.WEST, container1);
              layout.putConstraint(SpringLayout.NORTH, btnKelToFah,
                                   5,
                                   SpringLayout.SOUTH, btnCelToKel);
               //layout for btnKelToCel
            layout.putConstraint(SpringLayout.WEST, btnKelToCel,
                                   5,
                                   SpringLayout.WEST, container1);
              layout.putConstraint(SpringLayout.NORTH, btnKelToCel,
                                   5,
                                   SpringLayout.SOUTH, btnKelToFah);
              //layout for lblFah
            layout.putConstraint(SpringLayout.WEST, lblFah,
                                   15,
                                   SpringLayout.EAST, btnFahToCel);
              layout.putConstraint(SpringLayout.NORTH, lblFah,
                                   5,
                                   SpringLayout.NORTH, container1);
              //layout for getFah
              layout.putConstraint(SpringLayout.WEST, getFah,
                                       5,
                                        SpringLayout.EAST, lblFah);
              layout.putConstraint(SpringLayout.NORTH, getFah,
                                        5,
                                   SpringLayout.NORTH, container1);
              //layout for lblConversion
              layout.putConstraint(SpringLayout.WEST, lblConversion,
                                       22,
                                       SpringLayout.EAST, btnFahToKel);
              layout.putConstraint(SpringLayout.NORTH, lblConversion,
                                       5,
                                   SpringLayout.SOUTH, lblFah);
              //layout for lblShowConversion
              layout.putConstraint(SpringLayout.WEST, lblShowConversion,
                                       5,
                                       SpringLayout.EAST, lblConversion);
              layout.putConstraint(SpringLayout.NORTH, lblShowConversion,
                                        5,
                                   SpringLayout.SOUTH, lblFah);
              //layout for btnConvert
              layout.putConstraint(SpringLayout.WEST, btnConvert,
                                       15,
                                       SpringLayout.EAST, btnFahToCel);
              layout.putConstraint(SpringLayout.NORTH, btnConvert,
                                       5,
                                   SpringLayout.SOUTH, lblConversion);
                //layout for container
               layout.putConstraint(SpringLayout.EAST, container1,
                                   50,
                                   SpringLayout.EAST, getFah);
              layout.putConstraint(SpringLayout.SOUTH, container1,
                                   5,
                                   SpringLayout.SOUTH, btnKelToCel);
              pack();
            setVisible(true);
            }// end constructor
         public static void main(String args[]){
                 DegreeConverter application = new DegreeConverter();
         public double convertDegrees( double fah){
    //currently there is only one calculation here.. I need to figure out
    //how to get which radiobutton is selected so i can do a select case
    //or if/else here to do the appropriate calculations.
              DecimalFormat twoDigits =  new DecimalFormat("00");
              String celcius;
              double returnCelcius;
              celcius = twoDigits.format(5.0/9.0 * (fah - 32));
              returnCelcius = Double.parseDouble(celcius);
              return returnCelcius;
         }//end convertDegrees
    }//end class

    Swing related questions should be posted in the Swing forum.
    1) Test each button
    If (button1.isSelected() )
    else if (button2.isSelected() )
    ....

  • HT201272 Anyone know how I can figure out which of my family's 5 Apple devices was used to purchase something from iTunes ?   We all have the same apple account/ID.   Thanks!

    Anyone know how I can figure out which of my family's 5 Apple devices was used to purchase a specific song via iTunes ?   We all have the same Apple ID/account which makes it tricky...  Thanks!

    valfromedina wrote:
    What I was afraid of.   Thanks.   Seems like someone at Apple should be figuring this out.  Would be nice to link each purchase to a specific device.
    That would not be practical or probably even possible since one of the features of recent versions of iTunes and the iTunes Store is to allow new purchases to be automatically downloaded to every device registered to your Apple ID when something is purchased. If you want purchases linked to specific devices, each user should have his or her own iTunes Store account.
    Regards.

  • Hey Guys ! I need help on figuring out which MacBook Air to buy . Please Help Me !

    I Need Help Figuring Out Which MacBook Air To Buy.

    Avoid the MacBook Pro (non retina) unless you absolutely need to burn or read DVD/CD media on the road and don't want to carry around a small external optical drive. That leaves the MBA and the MBPr as your two choices. The Air's advantage is extreme portability and battery life - especially with the standard CPU. The MBPr's main advantage is its display. Both are perfectly good workhorse computers for school and work. Neither is especially good for gaming other than casual games. In fact many games don't support the Intel integrated video at all.
    Once you've decided on which model I strongly recommend that you have at least 8GB of RAM. How large a drive depends on how much you intend to stuff onto your computer. Using my MBA for home and work, which includes a minimal installation of Windows 7 for programming and verifying that websites look and behave acceptably on both platforms, I can fit everything I need on a 256GB drive but could never live on a 128GB drive. My wife, however, could have saved a little cash and gone with the 128GB model.

  • I purchased adobe photoshop elements 13 from dell to download on my Mac OS   Which has been updated to maverick. When i download the link it goes into the download bucket and tells me to choose an app to open and I can't figure out which app to choose??

    How to download elements 13 to Mac OS computer. It's telling me to choose an app to open file. I can not figure out which

    if you have a serial number, and if you follow all 7 steps you can directly download a trial here:  Adobe Photoshop Elements 13 Direct Download Links, Premiere too | ProDesignTools
    and activate with your serial number.
    if you have a problem starting the download, you didn't follow all 7 steps, or your browser does not accept cookies. 
    the most common problem is caused by failing to meticulously follow steps 1,2 and/or 3 (which adds a cookie to your system enabling you to download the correct version from adobe.com). 
    failure to obtain that cookie results in an error page being displayed after clicking a link on prodesigntools.com or initiates the download of an incorrect (eg, current) version.
    or you can dl from dell,  https://smartsource.dell.com/

  • I'm on Mac OS 10.9.2 and I can't figure out which Acrobat XI Standard to download!

    I can't figure out if I should buy monthly subscription of Acrobat XI Standard (it says Windows only) or actually buy it for $299.  Somewhere else it implies I can only buy the monthly subscription for Mac OS.  Very confusing!  Isn't there a way to talk with someone at Adobe?
    megCO

    There is no "Standard" application for Acrobat on Mac OS X and there hasn't been one for a very....very long time. Think before Mac OS X.   The Subscription exists but it DOES NOT include an Acrobat application for Mac OS X unless you are using a virtual machine for Windows.

  • How to figure out which material documents should be deleted?

    Hi,
    I am creating a report that sums up material movement. But I meet a problem about reversal material documents.
    In my report, I collect all the documents and delete all the document with field SMBLN is not empty. Code is like below.
    MOVE it_mseg[] TO it_mseg2[].
      LOOP AT it_mseg WHERE smbln <> ''.
        LOOP AT it_mseg2 WHERE mblnr = it_mseg-smbln AND zeile = it_mseg-smblp.
          it_mseg-del = 'X'.
          MODIFY it_mseg.
          it_mseg2-del = 'X'.
          MODIFY it_mseg2.
        ENDLOOP.
      ENDLOOP.
      LOOP AT it_mseg2 WHERE del = 'X'.
        LOOP AT it_mseg WHERE mblnr = it_mseg2-mblnr AND zeile = it_mseg2-zeile.
          it_mseg-del = 'X'.
          MODIFY it_mseg.
        ENDLOOP.
      ENDLOOP.
      DELETE it_mseg WHERE del = 'X'.
    But sometimes users may cancel a material document, and later they may cancel the reversal document also.
    Then there are 3 documents. In my report, all these 3 documents will be deleted.
    Is there any method to only have the last document left and delete the others?
    Thank!
    Wesley

    Thanks Dzed, it seems the code works succesfully, and I also figure out another code like below, it also works~
      MOVE it_mseg[] TO it_mseg2[].
      LOOP AT it_mseg.
        LOOP AT it_mseg2 WHERE mblnr = it_mseg-mblnr AND zeile = it_mseg-zeile.
          IF it_mseg2-del = 'Y'. 
            it_mseg-del = 'X'.
            MODIFY it_mseg.
          ENDIF.
        ENDLOOP.
        IF it_mseg-del = 'X'.
          CONTINUE.
        ENDIF.
        LOOP AT it_mseg2 WHERE smbln = it_mseg-mblnr AND smblp = it_mseg-zeile.
          it_mseg-del = 'X'.
          MODIFY it_mseg.
          it_mseg2-del = 'Y'.  
          MODIFY it_mseg2.
        ENDLOOP.
      ENDLOOP.

Maybe you are looking for