Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 64421 invoked from network); 11 Sep 2006 16:29:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Sep 2006 16:29:43 -0000 Received: (qmail 30902 invoked by uid 500); 11 Sep 2006 16:29:39 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 30469 invoked by uid 500); 11 Sep 2006 16:29:38 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 30458 invoked by uid 99); 11 Sep 2006 16:29:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Sep 2006 09:29:38 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [198.240.128.81] (HELO ln-bas08.csfb.com) (198.240.128.81) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Sep 2006 09:29:37 -0700 Received: from slon11p30741.csfb.cs-group.com (slon11p30741.csfb.mail [166.12.48.145]) by ln-bas08.csfb.com (Postfix) with ESMTP id 2C8DB351C for ; Mon, 11 Sep 2006 17:28:37 +0100 (BST) Received: from 166.12.108.107 by slon11p30741.csfb.cs-group.com with ESMTP (P30741L (Email Firewall v6.2.2)); Mon, 11 Sep 2006 17:28:28 +0100 X-Server-Uuid: E393E0C4-680C-4DBB-91DB-7C5359B83991 Received: by slon11p31503.csfp.co.uk with Internet Mail Service ( 5.5.2653.19) id ; Mon, 11 Sep 2006 17:28:27 +0100 Message-ID: <92F4F49152E28B45B80BD95EB6F1F5390184D5A5@enyc11p32003.corpny.csfb.com> From: "Leyzerzon, Simeon" To: "'MyFaces Discussion'" Subject: RE: HtmlSelectOneMenu valueChange behavior Date: Mon, 11 Sep 2006 17:28:25 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) X-WSS-ID: 691B5126250567812-01-03 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C6D5BF.0CCD259E" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C6D5BF.0CCD259E Content-Type: text/plain Content-Transfer-Encoding: 7bit Sorry, I meant to say that calling this.getReportName() in the buidControl() listener returns null whereas event.getNewValue() works. Simeon _____ From: Leyzerzon, Simeon [mailto:simeon.leyzerzon@credit-suisse.com] Sent: Monday, September 11, 2006 12:21 PM To: 'users@myfaces.apache.org' Subject: HtmlSelectOneMenu valueChange behavior Hi, I have the following code in my application, and it works, but I'm wondering if this is the right way to do it: public HtmlPanelGrid getPanelGrid() { grid = new HtmlPanelGrid(); grid.setColumns(4); grid.setBgcolor("red"); HtmlSelectOneMenu chooser = new HtmlSelectOneMenu(); chooser.setId("reportsOfCategory"); chooser.setOnchange("submit()"); chooser.setValue("${selector.reportName}"); chooser.setValueChangeListener(application.createMethodBinding( "#{selector.buildControls}", new Class[] { ValueChangeEvent.class})); chooser.setTitle("Please select a report to run"); chooser.getChildren().add(ReportsPerCategoryMapper.getOptionItems(this.getCategory().getName())); grid.getChildren().add(chooser); //this is only for testing grid.getChildren().add(displayCategory()); return grid; } public void buildControls(ValueChangeEvent event) { System.out.println("I got the report's name: " + event.getNewValue()); } Calling chooser.getValue() in the listener method returns null, whereas event.getNewValue() works. Could someone please explan this behavior. What is the purpose of chooser.setValue() if getting the value doesn't work? Would it be correct to do: reportName = event.getNewValue(); or is there a better way? TIA. Simeon Leyzerzon Risk IT <<...OLE_Obj...>> Tel: 212-538-7518 Profile < http://people.csfb.net/from_gtd.asp?gtdid=1160763> ============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ============================================================================== ============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ============================================================================== ------_=_NextPart_001_01C6D5BF.0CCD259E Content-Type: text/html Content-Transfer-Encoding: 7bit HtmlSelectOneMenu valueChange behavior
Sorry, I meant to say that calling this.getReportName() in the buidControl() listener returns null whereas event.getNewValue() works.
Simeon


From: Leyzerzon, Simeon [mailto:simeon.leyzerzon@credit-suisse.com]
Sent: Monday, September 11, 2006 12:21 PM
To: 'users@myfaces.apache.org'
Subject: HtmlSelectOneMenu valueChange behavior

Hi,
I have the following code in my application, and it works, but I'm wondering if this is the right way to do it:

public HtmlPanelGrid getPanelGrid() {
       
        grid = new HtmlPanelGrid();
        grid.setColumns(4);
        grid.setBgcolor("red");

        HtmlSelectOneMenu chooser = new HtmlSelectOneMenu();
        chooser.setId("reportsOfCategory");
        chooser.setOnchange("submit()");
        chooser.setValue("${selector.reportName}");
        chooser.setValueChangeListener(application.createMethodBinding(
                "#{selector.buildControls}",
                new Class[] { ValueChangeEvent.class}));
        chooser.setTitle("Please select a report to run");
        chooser.getChildren().add(ReportsPerCategoryMapper.getOptionItems(this.getCategory().getName()));
       
        grid.getChildren().add(chooser);
        //this is only for testing
        grid.getChildren().add(displayCategory());
        return grid;
    }
   
    public void buildControls(ValueChangeEvent event) {
        System.out.println("I got the report's name: " + event.getNewValue());
    }


Calling chooser.getValue() in the listener method returns null, whereas event.getNewValue() works.  Could someone please explan this behavior.  What is the purpose of chooser.setValue() if getting the value doesn't work?  Would it be correct to do:

                reportName = event.getNewValue();

or is there a better way?

TIA.

Simeon Leyzerzon
Risk IT
<<...OLE_Obj...>>
     
Tel: 212-538-7518
Profile <http://people.csfb.net/from_gtd.asp?gtdid=1160763>


==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================

==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================

------_=_NextPart_001_01C6D5BF.0CCD259E--