Re: Problem with checkbox of MACheckboxColumn

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Problem with checkbox of MACheckboxColumn

Mariano Martinez Peck



On Tue, Oct 1, 2013 at 2:22 PM, Mariano Martinez Peck <[hidden email]> wrote:
Hi guys, 

I am using Seaside 3.0 and Magritte 3. 

I have a MAReport in which I add as the first column a MACheckboxColumn. I want to use this table to filter/select/unselect the rows of the report. If I use a MACheckboxColumn as is (#useLinks answering true), it works, but if I do (set #useLinks to false):

report addColumn: (MACheckboxColumn new useLinks: false; yourself).

it does not work anymore..the callback of the checkbox is not called anymore:

MASelectionColumn >> renderCellFormContent: anObject on: html

html checkbox
value: (self isSelected: anObject);
callback: [ :value | self halt. self selectRow: anObject value: value ]
 
Of course the difference is that with no links it uses #renderCellFormContent:on: while with useLinks in true it uses #renderCellLinkContent:on:. I thought it was related to the fact that links do not need a form but checkbox do. I tried adding a form around the checkbox, but no luck.

Any ideas?

Thanks


--
Mariano
http://marianopeck.wordpress.com



--
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: [Seaside] Problem with checkbox of MACheckboxColumn

John McKeon
Hi Mariano
Could it be the the form has to be submitted when the check box is clicked for the callback to get invoked?
John

On Wednesday, October 2, 2013, Mariano Martinez Peck wrote:



On Tue, Oct 1, 2013 at 2:22 PM, Mariano Martinez Peck <<a href="javascript:_e({}, &#39;cvml&#39;, &#39;marianopeck@gmail.com&#39;);" target="_blank">marianopeck@...> wrote:
Hi guys, 

I am using Seaside 3.0 and Magritte 3. 

I have a MAReport in which I add as the first column a MACheckboxColumn. I want to use this table to filter/select/unselect the rows of the report. If I use a MACheckboxColumn as is (#useLinks answering true), it works, but if I do (set #useLinks to false):

report addColumn: (MACheckboxColumn new useLinks: false; yourself).

it does not work anymore..the callback of the checkbox is not called anymore:

MASelectionColumn >> renderCellFormContent: anObject on: html

html checkbox
value: (self isSelected: anObject);
callback: [ :value | self halt. self selectRow: anObject value: value ]
 
Of course the difference is that with no links it uses #renderCellFormContent:on: while with useLinks in true it uses #renderCellLinkContent:on:. I thought it was related to the fact that links do not need a form but checkbox do. I tried adding a form around the checkbox, but no luck.

Any ideas?

Thanks


--
Mariano
http://marianopeck.wordpress.com



--
Mariano
http://marianopeck.wordpress.com


--
jmck.seasidehosting.st

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: [Seaside] Problem with checkbox of MACheckboxColumn

Mariano Martinez Peck



On Wed, Oct 2, 2013 at 1:30 PM, John McKeon <[hidden email]> wrote:
Hi Mariano
Could it be the the form has to be submitted when the check box is clicked for the callback to get invoked?

Hi John, thanks for your answer. 
But which one should be the form? Because this is a report, so there is no "submit" button. 

 
John


On Wednesday, October 2, 2013, Mariano Martinez Peck wrote:



On Tue, Oct 1, 2013 at 2:22 PM, Mariano Martinez Peck <[hidden email]> wrote:
Hi guys, 

I am using Seaside 3.0 and Magritte 3. 

I have a MAReport in which I add as the first column a MACheckboxColumn. I want to use this table to filter/select/unselect the rows of the report. If I use a MACheckboxColumn as is (#useLinks answering true), it works, but if I do (set #useLinks to false):

report addColumn: (MACheckboxColumn new useLinks: false; yourself).

it does not work anymore..the callback of the checkbox is not called anymore:

MASelectionColumn >> renderCellFormContent: anObject on: html

html checkbox
value: (self isSelected: anObject);
callback: [ :value | self halt. self selectRow: anObject value: value ]
 
Of course the difference is that with no links it uses #renderCellFormContent:on: while with useLinks in true it uses #renderCellLinkContent:on:. I thought it was related to the fact that links do not need a form but checkbox do. I tried adding a form around the checkbox, but no luck.

Any ideas?

Thanks


--
Mariano
http://marianopeck.wordpress.com



--
Mariano
http://marianopeck.wordpress.com


--
jmck.seasidehosting.st

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki



--
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: [Seaside] Problem with checkbox of MACheckboxColumn

Mariano Martinez Peck
Hi John, it seems you were right at the end.... I was not submitting the form. But this is not all.

The original method was:

MACheckboxColumn >> renderCellFormContent: anObject on: html
html checkbox
value: (self isSelected: anObject);
callback: [ :value | self selectRow: anObject value: value ]

The only way I found to make it work is like this (notice the form, the label and the submitOnClick)

renderCellFormContent: anObject on: html

html form: [
html label: [
html checkbox
submitOnClick;
value: (self isSelected: anObject);
callback: [ :value | self selectRow: anObject value: value ]]]

but #submitOnClick is deprecated. So I don't know how this is supposed to be fixed without such a deprecation:

WAFormInputTag >> submitOnClick
self 
greaseDeprecatedApi: 'WAFormInputTag>>#submitOnClick'
details: 'Use a dedicated Javascript library.'.
self onClick: 'submit()'


I have my own subclass of MACheckedColumn so I override this method. But I wanted to fix it and commit for others. 


On Wed, Oct 2, 2013 at 2:00 PM, Mariano Martinez Peck <[hidden email]> wrote:



On Wed, Oct 2, 2013 at 1:30 PM, John McKeon <[hidden email]> wrote:
Hi Mariano
Could it be the the form has to be submitted when the check box is clicked for the callback to get invoked?

Hi John, thanks for your answer. 
But which one should be the form? Because this is a report, so there is no "submit" button. 

 
John


On Wednesday, October 2, 2013, Mariano Martinez Peck wrote:



On Tue, Oct 1, 2013 at 2:22 PM, Mariano Martinez Peck <[hidden email]> wrote:
Hi guys, 

I am using Seaside 3.0 and Magritte 3. 

I have a MAReport in which I add as the first column a MACheckboxColumn. I want to use this table to filter/select/unselect the rows of the report. If I use a MACheckboxColumn as is (#useLinks answering true), it works, but if I do (set #useLinks to false):

report addColumn: (MACheckboxColumn new useLinks: false; yourself).

it does not work anymore..the callback of the checkbox is not called anymore:

MASelectionColumn >> renderCellFormContent: anObject on: html

html checkbox
value: (self isSelected: anObject);
callback: [ :value | self halt. self selectRow: anObject value: value ]
 
Of course the difference is that with no links it uses #renderCellFormContent:on: while with useLinks in true it uses #renderCellLinkContent:on:. I thought it was related to the fact that links do not need a form but checkbox do. I tried adding a form around the checkbox, but no luck.

Any ideas?

Thanks


--
Mariano
http://marianopeck.wordpress.com



--
Mariano
http://marianopeck.wordpress.com


--
jmck.seasidehosting.st

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki



--
Mariano
http://marianopeck.wordpress.com



--
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki