You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Kai Jemella <ne...@googlemail.com> on 2006/10/27 13:22:09 UTC
Tobago f:param or updateActionListener
Hello iam trying to get a parameter in my Managed-Bean:
<tc:link action="#{managedBean.dummy}" label="dummy">
<f:param name="test" value="test"/>
</tc:link>
In my Managed-Bean
public String dummy(){
FacesContext context = FacesContext.getCurrentInstance();
Map map = context.getExternalContext().getRequestParameterMap();
test = (String) map.get("test");
System.out.println("ParamTest: "+test);
return "index";
}
But i only get nothing -> null, it is possible to parse a param with
f:param? I saw the improvement
http://issues.apache.org/jira/browse/TOBAGO-78
and so i updated to 1.0.9 snapshot version from the repository but it is
still not working.
Pleas tell me somebody what my failure is or how i can parse a Parameter in
Tobago.
Does updateAcitonListener working in Tobago?
Big THX
-kai
Re: Tobago f:param or updateActionListener
Posted by Prashant_Srini <pr...@wipro.com>.
Kai Jemella wrote:
>
> Hello Bernd,
>
> thank you very much for helping me.
>
> Kai
>
>
> 2006/10/27, Bernd Bohmann <be...@atanion.com>:
>>
>> Hello Kai,
>>
>> the parameter is only included in the case of the tc:link link attribute.
>>
>> As suggested by Volker on this list you can use this
>>
>> <tc:column label="Spaltenname 1" sortable="false" align="left">
>> <tc:link label="#{rowData.value}"
>> actionListener="#{testForm.click}" >
>> <f:parameter name="value" value="#{rowData.value}"/>
>> </tc:link>
>> </tc:column>
>>
>>
>> in the actionListener you can get the value:
>>
>> UICommand link = (UICommand)actionEvent.getComponent();
>> UIParameter param = (UIParameter)link.getChildren().get(0); // there
>> is no other child
>> Object value = param.getValue();
>>
>> in a action you can get the current row from the tc:sheet component
>> binding
>>
>> table // is the componentbinding to the table
>> Object row = table.getRowData();
>>
>> the return value depends on the DataModel
>>
>> How you can get the selected row in Tobago is described in the
>>
>> tobago-example-addressbook;
>>
>> http://svn.apache.org/repos/asf/myfaces/tobago/trunk/example/addressbook/
>>
>>
>> I don't see any reason why updateActionListener should not work in
>> Tobago. I think it is renderkit independent.
>>
>>
>> Regards
>>
>>
>> Bernd
>>
>>
>> Kai Jemella wrote:
>> > Hello iam trying to get a parameter in my Managed-Bean:
>> >
>> > <tc:link action="#{managedBean.dummy}" label="dummy">
>> >
>> > <f:param name="test" value="test"/>
>> >
>> > </tc:link>
>> >
>> > In my Managed-Bean
>> >
>> > public String dummy(){
>> >
>> > FacesContext context = FacesContext.getCurrentInstance();
>> > Map map = context.getExternalContext().getRequestParameterMap();
>> > test = (String) map.get("test");
>> >
>> > System.out.println("ParamTest: "+test);
>> >
>> > return "index";
>> > }
>> >
>> > But i only get nothing -> null, it is possible to parse a param with
>> > f:param? I saw the improvement
>> >
>> > http://issues.apache.org/jira/browse/TOBAGO-78
>> >
>> > and so i updated to 1.0.9 snapshot version from the repository but it
>> is
>> > still not working.
>> >
>> > Pleas tell me somebody what my failure is or how i can parse a
>> Parameter
>> in
>> > Tobago.
>> >
>> > Does updateAcitonListener working in Tobago?
>> >
>> > Big THX
>> >
>> > -kai
>> >
>>
>
>
--
View this message in context: http://www.nabble.com/Tobago-f%3Aparam-or-updateActionListener-tf2519966.html#a9705794
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: Tobago f:param or updateActionListener
Posted by ne...@googlemail.com.
Hello Bernd,
thank you very much for helping me.
Kai
2006/10/27, Bernd Bohmann <be...@atanion.com>:
>
> Hello Kai,
>
> the parameter is only included in the case of the tc:link link attribute.
>
> As suggested by Volker on this list you can use this
>
> <tc:column label="Spaltenname 1" sortable="false" align="left">
> <tc:link label="#{rowData.value}"
> actionListener="#{testForm.click}" >
> <f:parameter name="value" value="#{rowData.value}"/>
> </tc:link>
> </tc:column>
>
>
> in the actionListener you can get the value:
>
> UICommand link = (UICommand)actionEvent.getComponent();
> UIParameter param = (UIParameter)link.getChildren().get(0); // there
> is no other child
> Object value = param.getValue();
>
> in a action you can get the current row from the tc:sheet component
> binding
>
> table // is the componentbinding to the table
> Object row = table.getRowData();
>
> the return value depends on the DataModel
>
> How you can get the selected row in Tobago is described in the
>
> tobago-example-addressbook;
>
> http://svn.apache.org/repos/asf/myfaces/tobago/trunk/example/addressbook/
>
>
> I don't see any reason why updateActionListener should not work in
> Tobago. I think it is renderkit independent.
>
>
> Regards
>
>
> Bernd
>
>
> Kai Jemella wrote:
> > Hello iam trying to get a parameter in my Managed-Bean:
> >
> > <tc:link action="#{managedBean.dummy}" label="dummy">
> >
> > <f:param name="test" value="test"/>
> >
> > </tc:link>
> >
> > In my Managed-Bean
> >
> > public String dummy(){
> >
> > FacesContext context = FacesContext.getCurrentInstance();
> > Map map = context.getExternalContext().getRequestParameterMap();
> > test = (String) map.get("test");
> >
> > System.out.println("ParamTest: "+test);
> >
> > return "index";
> > }
> >
> > But i only get nothing -> null, it is possible to parse a param with
> > f:param? I saw the improvement
> >
> > http://issues.apache.org/jira/browse/TOBAGO-78
> >
> > and so i updated to 1.0.9 snapshot version from the repository but it is
> > still not working.
> >
> > Pleas tell me somebody what my failure is or how i can parse a Parameter
> in
> > Tobago.
> >
> > Does updateAcitonListener working in Tobago?
> >
> > Big THX
> >
> > -kai
> >
>
Re: Tobago f:param or updateActionListener
Posted by Bernd Bohmann <be...@atanion.com>.
Hello Kai,
the parameter is only included in the case of the tc:link link attribute.
As suggested by Volker on this list you can use this
<tc:column label="Spaltenname 1" sortable="false" align="left">
<tc:link label="#{rowData.value}"
actionListener="#{testForm.click}" >
<f:parameter name="value" value="#{rowData.value}"/>
</tc:link>
</tc:column>
in the actionListener you can get the value:
UICommand link = (UICommand)actionEvent.getComponent();
UIParameter param = (UIParameter)link.getChildren().get(0); // there
is no other child
Object value = param.getValue();
in a action you can get the current row from the tc:sheet component binding
table // is the componentbinding to the table
Object row = table.getRowData();
the return value depends on the DataModel
How you can get the selected row in Tobago is described in the
tobago-example-addressbook;
http://svn.apache.org/repos/asf/myfaces/tobago/trunk/example/addressbook/
I don't see any reason why updateActionListener should not work in
Tobago. I think it is renderkit independent.
Regards
Bernd
Kai Jemella wrote:
> Hello iam trying to get a parameter in my Managed-Bean:
>
> <tc:link action="#{managedBean.dummy}" label="dummy">
>
> <f:param name="test" value="test"/>
>
> </tc:link>
>
> In my Managed-Bean
>
> public String dummy(){
>
> FacesContext context = FacesContext.getCurrentInstance();
> Map map = context.getExternalContext().getRequestParameterMap();
> test = (String) map.get("test");
>
> System.out.println("ParamTest: "+test);
>
> return "index";
> }
>
> But i only get nothing -> null, it is possible to parse a param with
> f:param? I saw the improvement
>
> http://issues.apache.org/jira/browse/TOBAGO-78
>
> and so i updated to 1.0.9 snapshot version from the repository but it is
> still not working.
>
> Pleas tell me somebody what my failure is or how i can parse a Parameter in
> Tobago.
>
> Does updateAcitonListener working in Tobago?
>
> Big THX
>
> -kai
>
Re: Tobago f:param or updateActionListener
Posted by Mike Kienenberger <mk...@gmail.com>.
On 10/27/06, Kai Jemella <ne...@googlemail.com> wrote:
> Does updateAcitonListener working in Tobago?
If you are using Facelets (1.1.11 or later) or JSF 1.2, you should use
f:setPropertyActionListener instead of t:updateActionListener.