Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 72549 invoked from network); 28 Sep 2007 18:18:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Sep 2007 18:18:31 -0000 Received: (qmail 44350 invoked by uid 500); 28 Sep 2007 18:18:20 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 44292 invoked by uid 500); 28 Sep 2007 18:18:19 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 44281 invoked by uid 99); 28 Sep 2007 18:18:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Sep 2007 11:18:19 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [213.46.255.22] (HELO viefep16-int.chello.at) (213.46.255.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Sep 2007 18:18:19 +0000 Received: from [192.168.0.4] (really [84.113.196.60]) by viefep16-int.chello.at (InterMail vM.7.08.02.00 201-2186-121-20061213) with ESMTP id <20070928181756.LUBE9357.viefep16-int.chello.at@[192.168.0.4]> for ; Fri, 28 Sep 2007 20:17:56 +0200 Subject: Re: adding parameters for actionHandler From: simon To: MyFaces Development In-Reply-To: <473235.17751.qm@web52302.mail.re2.yahoo.com> References: <473235.17751.qm@web52302.mail.re2.yahoo.com> Content-Type: text/plain Date: Fri, 28 Sep 2007 20:16:56 +0200 Message-Id: <1191003416.10154.12.camel@simon-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Fri, 2007-09-28 at 08:40 -0700, Gianluca Correndo wrote: > Hello everyone, > I have started to develop with MyFaces and Tobago few weeks ago. I > have used > tomahawk for a while and with it there was an easy way to add > parameters to an > event for customising actions. For example in a page I could add a link > to > erase one ontology I manage: > > action="#{SessionBean.eraseOntology}"> > > > > > And the event handler was able to retrieve the parameter "oid" from the > faces > context with: > > public void eraseOntology(ActionEvent actionEvent){ > String oid = > javax.faces.context.FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("oid"); > > Now in the Tobago library this doesn't work anymore. How can I > achieve the > same behaviour? I don't know why it's not working, but there is an elegant alternative. With JSF1.1 you can use the tomahawk t:updateActionListener tag to get the same effect. The JSF1.2 standard has made this a part of the standard. For JSF1.1, see updateActionListener here: http://myfaces.apache.org/tomahawk/tlddoc/index.html The setOntologyToErase method will be called before eraseOntology. For JSF1.2, see f:setPropertyActionListener here: http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/index.html NB: I haven't used this for a while so the syntax might not be exactly right.. Regards, Simon