You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Clemens Sietas <si...@gmx.de> on 2007/03/26 13:14:20 UTC

[Tobago] using value from tc:link on server

Hello,

how can I get hold of the displayed label in a
tc:link in the server code.

       <tc:sheet value="#{mainctrl.ctrDlgMainDialog.leftTableBoData}" columns="2*;6*" var="leftTableBoData">
          <tc:column label="Id"
                     id="name" sortable="true">
            <tc:link action="#{mainctrl.ctrDlgMainDialog.searchRightAction}" immediate="true"
                     label="#{leftTableBoData.leftTable01Column}"/>

The label contains the id. When the link is clicked I need
the Id as string on the server for a search for a second table.
How can I read the value of the label?

Thanks in advance
Clemens Sietas

-- 
--------------------------------------------
Clemens Sietas
email: siecle@gmx.de
--------------------------------------------



Re: [Tobago] using value from tc:link on server

Posted by Michał 'Gandalf' Stawicki <st...@gmail.com>.
I don't know if it should work, but you could try this:

define a request scope bean using spring, where you will store the ID.
Using Spring, inject this bean into bean where you need to use the ID.
Now, in the tc:link's listener, get yours link object from event, read
ID from it, and store it in the request scoped bean. Then you can
access ID where you have injected the request scoped bean.

This is what I would try at first

regards,
michał

On 27/03/07, Clemens Sietas <si...@gmx.de> wrote:
> Hi Volker,
>
> thank you for your answer.
> However, I could not get the grip of the solution
> for my tc:link problem from the popup-example.
>
> My table (sheet) is filled by a database select.
> One column is configured as link and the lable of the
> link is filled with a specific Id (String).
> When the link is clicked the Id should be used for
> a further select.
> The table does not know what Id is in the specific row.
>
> Is it correct to use the lable to display the value of the Id?
> The lable is bound (var="leftTableBoData) with reference
> of the list which is (bean-)bound via the sheet (mainctrl.ctrDlgMainDialog.leftTableBoData).
> The lable calls the method leftTableBoData (label="#{leftTableBoData.leftTable01Column}").
>
> This is the normal binding I used to know, unfortunately I have
> no idea how to get the String value back to the server?
> (Listener?/Action-Method?)
>
> Again thanks for any help
> Regards
> Clemens
>
> -------- Original-Nachricht --------
> Datum: Mon, 26 Mar 2007 16:03:53 +0200
> Von: "Volker Weber" <v....@inexso.de>
> An: "MyFaces Discussion" <us...@myfaces.apache.org>
> Betreff: Re: [Tobago] using value from tc:link on server
>
> > Hi Clemens,
> >
> > please see this thread:
> >
> > http://www.nabble.com/-Tobago--Popup-inside-tc%3Asheet-tf3466547.html
> >
> > and ask here again if this did not help.
> >
> > Regards,
> >   Volker
> >
> > 2007/3/26, Clemens Sietas <si...@gmx.de>:
> > > Hello,
> > >
> > > how can I get hold of the displayed label in a
> > > tc:link in the server code.
> > >
> > >        <tc:sheet value="#{mainctrl.ctrDlgMainDialog.leftTableBoData}"
> > columns="2*;6*" var="leftTableBoData">
> > >           <tc:column label="Id"
> > >                      id="name" sortable="true">
> > >             <tc:link
> > action="#{mainctrl.ctrDlgMainDialog.searchRightAction}" immediate="true"
> > >                      label="#{leftTableBoData.leftTable01Column}"/>
> > >
> > > The label contains the id. When the link is clicked I need
> > > the Id as string on the server for a search for a second table.
> > > How can I read the value of the label?
> > >
> > > Thanks in advance
> > > Clemens Sietas
> > >
> > > --
> > > --------------------------------------------
> > > Clemens Sietas
> > > email: siecle@gmx.de
> > > --------------------------------------------
> > >
> > >
> > >
>
> --
> --------------------------------------------
> Clemens Sietas
> email: siecle@gmx.de
> --------------------------------------------
>
>
>


-- 
stawicki@gmail.com
http://stawicki.jasliska.pl
GG: 3691111
JID: stawicki@gmail.com

Re: [Tobago] using value from tc:link on server

Posted by Clemens Sietas <si...@gmx.de>.
Hi Volker,

this was the perfect solution!

So far I never used "internal" classes like
UIComponent and UIData despite the amount of
code I have writen in Tobago.

I hope this brings me closer to understand
Tobago internals.

Thank you very much!

Regards
Clemens

-------- Original-Nachricht --------
Datum: Tue, 27 Mar 2007 11:27:11 +0200
Von: "Volker Weber" <v....@inexso.de>
An: "MyFaces Discussion" <us...@myfaces.apache.org>
Betreff: Re: [Tobago] using value from tc:link on server

> Hi,
> 
> if you use the actionListener attribute instead of the action attribute,
> (if you need to do navagation here you need both) you get a
> actionEvent in your method
> and can get the actual rowdata:
> 
> <tc:link
> actionListener="#{mainctrl.ctrDlgMainDialog.searchRightActionListener}"
> ...
> 
> public void searchRightActionListener(ActionEvent event) {
> 
>   UIComponent o = event.getComponent();
>   while(o != null && !(o instanceof UIData)) {
>     o = o.getParent();
>   }
>   UIData data = (UIData)(o);
> 
>   leftTableBoData = data.getRowData();
>   id = leftTableBoData.getLeftTable01Column();
> 
> }
> 
> Regards,
>   Volker
> 
> 2007/3/27, Clemens Sietas <si...@gmx.de>:
> > Hi Volker,
> >
> > thank you for your answer.
> > However, I could not get the grip of the solution
> > for my tc:link problem from the popup-example.
> >
> > My table (sheet) is filled by a database select.
> > One column is configured as link and the lable of the
> > link is filled with a specific Id (String).
> > When the link is clicked the Id should be used for
> > a further select.
> > The table does not know what Id is in the specific row.
> >
> > Is it correct to use the lable to display the value of the Id?
> > The lable is bound (var="leftTableBoData) with reference
> > of the list which is (bean-)bound via the sheet
> (mainctrl.ctrDlgMainDialog.leftTableBoData).
> > The lable calls the method leftTableBoData
> (label="#{leftTableBoData.leftTable01Column}").
> >
> > This is the normal binding I used to know, unfortunately I have
> > no idea how to get the String value back to the server?
> > (Listener?/Action-Method?)
> >
> > Again thanks for any help
> > Regards
> > Clemens
> >
> > -------- Original-Nachricht --------
> > Datum: Mon, 26 Mar 2007 16:03:53 +0200
> > Von: "Volker Weber" <v....@inexso.de>
> > An: "MyFaces Discussion" <us...@myfaces.apache.org>
> > Betreff: Re: [Tobago] using value from tc:link on server
> >
> > > Hi Clemens,
> > >
> > > please see this thread:
> > >
> > > http://www.nabble.com/-Tobago--Popup-inside-tc%3Asheet-tf3466547.html
> > >
> > > and ask here again if this did not help.
> > >
> > > Regards,
> > >   Volker
> > >
> > > 2007/3/26, Clemens Sietas <si...@gmx.de>:
> > > > Hello,
> > > >
> > > > how can I get hold of the displayed label in a
> > > > tc:link in the server code.
> > > >
> > > >        <tc:sheet
> value="#{mainctrl.ctrDlgMainDialog.leftTableBoData}"
> > > columns="2*;6*" var="leftTableBoData">
> > > >           <tc:column label="Id"
> > > >                      id="name" sortable="true">
> > > >             <tc:link
> > > action="#{mainctrl.ctrDlgMainDialog.searchRightAction}"
> immediate="true"
> > > >                      label="#{leftTableBoData.leftTable01Column}"/>
> > > >
> > > > The label contains the id. When the link is clicked I need
> > > > the Id as string on the server for a search for a second table.
> > > > How can I read the value of the label?
> > > >
> > > > Thanks in advance
> > > > Clemens Sietas
> > > >
> > > > --
> > > > --------------------------------------------
> > > > Clemens Sietas
> > > > email: siecle@gmx.de
> > > > --------------------------------------------
> > > >
> > > >
> > > >
> >
> > --
> > --------------------------------------------
> > Clemens Sietas
> > email: siecle@gmx.de
> > --------------------------------------------
> >
> >
> >

-- 
--------------------------------------------
Clemens Sietas
email: siecle@gmx.de
--------------------------------------------



unsubcribe

Posted by Francis Racine <fr...@hotmail.com>.


>From: "Volker Weber" <v....@inexso.de>
>Reply-To: "MyFaces Discussion" <us...@myfaces.apache.org>
>To: "MyFaces Discussion" <us...@myfaces.apache.org>
>Subject: Re: [Tobago] using value from tc:link on server
>Date: Tue, 27 Mar 2007 11:27:11 +0200
>
>Hi,
>
>if you use the actionListener attribute instead of the action attribute,
>(if you need to do navagation here you need both) you get a
>actionEvent in your method
>and can get the actual rowdata:
>
><tc:link 
>actionListener="#{mainctrl.ctrDlgMainDialog.searchRightActionListener}"
>...
>
>public void searchRightActionListener(ActionEvent event) {
>
>  UIComponent o = event.getComponent();
>  while(o != null && !(o instanceof UIData)) {
>    o = o.getParent();
>  }
>  UIData data = (UIData)(o);
>
>  leftTableBoData = data.getRowData();
>  id = leftTableBoData.getLeftTable01Column();
>
>}
>
>Regards,
>  Volker
>
>2007/3/27, Clemens Sietas <si...@gmx.de>:
>>Hi Volker,
>>
>>thank you for your answer.
>>However, I could not get the grip of the solution
>>for my tc:link problem from the popup-example.
>>
>>My table (sheet) is filled by a database select.
>>One column is configured as link and the lable of the
>>link is filled with a specific Id (String).
>>When the link is clicked the Id should be used for
>>a further select.
>>The table does not know what Id is in the specific row.
>>
>>Is it correct to use the lable to display the value of the Id?
>>The lable is bound (var="leftTableBoData) with reference
>>of the list which is (bean-)bound via the sheet 
>>(mainctrl.ctrDlgMainDialog.leftTableBoData).
>>The lable calls the method leftTableBoData 
>>(label="#{leftTableBoData.leftTable01Column}").
>>
>>This is the normal binding I used to know, unfortunately I have
>>no idea how to get the String value back to the server?
>>(Listener?/Action-Method?)
>>
>>Again thanks for any help
>>Regards
>>Clemens
>>
>>-------- Original-Nachricht --------
>>Datum: Mon, 26 Mar 2007 16:03:53 +0200
>>Von: "Volker Weber" <v....@inexso.de>
>>An: "MyFaces Discussion" <us...@myfaces.apache.org>
>>Betreff: Re: [Tobago] using value from tc:link on server
>>
>> > Hi Clemens,
>> >
>> > please see this thread:
>> >
>> > http://www.nabble.com/-Tobago--Popup-inside-tc%3Asheet-tf3466547.html
>> >
>> > and ask here again if this did not help.
>> >
>> > Regards,
>> >   Volker
>> >
>> > 2007/3/26, Clemens Sietas <si...@gmx.de>:
>> > > Hello,
>> > >
>> > > how can I get hold of the displayed label in a
>> > > tc:link in the server code.
>> > >
>> > >        <tc:sheet value="#{mainctrl.ctrDlgMainDialog.leftTableBoData}"
>> > columns="2*;6*" var="leftTableBoData">
>> > >           <tc:column label="Id"
>> > >                      id="name" sortable="true">
>> > >             <tc:link
>> > action="#{mainctrl.ctrDlgMainDialog.searchRightAction}" 
>>immediate="true"
>> > >                      label="#{leftTableBoData.leftTable01Column}"/>
>> > >
>> > > The label contains the id. When the link is clicked I need
>> > > the Id as string on the server for a search for a second table.
>> > > How can I read the value of the label?
>> > >
>> > > Thanks in advance
>> > > Clemens Sietas
>> > >
>> > > --
>> > > --------------------------------------------
>> > > Clemens Sietas
>> > > email: siecle@gmx.de
>> > > --------------------------------------------
>> > >
>> > >
>> > >
>>
>>--
>>--------------------------------------------
>>Clemens Sietas
>>email: siecle@gmx.de
>>--------------------------------------------
>>
>>
>>

_________________________________________________________________
Ne perdez pas de temps dans les files d’attente… magasinez en ligne.  
http://magasiner.sympatico.msn.ca


Re: [Tobago] using value from tc:link on server

Posted by Volker Weber <v....@inexso.de>.
Hi,

if you use the actionListener attribute instead of the action attribute,
(if you need to do navagation here you need both) you get a
actionEvent in your method
and can get the actual rowdata:

<tc:link actionListener="#{mainctrl.ctrDlgMainDialog.searchRightActionListener}"
...

public void searchRightActionListener(ActionEvent event) {

  UIComponent o = event.getComponent();
  while(o != null && !(o instanceof UIData)) {
    o = o.getParent();
  }
  UIData data = (UIData)(o);

  leftTableBoData = data.getRowData();
  id = leftTableBoData.getLeftTable01Column();

}

Regards,
  Volker

2007/3/27, Clemens Sietas <si...@gmx.de>:
> Hi Volker,
>
> thank you for your answer.
> However, I could not get the grip of the solution
> for my tc:link problem from the popup-example.
>
> My table (sheet) is filled by a database select.
> One column is configured as link and the lable of the
> link is filled with a specific Id (String).
> When the link is clicked the Id should be used for
> a further select.
> The table does not know what Id is in the specific row.
>
> Is it correct to use the lable to display the value of the Id?
> The lable is bound (var="leftTableBoData) with reference
> of the list which is (bean-)bound via the sheet (mainctrl.ctrDlgMainDialog.leftTableBoData).
> The lable calls the method leftTableBoData (label="#{leftTableBoData.leftTable01Column}").
>
> This is the normal binding I used to know, unfortunately I have
> no idea how to get the String value back to the server?
> (Listener?/Action-Method?)
>
> Again thanks for any help
> Regards
> Clemens
>
> -------- Original-Nachricht --------
> Datum: Mon, 26 Mar 2007 16:03:53 +0200
> Von: "Volker Weber" <v....@inexso.de>
> An: "MyFaces Discussion" <us...@myfaces.apache.org>
> Betreff: Re: [Tobago] using value from tc:link on server
>
> > Hi Clemens,
> >
> > please see this thread:
> >
> > http://www.nabble.com/-Tobago--Popup-inside-tc%3Asheet-tf3466547.html
> >
> > and ask here again if this did not help.
> >
> > Regards,
> >   Volker
> >
> > 2007/3/26, Clemens Sietas <si...@gmx.de>:
> > > Hello,
> > >
> > > how can I get hold of the displayed label in a
> > > tc:link in the server code.
> > >
> > >        <tc:sheet value="#{mainctrl.ctrDlgMainDialog.leftTableBoData}"
> > columns="2*;6*" var="leftTableBoData">
> > >           <tc:column label="Id"
> > >                      id="name" sortable="true">
> > >             <tc:link
> > action="#{mainctrl.ctrDlgMainDialog.searchRightAction}" immediate="true"
> > >                      label="#{leftTableBoData.leftTable01Column}"/>
> > >
> > > The label contains the id. When the link is clicked I need
> > > the Id as string on the server for a search for a second table.
> > > How can I read the value of the label?
> > >
> > > Thanks in advance
> > > Clemens Sietas
> > >
> > > --
> > > --------------------------------------------
> > > Clemens Sietas
> > > email: siecle@gmx.de
> > > --------------------------------------------
> > >
> > >
> > >
>
> --
> --------------------------------------------
> Clemens Sietas
> email: siecle@gmx.de
> --------------------------------------------
>
>
>

Re: [Tobago] using value from tc:link on server

Posted by Clemens Sietas <si...@gmx.de>.
Hi Volker,

thank you for your answer.
However, I could not get the grip of the solution
for my tc:link problem from the popup-example.

My table (sheet) is filled by a database select.
One column is configured as link and the lable of the
link is filled with a specific Id (String).
When the link is clicked the Id should be used for
a further select.
The table does not know what Id is in the specific row.

Is it correct to use the lable to display the value of the Id?
The lable is bound (var="leftTableBoData) with reference
of the list which is (bean-)bound via the sheet (mainctrl.ctrDlgMainDialog.leftTableBoData).
The lable calls the method leftTableBoData (label="#{leftTableBoData.leftTable01Column}").

This is the normal binding I used to know, unfortunately I have
no idea how to get the String value back to the server?
(Listener?/Action-Method?)

Again thanks for any help
Regards
Clemens

-------- Original-Nachricht --------
Datum: Mon, 26 Mar 2007 16:03:53 +0200
Von: "Volker Weber" <v....@inexso.de>
An: "MyFaces Discussion" <us...@myfaces.apache.org>
Betreff: Re: [Tobago] using value from tc:link on server

> Hi Clemens,
> 
> please see this thread:
> 
> http://www.nabble.com/-Tobago--Popup-inside-tc%3Asheet-tf3466547.html
> 
> and ask here again if this did not help.
> 
> Regards,
>   Volker
> 
> 2007/3/26, Clemens Sietas <si...@gmx.de>:
> > Hello,
> >
> > how can I get hold of the displayed label in a
> > tc:link in the server code.
> >
> >        <tc:sheet value="#{mainctrl.ctrDlgMainDialog.leftTableBoData}"
> columns="2*;6*" var="leftTableBoData">
> >           <tc:column label="Id"
> >                      id="name" sortable="true">
> >             <tc:link
> action="#{mainctrl.ctrDlgMainDialog.searchRightAction}" immediate="true"
> >                      label="#{leftTableBoData.leftTable01Column}"/>
> >
> > The label contains the id. When the link is clicked I need
> > the Id as string on the server for a search for a second table.
> > How can I read the value of the label?
> >
> > Thanks in advance
> > Clemens Sietas
> >
> > --
> > --------------------------------------------
> > Clemens Sietas
> > email: siecle@gmx.de
> > --------------------------------------------
> >
> >
> >

-- 
--------------------------------------------
Clemens Sietas
email: siecle@gmx.de
--------------------------------------------



Re: [Tobago] using value from tc:link on server

Posted by Volker Weber <v....@inexso.de>.
Hi Clemens,

please see this thread:

http://www.nabble.com/-Tobago--Popup-inside-tc%3Asheet-tf3466547.html

and ask here again if this did not help.

Regards,
  Volker

2007/3/26, Clemens Sietas <si...@gmx.de>:
> Hello,
>
> how can I get hold of the displayed label in a
> tc:link in the server code.
>
>        <tc:sheet value="#{mainctrl.ctrDlgMainDialog.leftTableBoData}" columns="2*;6*" var="leftTableBoData">
>           <tc:column label="Id"
>                      id="name" sortable="true">
>             <tc:link action="#{mainctrl.ctrDlgMainDialog.searchRightAction}" immediate="true"
>                      label="#{leftTableBoData.leftTable01Column}"/>
>
> The label contains the id. When the link is clicked I need
> the Id as string on the server for a search for a second table.
> How can I read the value of the label?
>
> Thanks in advance
> Clemens Sietas
>
> --
> --------------------------------------------
> Clemens Sietas
> email: siecle@gmx.de
> --------------------------------------------
>
>
>