Fwd: [Seaside] WATableReport + Checkbox

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

Fwd: [Seaside] WATableReport + Checkbox

Alexandre BP
Hi,

I have a problem with checkboxes. I'm trying to add a checkbox at each line of a table.
I have tried several things(the last tries are in comments): 

addActionColumn
columns
add:
((WAReportColumn new)
title: '';
valueBlock: [ :row :html | 
html span
with:[
  "checked ifTrue:[BibliList bibliCollection add: row]."
html checkbox
value: checked;
onTrue:[BibliList bibliCollection add: row]
onFalse:[].
"onClick: [checked := true]"
                                                                                "callback:[:value | value ifTrue: [BibliList bibliCollection add: row]]"
                                                                                      ]]).

Unfortunately, nothing seems to work...when I click on the checkbox, nothing happen and my list bibliCollection (which is an OrderedCollection) is still empty.
Thx for your help
alex


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: WATableReport Checkbox

Robert Sirois
How are you submitting the data?

Either they need to be in a form, or if you're serializing via ajax, remember to use #serializeWithHidden I think it's called.

RS


From: [hidden email]
Date: Fri, 3 Dec 2010 17:02:02 +0100
Subject: Fwd: [Seaside] WATableReport + Checkbox
To: [hidden email]

Hi,

I have a problem with checkboxes. I'm trying to add a checkbox at each line of a table.
I have tried several things(the last tries are in comments): 

addActionColumn
columns
add:
((WAReportColumn new)
title: '';
valueBlock: [ :row :html | 
html span
with:[
  "checked ifTrue:[BibliList bibliCollection add: row]."
html checkbox
value: checked;
onTrue:[BibliList bibliCollection add: row]
onFalse:[].
"onClick: [checked := true]"
                                                                                "callback:[:value | value ifTrue: [BibliList bibliCollection add: row]]"
                                                                                      ]]).

Unfortunately, nothing seems to work...when I click on the checkbox, nothing happen and my list bibliCollection (which is an OrderedCollection) is still empty.
Thx for your help
alex


_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: WATableReport + Checkbox

Lukas Renggli
In reply to this post by Alexandre BP
Do you have a #form: around your table?

Lukas

On 3 December 2010 13:02, alexandre bp <[hidden email]> wrote:

> Hi,
> I have a problem with checkboxes. I'm trying to add a checkbox at each line
> of a table.
> I have tried several things(the last tries are in comments):
> addActionColumn
> columns
> add:
> ((WAReportColumn new)
> title: '';
> valueBlock: [ :row :html |
> html span
> with:[
>
>   "checked ifTrue:[BibliList bibliCollection add: row]."
>
> html checkbox
> value: checked;
> onTrue:[BibliList bibliCollection add: row]
> onFalse:[].
> "onClick: [checked := true]"
>
>    "callback:[:value | value ifTrue: [BibliList bibliCollection add: row]]"
>
>          ]]).
> Unfortunately, nothing seems to work...when I click on the checkbox, nothing
> happen and my list bibliCollection (which is an OrderedCollection) is still
> empty.
> Thx for your help
> alex
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>



--
Lukas Renggli
www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: WATableReport + Checkbox

Alexandre BP
Thx for your answer
yes I do have a #form around it.  

2010/12/3 Lukas Renggli <[hidden email]>
Do you have a #form: around your table?

Lukas

On 3 December 2010 13:02, alexandre bp <[hidden email]> wrote:
> Hi,
> I have a problem with checkboxes. I'm trying to add a checkbox at each line
> of a table.
> I have tried several things(the last tries are in comments):
> addActionColumn
> columns
> add:
> ((WAReportColumn new)
> title: '';
> valueBlock: [ :row :html |
> html span
> with:[
>
>   "checked ifTrue:[BibliList bibliCollection add: row]."
>
> html checkbox
> value: checked;
> onTrue:[BibliList bibliCollection add: row]
> onFalse:[].
> "onClick: [checked := true]"
>
>    "callback:[:value | value ifTrue: [BibliList bibliCollection add: row]]"
>
>          ]]).
> Unfortunately, nothing seems to work...when I click on the checkbox, nothing
> happen and my list bibliCollection (which is an OrderedCollection) is still
> empty.
> Thx for your help
> alex
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>



--
Lukas Renggli
www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: WATableReport Checkbox

Alexandre BP
In reply to this post by Robert Sirois
I have a submitButton also in the form with an empty callback.
I just want the button to trigger all the callbacks of the checkboxes.
However it doesn't seem to work at all.

Alex

2010/12/3 Robert Sirois <[hidden email]>
How are you submitting the data?

Either they need to be in a form, or if you're serializing via ajax, remember to use #serializeWithHidden I think it's called.

RS


From: [hidden email]
Date: Fri, 3 Dec 2010 17:02:02 +0100
Subject: Fwd: [Seaside] WATableReport + Checkbox
To: [hidden email]

Hi,

I have a problem with checkboxes. I'm trying to add a checkbox at each line of a table.
I have tried several things(the last tries are in comments): 

addActionColumn
columns
add:
((WAReportColumn new)
title: '';
valueBlock: [ :row :html | 
html span
with:[
  "checked ifTrue:[BibliList bibliCollection add: row]."
html checkbox
value: checked;
onTrue:[BibliList bibliCollection add: row]
onFalse:[].
"onClick: [checked := true]"
                                                                                "callback:[:value | value ifTrue: [BibliList bibliCollection add: row]]"
                                                                                      ]]).

Unfortunately, nothing seems to work...when I click on the checkbox, nothing happen and my list bibliCollection (which is an OrderedCollection) is still empty.
Thx for your help
alex


_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: WATableReport Checkbox

Robert Sirois
Check out what row is in the callback by exploring or using the Transcript.

You might be losing pointers to the objects somewhere in there.

RS


From: [hidden email]
Date: Fri, 3 Dec 2010 18:30:27 +0100
Subject: Re: [Seaside] WATableReport Checkbox
To: [hidden email]

I have a submitButton also in the form with an empty callback.
I just want the button to trigger all the callbacks of the checkboxes.
However it doesn't seem to work at all.

Alex

2010/12/3 Robert Sirois <watchlala@...>
How are you submitting the data?

Either they need to be in a form, or if you're serializing via ajax, remember to use #serializeWithHidden I think it's called.

RS


From: abalonpe@...
Date: Fri, 3 Dec 2010 17:02:02 +0100
Subject: Fwd: [Seaside] WATableReport + Checkbox
To: seaside@...

Hi,

I have a problem with checkboxes. I'm trying to add a checkbox at each line of a table.
I have tried several things(the last tries are in comments): 

addActionColumn
columns
add:
((WAReportColumn new)
title: '';
valueBlock: [ :row :html | 
html span
with:[
  "checked ifTrue:[BibliList bibliCollection add: row]."
html checkbox
value: checked;
onTrue:[BibliList bibliCollection add: row]
onFalse:[].
"onClick: [checked := true]"
                                                                                "callback:[:value | value ifTrue: [BibliList bibliCollection add: row]]"
                                                                                      ]]).

Unfortunately, nothing seems to work...when I click on the checkbox, nothing happen and my list bibliCollection (which is an OrderedCollection) is still empty.
Thx for your help
alex


_______________________________________________ seaside mailing list seaside@... http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: WATableReport Checkbox

Alexandre BP
I got the right row when displaying the checkbox but when I click on the checkbox nothing appears in the transcript.
The submitButton fails when I add the following line --> bibliTableListExport drawOn: canvas.

bibliTableList is a list of different tables (Articles, Books, Conferences,...)
Here is what does drawOn:canvas:

