You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Ad...@nordlb-it.de on 2006/10/24 16:41:29 UTC
Dynamic ID for in
I'm using Tobagos <tc:link> Tag inside of <tc:sheet> and accordingly in
<tc:column>.
When i'm trying to set my own ID-String for the ID-attribute of the
<tc:link>-Tag using a value from the sheetdata i get unfortunately an
Error.
Here is the JSP:
<tc:sheet value="#{testForm.myData}"
var="rowData"
columns="*"
rows="3"
selectable="none">
<tc:column label="Spaltenname 1" sortable="false" align="left">
<tc:link label="#{rowData.value}"
actionListener="#{testForm.click}" id="MyID_#{rowData.value}" />
</tc:column>
</tc:sheet>
Is it a bug?
Whats the best solution to recognize which link was clicked?
Adam A. Henne
Antwort: Re: Dynamic ID for in
Posted by Ad...@nordlb-it.de.
Hello Volker,
thanks for the fast answer. This seems to be a nice way to solve my
problem.
Thanks a lot one more time :)
kind regards
Adam A. Henne
"Volker Weber" <we...@googlemail.com> schrieb am 24.10.2006
17:25:31:
> Hi Adam,
>
> in jsf it is not allowed to use valuebinding in id attribute, so this
> is not a bug.
>
> Add a parameter tag to the link:
>
>
> <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();
>
> Regards
> Volker
>
>
>
>
> 2006/10/24, Adam.Henne@nordlb-it.de <Ad...@nordlb-it.de>:
> >
> > I'm using Tobagos <tc:link> Tag inside of <tc:sheet> and accordingly
in
> > <tc:column>.
> > When i'm trying to set my own ID-String for the ID-attribute of the
> > <tc:link>-Tag using a value from the sheetdata i get unfortunatelyan
Error.
> >
> > Here is the JSP:
> >
> > <tc:sheet value="#{testForm.myData}"
> > var="rowData"
> > columns="*"
> > rows="3"
> > selectable="none">
> > <tc:column label="Spaltenname 1" sortable="false" align="left">
> > <tc:link label="#{rowData.value}"
> > actionListener="#{testForm.click}" id="MyID_#{rowData.value}" />
> > </tc:column>
> > </tc:sheet>
> >
> >
> > Is it a bug?
> >
> > Whats the best solution to recognize which link was clicked?
> >
> >
> >
> > Adam A. Henne
> >
Re: Dynamic ID for in
Posted by Volker Weber <we...@googlemail.com>.
Hi Adam,
in jsf it is not allowed to use valuebinding in id attribute, so this
is not a bug.
Add a parameter tag to the link:
<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();
Regards
Volker
2006/10/24, Adam.Henne@nordlb-it.de <Ad...@nordlb-it.de>:
>
> I'm using Tobagos <tc:link> Tag inside of <tc:sheet> and accordingly in
> <tc:column>.
> When i'm trying to set my own ID-String for the ID-attribute of the
> <tc:link>-Tag using a value from the sheetdata i get unfortunately an Error.
>
> Here is the JSP:
>
> <tc:sheet value="#{testForm.myData}"
> var="rowData"
> columns="*"
> rows="3"
> selectable="none">
> <tc:column label="Spaltenname 1" sortable="false" align="left">
> <tc:link label="#{rowData.value}"
> actionListener="#{testForm.click}" id="MyID_#{rowData.value}" />
> </tc:column>
> </tc:sheet>
>
>
> Is it a bug?
>
> Whats the best solution to recognize which link was clicked?
>
>
>
> Adam A. Henne
>