error using Date in WebGrid

View: New views
3 Messages — Rating Filter:   Alert me  

error using Date in WebGrid

by Leon Smith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Re: error using Date in WebGrid

by Rob Rothwell-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <lsmith@...> 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
Aida@...
http://lists.aidaweb.si/mailman/listinfo/aida


_______________________________________________
Aida mailing list
Aida@...
http://lists.aidaweb.si/mailman/listinfo/aida

Re: error using Date in WebGrid

by Janko Mivsek :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
Aida@...
http://lists.aidaweb.si/mailman/listinfo/aida