drawOn: canvas
biblis size = 0
ifFalse: [ 
self renderBibteXOn: canvas.
bibType = 'All'
ifTrue: [ 
self
do: [ :eachTable | 
eachTable
removeActionColumn;
    rows: (biblis select: [ :eachBibli | (eachBibli dico at: 'BibteX Type') data = eachTable       bibType ]);
addActionColumn;
drawOn: canvas ] ]
ifFalse: [ 
(self select: [ :eachTable | eachTable bibType = bibType ])
do: [ :eachSelectedTable | 
eachSelectedTable
removeActionColumn;
    rows: (biblis select: [ :eachBibli | (eachBibli dico at: 'BibteX Type') data =    eachSelectedTable bibType ]);
addActionColumn;
drawOn: canvas ] ] ].

For eachTable the method calls another drawOn:canvas which draw the table depending on its type (Article, Book,...)

drawOn: canvas
rows size = 0
ifFalse: [ 
(canvas div)
class: 'inTitle';
with: [ 
(canvas heading)
level: 3;
with: self bibType ].
(canvas div)
class: 'bibliTable';
with: [ canvas render: super ].
(canvas div)
class: 'controlLink';
with: [ 
self renderOptionalAnchorOn: canvas.
self renderUserAnchorOn: canvas ]] 

I hope this can clarify the sequence of action.
Thx very much for your help.
alex

2010/12/3 Robert Sirois <[hidden email]>
Check out what row is in the callback by exploring or using the Transcript.

You might be losing pointers to the objects somewhere in there.Date: Fri, 3 Dec 2010 18:30:27 +0100
Subject: Re: [Seaside] WATableReport Checkbox

To: [hidden email]

I have a submitButton also in the form with an empty callback.
I just want the button to trigger all the callbacks of the checkboxes.
However it doesn't seem to work at all.

Alex

2010/12/3 Robert Sirois <[hidden email]>
How are you submitting the data?

Either they need to be in a form, or if you're serializing via ajax, remember to use #serializeWithHidden I think it's called.

RS


From: [hidden email]
Date: Fri, 3 Dec 2010 17:02:02 +0100
Subject: Fwd: [Seaside] WATableReport + Checkbox
To: [hidden email]

Hi,

I have a problem with checkboxes. I'm trying to add a checkbox at each line of a table.
I have tried several things(the last tries are in comments): 

addActionColumn
columns
add:
((WAReportColumn new)
title: '';
valueBlock: [ :row :html | 
html span
with:[
  "checked ifTrue:[BibliList bibliCollection add: row]."
html checkbox
value: checked;
onTrue:[BibliList bibliCollection add: row]
onFalse:[].
"onClick: [checked := true]"
                                                                                "callback:[:value | value ifTrue: [BibliList bibliCollection add: row]]"
                                                                                      ]]).

Unfortunately, nothing seems to work...when I click on the checkbox, nothing happen and my list bibliCollection (which is an OrderedCollection) is still empty.
Thx for your help
alex


_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: WATableReport Checkbox

Robert Sirois
Mm, this is a lot to look at on my cell phone ;)

Here's my suggestion for now:

Simplify what you're doing by making a little test app or something. Say, ok, I want to display different items, but I want an action associated with them, and I want them in a table as rows.

Write all the rendering methods separate from your data model, so when you're rendering a list of items, you simply call a render method on it, ie:

#renderItem: anItem on: html

So, you would end up with:

items do: [:ea | self renderItem: ea on: html ].

Yay, so now my items are displayed. My renderItem method has a little checkbox that serializes the object that the row represents to, say, #selectedItems, so now I can do whatever with those.

Hopefully that's not too oversimplified and helps hehe.

RS


From: [hidden email]
Date: Fri, 3 Dec 2010 19:14:39 +0100
Subject: Re: [Seaside] WATableReport Checkbox
To: [hidden email]

