You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Guy Bashan <gu...@gmail.com> on 2008/08/03 15:44:27 UTC
[MyFaces][Core] Command Link in a datatable
Hi,
I am having a weird behavior with commandLink in a datatable:
I want that the command link will be rendered only if a select box of that
row is checked (it is a select box used for editing the row).
This is the code of the command link:
<h:column>
<f:facet name="header">
<h:outputText value="Action"/>
</f:facet>
<h:commandLink value="Save" action="#{videoList.save}"
rendered="#{editableVideo.edit}">
<f:param name="videoId" value="#{editableVideo.video.videoId}" />
</h:commandLink>
</h:column>
When I am pressing the "save" link, the page is posted but no action on the
server is being activated.
When I remove: rendered="#{editableVideo.edit}", "save" method is being
called properly.
Any ideas?
Am I doing something wrong?
Thanks,
Guy.
RE: [MyFaces][Core] Command Link in a datatable
Posted by Guy Bashan <gu...@gmail.com>.
Yes,
Since there are lots of rows in the table, I don't want to show all of them in edit mode. So whenever user press "edit" checkbox the page is refreshed and the row is shown in editable mode (using inputs instead of outputText).
My current workaround is to use: "display:none" instead of "rendered", since if all inputs exists on page (even if most of them hidden) things are working well.
Guy.
-----Original Message-----
From: weber.volker@googlemail.com [mailto:weber.volker@googlemail.com] On Behalf Of Volker Weber
Sent: Monday, August 04, 2008 7:32 PM
To: MyFaces Discussion
Subject: Re: [MyFaces][Core] Command Link in a datatable
Is the checkbox checked when you click the "save" link?
2008/8/3 Guy Bashan <gu...@gmail.com>:
> The value of #{editableVideo.edit} is connected to a "selectBooleanCheckbox". When pressing this checkbox, you can enter row to editable mode.
> The code of the checkbox is:
>
> <h:selectBooleanCheckbox value="#{editableVideo.edit}" onclick="submit();" />
>
> Thanks,
> Guy.
>
> -----Original Message-----
> From: weber.volker@googlemail.com [mailto:weber.volker@googlemail.com] On Behalf Of Volker Weber
> Sent: Sunday, August 03, 2008 6:34 PM
> To: MyFaces Discussion
> Subject: Re: [MyFaces][Core] Command Link in a datatable
>
> Hi Guy,
>
> 2008/8/3 Guy Bashan <gu...@gmail.com>:
>> Hi,
>>
>> I am having a weird behavior with commandLink in a datatable:
>>
>> I want that the command link will be rendered only if a select box of that
>> row is checked (it is a select box used for editing the row).
>>
>> This is the code of the command link:
>>
>> <h:column>
>>
>> <f:facet name="header">
>>
>> <h:outputText value="Action"/>
>>
>> </f:facet>
>>
>> <h:commandLink value="Save" action="#{videoList.save}"
>> rendered="#{editableVideo.edit}">
>>
>> <f:param name="videoId" value="#{editableVideo.video.videoId}" />
>>
>> </h:commandLink>
>>
>> </h:column>
>>
>>
>>
>> When I am pressing the "save" link, the page is posted but no action on the
>> server is being activated.
>>
>> When I remove: rendered="#{editableVideo.edit}", "save" method is being
>> called properly.
>>
>>
>>
>> Any ideas?
>>
>> Am I doing something wrong?
>
> What is the value of #{editableVideo.edit} when you press the link?
> Your problem looks like the value of
> #{editableVideo.edit} changes between rendering and next request (the
> save click) from true to false.
> Maybe because you uncheck the selectbox before clicking the link?
> A action is not executed if the rendered evaluates to false at request
> processing time.
>
>>
>>
>>
>> Thanks,
>>
>> Guy.
>
> Regards,
>
> Volker Weber
>
> --
> inexso - information exchange solutions GmbH
> Bismarckstraße 13 | 26122 Oldenburg
> Tel.: +49 441 4082 356 |
> FAX: +49 441 4082 355 | www.inexso.de
>
>
--
inexso - information exchange solutions GmbH
Bismarckstraße 13 | 26122 Oldenburg
Tel.: +49 441 4082 356 |
FAX: +49 441 4082 355 | www.inexso.de
Re: [MyFaces][Core] Command Link in a datatable
Posted by Guy Bashan <gu...@gmail.com>.
Yes
Sent from my iPhone
On 04/08/2008, at 19:32, "Volker Weber" <v....@inexso.de> wrote:
> Is the checkbox checked when you click the "save" link?
>
> 2008/8/3 Guy Bashan <gu...@gmail.com>:
>> The value of #{editableVideo.edit} is connected to a
>> "selectBooleanCheckbox". When pressing this checkbox, you can enter
>> row to editable mode.
>> The code of the checkbox is:
>>
>> <h:selectBooleanCheckbox value="#{editableVideo.edit}"
>> onclick="submit();" />
>>
>> Thanks,
>> Guy.
>>
>> -----Original Message-----
>> From: weber.volker@googlemail.com
>> [mailto:weber.volker@googlemail.com] On Behalf Of Volker Weber
>> Sent: Sunday, August 03, 2008 6:34 PM
>> To: MyFaces Discussion
>> Subject: Re: [MyFaces][Core] Command Link in a datatable
>>
>> Hi Guy,
>>
>> 2008/8/3 Guy Bashan <gu...@gmail.com>:
>>> Hi,
>>>
>>> I am having a weird behavior with commandLink in a datatable:
>>>
>>> I want that the command link will be rendered only if a select box
>>> of that
>>> row is checked (it is a select box used for editing the row).
>>>
>>> This is the code of the command link:
>>>
>>> <h:column>
>>>
>>> <f:facet name="header">
>>>
>>> <h:outputText value="Action"/>
>>>
>>> </f:facet>
>>>
>>> <h:commandLink value="Save" action="#{videoList.save}"
>>> rendered="#{editableVideo.edit}">
>>>
>>> <f:param name="videoId" value="#
>>> {editableVideo.video.videoId}" />
>>>
>>> </h:commandLink>
>>>
>>> </h:column>
>>>
>>>
>>>
>>> When I am pressing the "save" link, the page is posted but no
>>> action on the
>>> server is being activated.
>>>
>>> When I remove: rendered="#{editableVideo.edit}", "save" method is
>>> being
>>> called properly.
>>>
>>>
>>>
>>> Any ideas?
>>>
>>> Am I doing something wrong?
>>
>> What is the value of #{editableVideo.edit} when you press the link?
>> Your problem looks like the value of
>> #{editableVideo.edit} changes between rendering and next request (the
>> save click) from true to false.
>> Maybe because you uncheck the selectbox before clicking the link?
>> A action is not executed if the rendered evaluates to false at
>> request
>> processing time.
>>
>>>
>>>
>>>
>>> Thanks,
>>>
>>> Guy.
>>
>> Regards,
>>
>> Volker Weber
>>
>> --
>> inexso - information exchange solutions GmbH
>> Bismarckstraße 13 | 26122 Oldenburg
>> Tel.: +49 441 4082 356 |
>> FAX: +49 441 4082 355 | www.inexso.de
>>
>>
>
>
>
> --
> inexso - information exchange solutions GmbH
> Bismarckstraße 13 | 26122 Oldenburg
> Tel.: +49 441 4082 356 |
> FAX: +49 441 4082 355 | www.inexso.de
Re: [MyFaces][Core] Command Link in a datatable
Posted by Volker Weber <v....@inexso.de>.
Is the checkbox checked when you click the "save" link?
2008/8/3 Guy Bashan <gu...@gmail.com>:
> The value of #{editableVideo.edit} is connected to a "selectBooleanCheckbox". When pressing this checkbox, you can enter row to editable mode.
> The code of the checkbox is:
>
> <h:selectBooleanCheckbox value="#{editableVideo.edit}" onclick="submit();" />
>
> Thanks,
> Guy.
>
> -----Original Message-----
> From: weber.volker@googlemail.com [mailto:weber.volker@googlemail.com] On Behalf Of Volker Weber
> Sent: Sunday, August 03, 2008 6:34 PM
> To: MyFaces Discussion
> Subject: Re: [MyFaces][Core] Command Link in a datatable
>
> Hi Guy,
>
> 2008/8/3 Guy Bashan <gu...@gmail.com>:
>> Hi,
>>
>> I am having a weird behavior with commandLink in a datatable:
>>
>> I want that the command link will be rendered only if a select box of that
>> row is checked (it is a select box used for editing the row).
>>
>> This is the code of the command link:
>>
>> <h:column>
>>
>> <f:facet name="header">
>>
>> <h:outputText value="Action"/>
>>
>> </f:facet>
>>
>> <h:commandLink value="Save" action="#{videoList.save}"
>> rendered="#{editableVideo.edit}">
>>
>> <f:param name="videoId" value="#{editableVideo.video.videoId}" />
>>
>> </h:commandLink>
>>
>> </h:column>
>>
>>
>>
>> When I am pressing the "save" link, the page is posted but no action on the
>> server is being activated.
>>
>> When I remove: rendered="#{editableVideo.edit}", "save" method is being
>> called properly.
>>
>>
>>
>> Any ideas?
>>
>> Am I doing something wrong?
>
> What is the value of #{editableVideo.edit} when you press the link?
> Your problem looks like the value of
> #{editableVideo.edit} changes between rendering and next request (the
> save click) from true to false.
> Maybe because you uncheck the selectbox before clicking the link?
> A action is not executed if the rendered evaluates to false at request
> processing time.
>
>>
>>
>>
>> Thanks,
>>
>> Guy.
>
> Regards,
>
> Volker Weber
>
> --
> inexso - information exchange solutions GmbH
> Bismarckstraße 13 | 26122 Oldenburg
> Tel.: +49 441 4082 356 |
> FAX: +49 441 4082 355 | www.inexso.de
>
>
--
inexso - information exchange solutions GmbH
Bismarckstraße 13 | 26122 Oldenburg
Tel.: +49 441 4082 356 |
FAX: +49 441 4082 355 | www.inexso.de
RE: [MyFaces][Core] Command Link in a datatable
Posted by Guy Bashan <gu...@gmail.com>.
The value of #{editableVideo.edit} is connected to a "selectBooleanCheckbox". When pressing this checkbox, you can enter row to editable mode.
The code of the checkbox is:
<h:selectBooleanCheckbox value="#{editableVideo.edit}" onclick="submit();" />
Thanks,
Guy.
-----Original Message-----
From: weber.volker@googlemail.com [mailto:weber.volker@googlemail.com] On Behalf Of Volker Weber
Sent: Sunday, August 03, 2008 6:34 PM
To: MyFaces Discussion
Subject: Re: [MyFaces][Core] Command Link in a datatable
Hi Guy,
2008/8/3 Guy Bashan <gu...@gmail.com>:
> Hi,
>
> I am having a weird behavior with commandLink in a datatable:
>
> I want that the command link will be rendered only if a select box of that
> row is checked (it is a select box used for editing the row).
>
> This is the code of the command link:
>
> <h:column>
>
> <f:facet name="header">
>
> <h:outputText value="Action"/>
>
> </f:facet>
>
> <h:commandLink value="Save" action="#{videoList.save}"
> rendered="#{editableVideo.edit}">
>
> <f:param name="videoId" value="#{editableVideo.video.videoId}" />
>
> </h:commandLink>
>
> </h:column>
>
>
>
> When I am pressing the "save" link, the page is posted but no action on the
> server is being activated.
>
> When I remove: rendered="#{editableVideo.edit}", "save" method is being
> called properly.
>
>
>
> Any ideas?
>
> Am I doing something wrong?
What is the value of #{editableVideo.edit} when you press the link?
Your problem looks like the value of
#{editableVideo.edit} changes between rendering and next request (the
save click) from true to false.
Maybe because you uncheck the selectbox before clicking the link?
A action is not executed if the rendered evaluates to false at request
processing time.
>
>
>
> Thanks,
>
> Guy.
Regards,
Volker Weber
--
inexso - information exchange solutions GmbH
Bismarckstraße 13 | 26122 Oldenburg
Tel.: +49 441 4082 356 |
FAX: +49 441 4082 355 | www.inexso.de
Re: [MyFaces][Core] Command Link in a datatable
Posted by Volker Weber <v....@inexso.de>.
Hi Guy,
2008/8/3 Guy Bashan <gu...@gmail.com>:
> Hi,
>
> I am having a weird behavior with commandLink in a datatable:
>
> I want that the command link will be rendered only if a select box of that
> row is checked (it is a select box used for editing the row).
>
> This is the code of the command link:
>
> <h:column>
>
> <f:facet name="header">
>
> <h:outputText value="Action"/>
>
> </f:facet>
>
> <h:commandLink value="Save" action="#{videoList.save}"
> rendered="#{editableVideo.edit}">
>
> <f:param name="videoId" value="#{editableVideo.video.videoId}" />
>
> </h:commandLink>
>
> </h:column>
>
>
>
> When I am pressing the "save" link, the page is posted but no action on the
> server is being activated.
>
> When I remove: rendered="#{editableVideo.edit}", "save" method is being
> called properly.
>
>
>
> Any ideas?
>
> Am I doing something wrong?
What is the value of #{editableVideo.edit} when you press the link?
Your problem looks like the value of
#{editableVideo.edit} changes between rendering and next request (the
save click) from true to false.
Maybe because you uncheck the selectbox before clicking the link?
A action is not executed if the rendered evaluates to false at request
processing time.
>
>
>
> Thanks,
>
> Guy.
Regards,
Volker Weber
--
inexso - information exchange solutions GmbH
Bismarckstraße 13 | 26122 Oldenburg
Tel.: +49 441 4082 356 |
FAX: +49 441 4082 355 | www.inexso.de