error using Date in WebGrid

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

error using Date in WebGrid

Leon Smith
Completing the tutorial I have converted my viewMain to use a WebGrid. When I add a Date field to it, it blows up trying to autoconvert the Date (WebFormElement>>autoConvertToString:) and calling a method called #shorterPrintSloString which is only implemented in a Class called SpDate in the Sport-Times package.

I can fix this by changing the aspect to a method that returns a String instead of Date, but I thought you might want to know about this potential bug.

My viewMain before I change the aspect:

viewMain
        | e entryList |
        e := WebElement new.
        e addTextH1: 'Uwali Contest Site'.
        entryList := WebGrid new.
        entryList columnNames: #('' 'Title' 'Category' 'Start ' 'Description' );
                 setNumbering;
                 columnFilters: #(nil true true true nil );
                 sortOn: 2;
                 collection: self observee contests;
                 columnAspects: #(nil #title #categoryTitle #startDate #shortDescription );
               
                column: 2
                addBlock: [:each | WebElement new addLinkTo: each text: each title].
        e add: entryList.
        e addBreak.
        e
                addLinkTo: self
                text: 'Add a new Contest'
                view: #add.
        self pageFrameWith: e title: 'Contest Site'


Thanks
Leon
Reply | Threaded
Open this post in threaded view
|

Re: error using Date in WebGrid

Rob Rothwell
I have had the same experience myself but didn't do anything to fix it yet then change the aspect to a string like you did.

Rob

On Wed, Mar 19, 2008 at 12:49 PM, Leon Smith <[hidden email]> wrote:

Completing the tutorial I have converted my viewMain to use a WebGrid. When I
add a Date field to it, it blows up trying to autoconvert the Date
(WebFormElement>>autoConvertToString:) and calling a method called
#shorterPrintSloString which is only implemented in a Class called SpDate in
the Sport-Times package.

I can fix this by changing the aspect to a method that returns a String
instead of Date, but I thought you might want to know about this potential
bug.

My viewMain before I change the aspect:

viewMain
       | e entryList |
       e := WebElement new.
       e addTextH1: 'Uwali Contest Site'.
       entryList := WebGrid new.
       entryList columnNames: #('' 'Title' 'Category' 'Start ' 'Description' );
                setNumbering;
                columnFilters: #(nil true true true nil );
                sortOn: 2;
                collection: self observee contests;
                columnAspects: #(nil #title #categoryTitle #startDate #shortDescription
);

               column: 2
               addBlock: [:each | WebElement new addLinkTo: each text: each title].
       e add: entryList.
       e addBreak.
       e
               addLinkTo: self
               text: 'Add a new Contest'
               view: #add.
       self pageFrameWith: e title: 'Contest Site'


Thanks
Leon
--
View this message in context: http://www.nabble.com/error-using-Date-in-WebGrid-tp16146648p16146648.html
Sent from the AIDA/Web mailing list archive at Nabble.com.

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida


_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: error using Date in WebGrid

Janko Mivšek
In reply to this post by Leon Smith
Hi Leon,

Sorry for so late answer, but you are probably following events to know
why :)

About Date (and also Number) auto conversions, those are still Slovenian
locale specific and need to be extended. This is also very hard to do in
portable way, because every Smalltalk has its own locale support. But
for now you can simply extend those two autoConvert methods and do your
own conversion. And then you can maybe contribute some more general
solution, I you can find some time. We will appreciate that!

Best regards
JAnko


Leon Smith wrote:

> Completing the tutorial I have converted my viewMain to use a WebGrid. When I
> add a Date field to it, it blows up trying to autoconvert the Date
> (WebFormElement>>autoConvertToString:) and calling a method called
> #shorterPrintSloString which is only implemented in a Class called SpDate in
> the Sport-Times package.
>
> I can fix this by changing the aspect to a method that returns a String
> instead of Date, but I thought you might want to know about this potential
> bug.
>
> My viewMain before I change the aspect:
>
> viewMain
> | e entryList |
> e := WebElement new.
> e addTextH1: 'Uwali Contest Site'.
> entryList := WebGrid new.
> entryList columnNames: #('' 'Title' 'Category' 'Start ' 'Description' );
> setNumbering;
> columnFilters: #(nil true true true nil );
> sortOn: 2;
> collection: self observee contests;
> columnAspects: #(nil #title #categoryTitle #startDate #shortDescription
> );
>
> column: 2
> addBlock: [:each | WebElement new addLinkTo: each text: each title].
> e add: entryList.
> e addBreak.
> e
> addLinkTo: self
> text: 'Add a new Contest'
> view: #add.
> self pageFrameWith: e title: 'Contest Site'
>
>
> Thanks
> Leon

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida