Side Effects using a UIInput  to determine whether a component is rendered

Hi,
I'm trying to use the value of a UIInput component to decide whether or not to render another component and am getting some strange side effects. When the hidden component is re-rendered after being hidden, the selected value is not displayed. This does not happen if I copy the value of a ValueChangeEvent and then use that as my return value. Any idea what is going on here? Switching the commented out line in getControllerValue in BackingBean.java should demonstrate the issue.
Thanks,
Pierce
index.jsp<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     version="2.0">
     <jsp:directive.page contentType="text/html; charset=UTF-8" />
     <f:view>
          <html>
          <head>
          <title>test</title>
          </head>
          <body>
          <h:form id="testForm">
               <h:panelGrid columns="2" columnClasses="labelColumn, inputColumn">
                    <!-- controlling input -->
                    <h:outputLabel value="Controller:"></h:outputLabel>
                    <h:selectOneMenu id="controller"
                         binding="#{backingBean.controller}"
                         valueChangeListener="#{backingBean.changeController}"
                         immediate="true" onchange="submit()" required="true">
                         <f:selectItems value="#{backingBean.controllerItems}" />
                    </h:selectOneMenu>
                    <!-- controlled input -->
                    <h:outputLabel for="hideme" value="Input to hide:"
                         rendered="#{(backingBean.controllerValue != 1) and (backingBean.controllerValue != 5)}"></h:outputLabel>
                    <h:selectOneRadio id="hideme" value="#{backingBean.hideme}"
                         required="true"
                         rendered="#{(backingBean.controllerValue != 1) and (backingBean.controllerValue != 5)}"
                         >
                         <f:selectItems value="#{backingBean.hidemeItems}" />
                    </h:selectOneRadio>
               </h:panelGrid>
          </h:form>
          </body>
          </html>
     </f:view>
</jsp:root>BackingBean.java
package test;
import java.util.LinkedList;
import java.util.List;
import javax.faces.component.UIInput;
import javax.faces.component.html.HtmlSelectOneMenu;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
public class BackingBean {
     private UIInput controller = new HtmlSelectOneMenu();
     private Integer hideme = 2;
     private Integer copiedValue;
     private List<SelectItem> controllerItems = new LinkedList<SelectItem>();
    private List<SelectItem> hidemeItems = new LinkedList<SelectItem>();
    public BackingBean(){
         controller.setValue("3");
         controller.setSubmittedValue("3");
         copiedValue = 3;
         controllerItems.add(new SelectItem(1, "Controller 1"));
         controllerItems.add(new SelectItem(2, "Controller 2"));
         controllerItems.add(new SelectItem(3, "Controller 3"));
         controllerItems.add(new SelectItem(4, "Controller 4"));
         controllerItems.add(new SelectItem(5, "Controller 5"));
         hidemeItems.add(new SelectItem(1, "Hide Me 1"));
         hidemeItems.add(new SelectItem(2, "Hide Me 2"));
         hidemeItems.add(new SelectItem(3, "Hide Me 3"));
     public UIInput getController() {
          return controller;
     public void setController(UIInput controller) {
          this.controller = controller;
     public Integer getHideme() {
          return hideme;
     public void setHideme(Integer hideme) {
          this.hideme = hideme;
     public List<SelectItem> getControllerItems() {
          return controllerItems;
     public List<SelectItem> getHidemeItems() {
          return hidemeItems;
      * Value change listener
     public void changeController(ValueChangeEvent e){
          System.out.println((String)e.getNewValue());
          copiedValue = Integer.parseInt((String)e.getNewValue());
      * Helper
     public Integer getControllerValue(){
        // why does the following line not work?
     //     return Integer.parseInt((String)controller.getValue());
          return copiedValue;
}

This is a How to test a variable to determine whether it is a NUMBER.
Cheers, APC

Similar Messages

  • The indicator to determine whether it is a case of the start or the finish

    Hello Gurus,
    In CJ20N, for internal activities, there is a "Person assignement" tab. And in this tab there is "date" field.
    The explaination of this date is:
    "Latest date for the start or finish of the split.
    You can use the indicator to determine whether it is a case of the start or the finish date."
    My problem is: where can I find the "indicator" mentioned?
    Thanks
    JM

    There is no specific indicator for this.
    Go to internal tab - you will see a field called DistKeyCapRqIn
    if this is blank then the system goes to the work centre master data for distribution of work load - if the work centre is blank then system defaults to earliest dates - which gets transferred to the person assignment tab.
    Now go bak to the internal tab and set field DistKeyCapRqIn to SAP030 - you will now see that the dates in the person assignment are showing latest dates.
    The dates for the activities can be seen based on scheduing in the dates tab

  • Determine when a component comes into view in a scrollpane

    So I have an application called FlickrBackup (http://sunkencity.org/flickrbackup). The main page of the GUI goes out to flickr (a photosharing site) and downloads a list of all your photos. It then creates little square panels that have the photos thumbnails on them and allows you to select them. Currently, the GUI goes out and downloads ALL the thumbnails and loads them all into the GUI. I would like to change it to only go out an download the thumbnail IF that panel/photo is visible in the scrollpane. The reason for this is because some users have upwards of 3000+ photos, so many of them are running into memory issues. If they don't even scrolldown to look at them, why should I load them?
    So here is what I have:
    A JPanel with a ScrollPane we'll call the ImageContainer
    I add many PhotoDisplayPanels to the image container. Most of them are outside the visible viewports view (something like 20 fit on the screen). These panels just use a JLabel to display the photo.
    I have tried adding a HierarchyListener to the PhotoDisplayPanel, but the event(any HierarchyEvent, not just showing/displayable) is only fired once and that is when the component is added to the ImageContainer and is shown for the first time.
    Does anyone know if there is a way to get notified when a component becomes visible in a scrollpanes view?
    I'm also confused by the terminology used in the javadocs for isShowing and the HierarchyEvents. isShowing says:
    "Determines whether this component is showing on screen. This means that the component must be visible, and it must be in a container that is visible and showing."
    Does the first 'visible' mean setVisible(true)? Or does it mean I can see it with my own two eyes? It seems once you add a component to a panel, it is by default in a visible state unless you specifically setVisible(false).
    Any help you can give would be great!
    Thanks!
    Andrew

    your player is in the middle of the screen, i just
    dont have a picture for that yetWell, nothing happens, even using the arrow keys. Sorry, but I'm giving up.

  • Hey guyz.. i wanna ask if i get an updated version from itunes when i plug my iPhone into the Pc, i get a letter tells me that there is an update for your iPhone ... i wanna ask is it safe to download ?? and does it make any side effects on longTerm using

    hey guyz.. i wanna ask if i get an updated version from itunes when i plug my iPhone into the Pc, i get a letter tells me that there is an update for your iPhone ... i wanna ask is it safe to download ?? and does it make any side effects on longTerm using ??

    It is safe to download if your phone is not jailbroken. Before you download it, however, take some precautions:
    Reboot your computer
    Disable your antivirus and firewall
    Connect the phone cable to a USB port directly on the computer, not a hub
    Before updating right click on the name of the phone in iTunes and choose "Backup"
    When you are given the choice choose "Download only", not "Download and Update"
    After the download completes successfully click the Update button to install it.
    Most of these steps are just being overly cautious, as most people ignore them and have no problems. But occasionally the extra steps save grief.

  • Using Field Blend plug-in, any side effects?

    Cutting an HDV show with lots of action. Camera may have had 'sharpen' mode set too high, but end result is that the action scenes show way too much of the 'interlace lines' in playback on an LCD screen. Distractingly so.
    I used the Field Blend plug-in from Joe's Filters on the whole show, and get a very smooth looking clean result. No interlace lines on LCD screen.
    But! What I'm wondering is: will this have a negative effect when I output the HDV Quicktime master to MPEG2 and DVD?
    Is there some side-effect one has to deal with when using the Field Blend plug-in?
    All ears, thank you,
    Ben

    Are there any side effects of munging two fields
    together? Yes. You are about halving your resolution.
    The show works fine on an NTSC monitor. But the client will be showing it on a lovely new laptop, and also projecting it in a large cinema theatre.
    The thing that puzzles me Patrick, is that I play both versions on a 23 inch Apple HD Cinema monitor and I cannot for the life of me see any difference, other than the 'blended' version is not full of interlace artefacting. I KNOW it's SUPPOSED to be less resolution. But I can't SEE any difference. Maybe on a 35 foot theatre screen?
    Maybe Joe is doing something special with his plug-in?
    B.

  • Side effects of using catmeta.sql?

    Not exactly sure where to put this, but I've been having problems exporting, mostly around the XMLGEN part. It seems that the solution would be to rebuild all the views and whatnot, but since this is a live database, I'd like to know if there are any side effects accompanying using catmeta.sql or any of the related files.
    Thanks in advance!

    Running Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production under Windows XP. The error comes from exporting and comes up as
    Connected to: Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    About to export specified users ...
    . exporting pre-schema procedural objects and actions
    . exporting foreign function library names for user TEST
    . exporting PUBLIC type synonyms
    . exporting private type synonyms
    . exporting object type definitions for user TEST
    About to export TEST's objects ...
    . exporting database links
    . exporting sequence numbers
    . exporting cluster definitions
    EXP-00056: ORACLE error 19206 encountered
    ORA-19206: Invalid value for query or REF CURSOR parameter
    ORA-06512: at "SYS.DBMS_XMLGEN", line 83
    ORA-06512: at "SYS.DBMS_METADATA", line 345
    ORA-06512: at "SYS.DBMS_METADATA", line 410
    ORA-06512: at "SYS.DBMS_METADATA", line 449
    ORA-06512: at "SYS.DBMS_METADATA", line 1156
    ORA-06512: at "SYS.DBMS_METADATA", line 1141
    ORA-06512: at line 1
    EXP-00000: Export terminated unsuccessfully

  • Would like to disable HTTP and use only HTTPS yet I get side effects

    Hello,
    I have established a secure connection between the AS ABAP and AS Java.
    I would like assure that all communication between the servers is using https and for that, as a test, I have deactivated the http service using SMICM transaction.
    The only side effect I could recognize so far is that the Web Dynpro for ABAP stuff doesn't work through transaction SE80, the working area simply doesn't come up. If I activate HTTP again it is working.
    Am I doing the right thing by disabling HTTP completely and if yes, what else do I need to do in order to prevent this side effect from happening?
    Roy

    humuhumunukunukuapuaa wrote:
    If I get some nice approvals on my app spree in 10 days, I would like to close Talbots and Abercrombie and Fitch store cards. Total CL for the 2 is $2,700 ($1,350 each)  but I can make up for that closure and utilization loss by getting quite a bit more than those amounts on majors during my app spree. Talbots has only been open 4 months, A&F one year. I have other cards that are the same age or older so should not majorly affect AaoA. Thoughts? I know some will say don't close cards, but they're store cards and I don't need to be responsible for store cards I don't use.If you have no use for them and don't foresee using them in the future then you should probably close them out.  They won't affect your AAoA as the cards will stay in your reports for 10 years.  No sense in keeping cards that you don't want just to take up room in your sock drawer.

  • Side effects when using Graphics2D.drawString

    Hi! I am trying to render some texts in different places on a JPanel. I use Graphics2D.drawString(String, float , float). My problem is that the AffineTransform of the Graphics2D-object changes after each time I use the method. Should this really be the case? If so, do I need to reset the transformation object in the Graphics2D-object after each call to Graphics2D.drawString or how should I go about it? An example of a set of code and the yielded output is below:
                        System.out.println("graphics transform (before drawLine): " + g2.getTransform());
                        g2.drawString("test", 150, 50);
                        System.out.println("graphics transform (after drawLine): " + g2.getTransform());
    yields:
    graphics transform (before drawLine): AffineTransform[[1.0, 0.0, 0.0], [0.0, 1.0, 23.0]]
    graphics transform (after drawLine): AffineTransform[[1.0, 0.0, 150.0], [0.0, 1.0, 73.0]]

    Trying to produce a small set of code that reproduces the error made me solve the problem, though I do not understand why. Anyhow, I am using Java 1.4.1, and use Mac OS. Code that reproduces the error is below. By uncomment the line ' g2.setColor(Color.black);', the problem dissapears. But please let me know if anyone have an explanation to why setting a gradient paint makes Graphics2D.drawString have the side effect I described above...
    import java.util.*;
    import java.awt.*;
    import javax.swing.*;
    public class Plotter extends JFrame {
         public Plotter() {
              super("Debug");
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              Dimension contentSize = new Dimension(500, 500);
              pack();
              setSize(contentSize);
              setVisible(true);
         public void paint(Graphics g) {
              super.paint(g);
              Graphics2D g2 = (Graphics2D) g;
              g2.setPaint(new GradientPaint(0, 0, Color.green, 100, 0, Color.red, true));
    //          g2.setColor(Color.black);
              System.out.println("graphics transform (before drawLine): " + g2.getTransform());
              g2.drawString("test", 150, 50);
              System.out.println("graphics transform (after drawLine): " + g2.getTransform());     
         public static void main(String args[]) {
              new Plotter();

  • What are the non-obvious side-effects of using $psdefaultparametervalues.add("ft:wrap",$True) ?

    I'm thinking about dropping these two lines into my profile.ps1 script:
    $psdefaultparametervalues.add("ft:wrap",$True)
    $psdefaultparametervalues.add("ft:auto",$True)
    Are there any adverse side-effects that I will suffer after I do that?
    I know that I'll have to do explicit overrides to those switch values to Format-Table if I don't want those defaults.

    One thing I can think of is if you use -Property * to list everything, it has the potential to leave out columns if the properties are too long.
    Try this first:
    gci | Select -first 1 | FT *
    Then this:
    gci | Select -first 1 | FT * -auto -wrap
    Besides that , I can't really think of anything else; perhaps others can think of things.
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

  • Determine whether to use itemRenderer

    Since itermRendererd is applied column-wise. I was wondering if it is possible to determine whether to apply the itemRenderer according to data. I only want to use the itermRenderer when the value is between 1-5 (the itemRenderer would render the text into image). If the value is other than 1-5, i don't want it to be rendererd into images. Any ideas?

    Try overriding createColumnItemRenderer
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Adding transitions when using side by side effect

    I recently found the side by side effect in iMovie '11 and I love it. The only issue is that when I try to add in transitions between clips, the transitions won't show up. If anyone has any idea on what I can do, please let me know. Thanks

    well, technically, that is true, although you could fake it a bit, if instead of side by side transitions, you used the picture in picture instead, you can specify a few transitions with that from the gear menu-

  • I have tryed the "find my ipod application" and i tried to lock it and it have been locked but i am using the ipod without any effects but if by time would be any side effects?

    i have tryed the "find my ipod application" and i tried to lock it and it have been locked but i am using the ipod without any effects but if by time would be any side effects?

    It will be locked when you connect it to Wi-Fi

  • What determines whether the Label name and/or Caption appears in the context help window but in other cases, both the label and caption appear in the context help window?

    I am trying to polish an application, and find that I cannot seem to reliably control which of the label or caption text appears in the context help window because I don't understand what rules are in place to determine which should appear. It seems like if I reate a named constant, then use it's right click menu command "Create Indicator" I get a control with only a Label (as long as I don't add a caption). This then appears in the context help window as the label name followed by the description text (after entering some description text). But if I add a caption, the label name is shown in bracket
    s which is a 'feature' I would like to avoid, because I have certain controls where I would like to use a descriptive variable name on the block diagram side without using so much space on the front panel. It seems like there is no way to avoid showing the Label name in the context help for a control/indicator. Is this true?
    I thought the purpose of having a seperate caption was to make the text that appears with a control programmatically controllable, but if that control is not extended to what appears in the context help window, it limits the usefulness of the caption and forces me to re-consider some Label names. However, the problem goes deeper than that because then even when I make the label and caption exactly the same, or if I delete (via a select caption text-backspace or select caption text- delete key .. sequence) the caption for a control, the label name in the context help window still appears in square brackets!
    Can I have complete control over the context help fo
    r a particular control (or has anyone found a third-party context help solution that functions compatibly with LabVIEW 7 in a built application that they will be so kind as to recommend?)
    I have used LabVIEW for three years, and I am now using LabVIEW 7.0.

    Sorry for that.. I was changing the text of my question and didn't read carefully enough in the preview stage. I wanted it to read "What determines whether the Label name and/or Caption appears in the context help window?"

  • Using VB 2005 to detect whether a PDF is a collection

    I'm having a bear of a time using my rudimentary programming skills (Visual Basic 2005) to write a utility that will scan a folder containing PDF files and then list which of them contains a collection (either a Package or a Portfolio).
    I've been able to create the file-side piece (allow the user to select the folder, scan the folder and populate a ListBox with all PDF files in the folder).
    Now I have to scan those PDFs and determine whether or not any of them are PDF Collections (I then hope to populate another ListBox with that list of files). That's where I'm confused.
    I've seen a number of examples of Programming Acrobat JavaScript using VB. I've also found one reference in the PDFTron Knowledge Base that discusses figuring out whether a PDF is a Collection. He uses the following to do that:
    Obj collection = doc.GetRoot().FindObj("Collection");
    if (collection != NULL) {
    //This PDF contains a Collection
    I can follow in general what this code fragment is doing but I can't seem to translate it into something useable in VB 2005.
    I'm guessing that I need to somehow use GetJSObject (or maybe I'm wrong) but I can't figure out how or in what context I can get the collection information.
    Additionally, I'm hoping that when my program runs through the list of PDFs looking for the collection info, I can do it without having Acrobat (or Reader) open. I don't know if this is possible (all of the samples that I've seen seem to initially open Acrobat).
    Thanks, in advance, for your help!

    Thanks Leonard!
    Oh, I've been reading the documentation - my head is spinning from reading it for the past 2 days ! :-)
    Unfortunbately, I've seen no sign of a doc.hasCollection() method.
    I've found a "collection" property of the doc object in the Javascript for Acrobat API Reference.
    I also found the "getDataObject" method for the doc object in the same document.
    I became pretty excited when I found this one because if I click the link on that page to dataObjects, it tells me that it's an array containing all of the named data objects in a document.
    If I click from there on the link to "data", it shoots me to the "data" page where I read:
    "The following objects, properties and methods support PDF portfolios (also called PDF collections or PDF packages):
    app.newCollection, Doc.collection, Collection object, and collectionField object".
    Again, I think that I'm on the right track because it mentions the "Collection object" and "Doc.collection" but for the life of me, I can't figure out how to reference these properties in my program.
    For instance:
           Dim varColl
            gPDDoc.Open("c:\adobe.pdf")
            jso = gPDDoc.GetJSObject
            varColl = jso.getdataobject.Collection()
    tells me that I'm missing a required argument.
    If I try something like:
           Dim varColl
            gPDDoc.Open("c:\adobe.pdf")
             jso = gPDDoc.GetJSObject
             varColl = jso.Collection()
    Then I get:
    "Public member 'Collection' on type '_ComObject' not found."
    I'm sorry to be obtuse but I can't figure out how to reference these.
    I've followed the examples in the "Programming Acrobat JavaScript Using Visual Basic" document and they all make sense. I just can't seem to get to the "Collection" information.
    Any help would be greatly appreciated.
    Thanks!

  • [Solved] Side effects of compiling on slower machines.

    So, I had been doin' casual stuff on my big 'ol laptop (Quad-core I7), when it's bios randomly bricked and I was unable to boot. (I think it was the bios, since it crashed on the boot logo before dying.)
    Anyway, I now have a silly lil' lappy (Dual-Core I3 fuq yeah!) which I actually bought for school.
    Compiling linux-pf took ~5 hours, and wine-silverlight around the same time.
    I wonder, since compiling tasks have to be split over only 2 cores (I use -j4 anyway ), and they have to work much harder to compile because they don't have as much power as I7, does compiling also affect the lifetime of the lappy much more than it did on my "big 'ol laptop"?
    And, does it also have more side effects?
    EDIT: I forgot to state that the lappy is a netbook.
    Last edited by mid-kid (2013-10-23 07:26:28)

    Anoknusa is on the right track.   There is actually an analogy to electrical circuits when looking at heat flow.   Essentially, heat is dissipated in the junctions of the transistors in the die.  the temperature of the die is a function of the heat capacity of silicon, and the amount of heat present.  If the die is insulated thermally, then heat cannot flow from the device and the temperature will increase without bounds (or until something melts)
    If there is a thermal sink (Think the heat sink), and a thermal source (the die), and a thermal path between them, then heat will flow from the source to the sink.  The rate of heat flow is determined by the delta (difference) in temperature between the temperature of the source and the sink, and the thermal resistance between them.  Thermal resistance is a function of the material (plastics have a low thermal conductivity, metals and ceramics have high conductivity) and the area.  ICs are rated at maximum junction temperatures and define the thermal conductivity to the case.
    So, the variables include the thermal conductivity of the processor, the junction temperature at which the processor runs (a function of the number of transistors and who fast they switch), the area on top of the processor on to which you can attach a heatsink, the ambient temperature around the heatsink, the size of the heatsink, the airflow over the heat sink, and the thermal conductivity of the goo between the heatsink and the case of the processor (BTW, Air is a sucky thermal conductor, so a heatsink without goo is worthless).   To make things even more complex, many modern chips have thermal pads under the parts that are intended to be soldered down to ground layers on the printed circuit board to allow the board itself to act as a heatsink.  These pads are impossible to solder without a surface mount reflow process.  I think the Ras-Pi has a processor with this type of thermal pad.   This type of thermal pad is not compatible with socketed devices.  In fact, sockets probably do a pretty good job of insulating the entire bottom of a processor.
    Last edited by ewaller (2013-10-19 16:36:59)

Maybe you are looking for

  • Why are some of my songs listed in red?

    Why are some of the songs and albums listed in red in my library?

  • Can't Use Using The FTP In Dreamweaver

    Hi all, I've got the FTP in Dreamweaver linked up to my site but I'm having troubles. I can download the pages from my host using the Dreamweaver FTP but I can't upload I just get a timed out message. I tried CuteFTP and I can upload & download with

  • Oracle 9i and Redhat Enterprise WS

    Hi everyone, Does anyone know if there is any compatible problem between Oracle 9i and RH WS 'coz I am going to purchase RH WS? And I jsut want to make sure the compatability beforehand. Stephanie

  • How to get path of downloaded file?

    Hi, I use JDeveloper 11g with ADF. I have to download file with original date. If i want to save date i have to zip file. After that to unzip. My queation is: when clien download file how to get path of downloaded file???? Because, i want to save unz

  • What are this things in my document and how can I get rid oth them

    Hi, I'm a happy recent switcher, I'm migrating my .doc documents to pages '08 but sometimes I'm getting weird vertical lines and triangles in the pages document. What are they and how can I get rid of it, cause they get printed. There is no way to af