I got the right row when displaying the checkbox but when I click on the checkbox nothing appears in the transcript.
The submitButton fails when I add the following line --> bibliTableListExport drawOn: canvas.

bibliTableList is a list of different tables (Articles, Books, Conferences,...)
Here is what does drawOn:canvas:

drawOn: canvas
biblis size = 0
ifFalse: [ 
self renderBibteXOn: canvas.
bibType = 'All'
ifTrue: [ 
self
do: [ :eachTable | 
eachTable
removeActionColumn;
    rows: (biblis select: [ :eachBibli | (eachBibli dico at: 'BibteX Type') data = eachTable       bibType ]);
addActionColumn;
drawOn: canvas ] ]
ifFalse: [ 
(self select: [ :eachTable | eachTable bibType = bibType ])
do: [ :eachSelectedTable | 
eachSelectedTable
removeActionColumn;
    rows: (biblis select: [ :eachBibli | (eachBibli dico at: 'BibteX Type') data =    eachSelectedTable bibType ]);
addActionColumn;
drawOn: canvas ] ] ].

For eachTable the method calls another drawOn:canvas which draw the table depending on its type (Article, Book,...)

drawOn: canvas
rows size = 0
ifFalse: [ 
(canvas div)
class: 'inTitle';
with: [ 
(canvas heading)
level: 3;
with: self bibType ].
(canvas div)
class: 'bibliTable';
with: [ canvas render: super ].
(canvas div)
class: 'controlLink';
with: [ 
self renderOptionalAnchorOn: canvas.
self renderUserAnchorOn: canvas ]] 

I hope this can clarify the sequence of action.
Thx very much for your help.
alex

2010/12/3 Robert Sirois <watchlala@...>
Check out what row is in the callback by exploring or using the Transcript.

You might be losing pointers to the objects somewhere in there.


RS


From: abalonpe@...
Date: Fri, 3 Dec 2010 18:30:27 +0100
Subject: Re: [Seaside] WATableReport Checkbox

To: seaside@...

I have a submitButton also in the form with an empty callback.
I just want the button to trigger all the callbacks of the checkboxes.
However it doesn't seem to work at all.

Alex

2010/12/3 Robert Sirois <watchlala@...>
How are you submitting the data?

Either they need to be in a form, or if you're serializing via ajax, remember to use #serializeWithHidden I think it's called.

RS


From: abalonpe@...
Date: Fri, 3 Dec 2010 17:02:02 +0100
Subject: Fwd: [Seaside] WATableReport + Checkbox
To: seaside@...

Hi,

I have a problem with checkboxes. I'm trying to add a checkbox at each line of a table.
I have tried several things(the last tries are in comments): 

addActionColumn
columns
add:
((WAReportColumn new)
title: '';
valueBlock: [ :row :html | 
html span
with:[
  "checked ifTrue:[BibliList bibliCollection add: row]."
html checkbox
value: checked;
onTrue:[BibliList bibliCollection add: row]
onFalse:[].
"onClick: [checked := true]"
                                                                                "callback:[:value | value ifTrue: [BibliList bibliCollection add: row]]"
                                                                                      ]]).

Unfortunately, nothing seems to work...when I click on the checkbox, nothing happen and my list bibliCollection (which is an OrderedCollection) is still empty.
Thx for your help
alex


_______________________________________________ seaside mailing list seaside@... http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________ seaside mailing list seaside@... http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: WATableReport Checkbox

Alexandre BP
Hey,

I found the solution, I had to put the form inside of the condition in the drawOn method.
I don't know why it works like that but my problem is solved :-)
I know that the code is not the most readable I will have to clean it up with my team.
I'll ask for advice at that time for sure ;-)
thx a lot anyway.

cheers
alex

2010/12/3 Robert Sirois <[hidden email]>
Mm, this is a lot to look at on my cell phone ;)

Here's my suggestion for now:

Simplify what you're doing by making a little test app or something. Say, ok, I want to display different items, but I want an action associated with them, and I want them in a table as rows.

Write all the rendering methods separate from your data model, so when you're rendering a list of items, you simply call a render method on it, ie:

#renderItem: anItem on: html

So, you would end up with:

items do: [:ea | self renderItem: ea on: html ].

Yay, so now my items are displayed. My renderItem method has a little checkbox that serializes the object that the row represents to, say, #selectedItems, so now I can do whatever with those.

Hopefully that's not too oversimplified and helps hehe.Date: Fri, 3 Dec 2010 19:14:39 +0100

Subject: Re: [Seaside] WATableReport Checkbox
To: [hidden email]

I got the right row when displaying the checkbox but when I click on the checkbox nothing appears in the transcript.
The submitButton fails when I add the following line --> bibliTableListExport drawOn: canvas.

bibliTableList is a list of different tables (Articles, Books, Conferences,...)
Here is what does drawOn:canvas:

drawOn: canvas
biblis size = 0
ifFalse: [ 
self renderBibteXOn: canvas.
bibType = 'All'
ifTrue: [ 
self
do: [ :eachTable | 
eachTable
removeActionColumn;
    rows: (biblis select: [ :eachBibli | (eachBibli dico at: 'BibteX Type') data = eachTable       bibType ]);
addActionColumn;
drawOn: canvas ] ]
ifFalse: [ 
(self select: [ :eachTable | eachTable bibType = bibType ])
do: [ :eachSelectedTable | 
eachSelectedTable
removeActionColumn;
    rows: (biblis select: [ :eachBibli | (eachBibli dico at: 'BibteX Type') data =    eachSelectedTable bibType ]);
addActionColumn;
drawOn: canvas ] ] ].

For eachTable the method calls another drawOn:canvas which draw the table depending on its type (Article, Book,...)

drawOn: canvas
rows size = 0
ifFalse: [ 
(canvas div)
class: 'inTitle';
with: [ 
(canvas heading)
level: 3;
with: self bibType ].
(canvas div)
class: 'bibliTable';
with: [ canvas render: super ].
(canvas div)
class: 'controlLink';
with: [ 
self renderOptionalAnchorOn: canvas.
self renderUserAnchorOn: canvas ]] 

I hope this can clarify the sequence of action.
Thx very much for your help.
alex

2010/12/3 Robert Sirois <[hidden email]>
Check out what row is in the callback by exploring or using the Transcript.

You might be losing pointers to the objects somewhere in there.Date: Fri, 3 Dec 2010 18:30:27 +0100
Subject: Re: [Seaside] WATableReport Checkbox

To: [hidden email]

I have a submitButton also in the form with an empty callback.
I just want the button to trigger all the callbacks of the checkboxes.
However it doesn't seem to work at all.

Alex

2010/12/3 Robert Sirois <[hidden email]>
How are you submitting the data?

Either they need to be in a form, or if you're serializing via ajax, remember to use #serializeWithHidden I think it's called.

RS


From: [hidden email]
Date: Fri, 3 Dec 2010 17:02:02 +0100
Subject: Fwd: [Seaside] WATableReport + Checkbox
To: [hidden email]

Hi,

I have a problem with checkboxes. I'm trying to add a checkbox at each line of a table.
I have tried several things(the last tries are in comments): 

addActionColumn
columns
add:
((WAReportColumn new)
title: '';
valueBlock: [ :row :html | 
html span
with:[
  "checked ifTrue:[BibliList bibliCollection add: row]."
html checkbox
value: checked;
onTrue:[BibliList bibliCollection add: row]
onFalse:[].
"onClick: [checked := true]"
                                                                                "callback:[:value | value ifTrue: [BibliList bibliCollection add: row]]"
                                                                                      ]]).

Unfortunately, nothing seems to work...when I click on the checkbox, nothing happen and my list bibliCollection (which is an OrderedCollection) is still empty.
Thx for your help
alex


_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside