2 newbies questions

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

2 newbies questions

thiago_sl
Hi list.
I am using Iliad  + Pharo, and i have 2  questions:

 1 -  in seaside, i use the 'confirm script' like these:
            html anchor onClick: 'return confirm(''Remove item ', item
name , '?'')';
                                                callback: [self
excluir: item ];
                                                with: 'Remove' ])
        I try in Iliad:
          column: 3 buildContents:[ :e :item |
                        e a text: 'Remove';
                        onClick: 'return confirm(''Remove item ', item
name , '?'')';
                        action: [self excluir: item]]

         But is like the answer is always 'true'. It always execute de
action.

 2 - I have already reported to Nicolas, but i want to Know if someone
else had the same problem. With lighbox + formula, #selectOn: and
#numberInputOn: doesnt work. The buttons save and cancel do nothing,
and i cant properly debug in Pharo. There are a work around, to still
use de lightbox?

Thanks, and sorry my bad english.
Reply | Threaded
Open this post in threaded view
|

Re: 2 newbies questions

Nicolas Petton
Hi,

Le lundi 28 février 2011 à 10:48 -0800, Thiago SL a écrit :

> Hi list.
> I am using Iliad  + Pharo, and i have 2  questions:
>
>  1 -  in seaside, i use the 'confirm script' like these:
>             html anchor onClick: 'return confirm(''Remove item ', item
> name , '?'')';
>                                                 callback: [self
> excluir: item ];
>                                                 with: 'Remove' ])
>         I try in Iliad:
>           column: 3 buildContents:[ :e :item |
>                         e a text: 'Remove';
>                         onClick: 'return confirm(''Remove item ', item
> name , '?'')';
>                         action: [self excluir: item]]
>
>          But is like the answer is always 'true'. It always execute de
> action.

It looks like the JavaScript layer is sending the AJAX request anyway.
So I would consider it as a bug.

A workaround would be to trigger the action within the onclick event
too. With Iliad you can do:

e a
    text: 'Click me!';
    onClickDo: ["smalltalk code here"]

So I propose to add an extension to ILHTMLBuilderElement that should
work for you:

ILHTMLBuilderElement>>onClickConfirm: aString thenDo: aBlock
    self
        onClick: 'if(confirm(''', aString, '')){';
        onClickDo: aBlock;
        onClick: '};'


>
>  2 - I have already reported to Nicolas, but i want to Know if someone
> else had the same problem. With lighbox + formula, #selectOn: and
> #numberInputOn: doesnt work. The buttons save and cancel do nothing,
> and i cant properly debug in Pharo. There are a work around, to still
> use de lightbox?

We are currently fixing porting issues we introduced with the last Pharo
release. The patch I sent you didn't work?

Cheers,
Nicolas

>
> Thanks, and sorry my bad english.


Reply | Threaded
Open this post in threaded view
|

Re: 2 newbies questions

Bernat Romagosa
Hi all,

I've just found out I've the same problem with Pharo + formula + lightbox:/show:, could you share this patch please? :)

Thanks,

Bernat Romagosa.

2011/3/1 Nicolas Petton <[hidden email]>
Hi,

Le lundi 28 février 2011 à 10:48 -0800, Thiago SL a écrit :
> Hi list.
> I am using Iliad  + Pharo, and i have 2  questions:
>
>  1 -  in seaside, i use the 'confirm script' like these:
>             html anchor onClick: 'return confirm(''Remove item ', item
> name , '?'')';
>                                                 callback: [self
> excluir: item ];
>                                                 with: 'Remove' ])
>         I try in Iliad:
>           column: 3 buildContents:[ :e :item |
>                         e a text: 'Remove';
>                         onClick: 'return confirm(''Remove item ', item
> name , '?'')';
>                         action: [self excluir: item]]
>
>          But is like the answer is always 'true'. It always execute de
> action.

It looks like the JavaScript layer is sending the AJAX request anyway.
So I would consider it as a bug.

A workaround would be to trigger the action within the onclick event
too. With Iliad you can do:

e a
   text: 'Click me!';
   onClickDo: ["smalltalk code here"]

So I propose to add an extension to ILHTMLBuilderElement that should
work for you:

ILHTMLBuilderElement>>onClickConfirm: aString thenDo: aBlock
   self
       onClick: 'if(confirm(''', aString, '')){';
       onClickDo: aBlock;
       onClick: '};'


>
>  2 - I have already reported to Nicolas, but i want to Know if someone
> else had the same problem. With lighbox + formula, #selectOn: and
> #numberInputOn: doesnt work. The buttons save and cancel do nothing,
> and i cant properly debug in Pharo. There are a work around, to still
> use de lightbox?

We are currently fixing porting issues we introduced with the last Pharo
release. The patch I sent you didn't work?

Cheers,
Nicolas

>
> Thanks, and sorry my bad english.



Reply | Threaded
Open this post in threaded view
|

Re: 2 newbies questions

thiago_sl
In reply to this post by Nicolas Petton
HI Nicolas, thanks for your answer.

>
> It looks like the JavaScript layer is sending the AJAX request anyway.
> So I would consider it as a bug.
>
> A workaround would be to trigger the action within the onclick event
> too. With Iliad you can do:
>
> e a
>     text: 'Click me!';
>     onClickDo: ["smalltalk code here"]
>
> So I propose to add an extension to ILHTMLBuilderElement that should
> work for you:
>
> ILHTMLBuilderElement>>onClickConfirm: aString thenDo: aBlock
>     self
>         onClick: 'if(confirm(''', aString, '')){';
>         onClickDo: aBlock;
>         onClick: '};'
>
>

It works, with a little change (one more character ' ).
 ILHTMLBuilderElement>>onClickConfirm: aString thenDo: aBlock
     self
         onClick: 'if(confirm(''', aString, ''')){'; "need to put a
quote before ) "
         onClickDo: aBlock;
         onClick: '};'

then  call:
  column: 3 buildContents:[ :e :item |
                        e a text: 'Remove';
                        onClickConfirm: ' Remove item...' thenDo: [self removeItem: item]]


>
> >  2 - I have already reported to Nicolas, but i want to Know if someone
> > else had the same problem. With lighbox + formula, #selectOn: and
> > #numberInputOn: doesnt work. The buttons save and cancel do nothing,
> > and i cant properly debug in Pharo. There are a work around, to still
> > use de lightbox?
>
> We are currently fixing porting issues we introduced with the last Pharo
> release. The patch I sent you didn't work?
>

The pacth works to open the lighbox. But the action buttons in the
lightbox doesnt work.

Bernat, this is the patch that Nicolas sent to me:
 - in class ILSelectField,  change the #multiple body  to:
          ^ multiple ifNil: [ ^ false ].

Cheers,
Thiago Lino
Reply | Threaded
Open this post in threaded view
|

Re: 2 newbies questions

Bernat Romagosa
Thanks Nico and Thiago,

Not sure if related to this, but I found that self inform: aString completely freezes Pharo, by debugging the execution stack I found out it freezes when executing:

TLJsonHandler new handleRequest

Any ideas?

Bernat Romagosa.
Reply | Threaded
Open this post in threaded view
|

Re: 2 newbies questions

Nicolas Petton
Le mardi 01 mars 2011 à 13:25 +0100, AxiNat a écrit :
> Not sure if related to this, but I found that self inform: aString
> completely freezes Pharo, by debugging the execution stack I found out
> it freezes when executing:
>
> TLJsonHandler new handleRequest
>
> Any ideas?
>

Nope, I never experienced it. Can you write an issue on the bug tracker?

Thanks for reporting,
Nico

Reply | Threaded
Open this post in threaded view
|

Re: 2 newbies questions

Bernat Romagosa
I wrote an issue and included an st file which triggers the supposed bug, it'd be of great help if someone else running Iliad 0.9.1 on Pharo 1.1.1 could try this out and confirm whether they experience the same problems. Thanks!

By the way, to overcome this, I created a widget that can be called as follows:

self lightbox: ((TextWidget text: aString) addOkButton)

Which works, quite surprisingly as I think self inform: follows pretty much the same pattern.

Cheers!

Bernat Romagosa.
Reply | Threaded
Open this post in threaded view
|

Re: 2 newbies questions

thiago_sl
Hi Bernat.

On 2 mar, 05:47, AxiNat <[hidden email]> wrote:
> I wrote an issue
> <http://code.google.com/p/iliadproject/issues/detail?id=18>and
> included an st
> file<http://code.google.com/p/iliadproject/issues/attachmentText?id=18&aid...>which
> triggers the supposed bug, it'd be of great help if someone else
> running Iliad 0.9.1 on Pharo 1.1.1 could try this out and confirm whether
> they experience the same problems. Thanks!
>
I tried to simulate  the issue, but your 'buggyApp' works ok. My
config is like yours, maybe except one thing: I loaded  Iliad-
Core0.9.1-SA.3 (i think ConfigurationOfIliad loads Iliad-Core0.9.1-SA.
2)

My SO is Linux.

Cheers!
Thiago Lino
Reply | Threaded
Open this post in threaded view
|

Re: 2 newbies questions

Bernat Romagosa
Wow true,

Disregard the bug then, the issue is fixed in Iliad-Core0.9.1-SA.3!

Thanks :)

2011/3/2 Thiago SL <[hidden email]>
Hi Bernat.

On 2 mar, 05:47, AxiNat <[hidden email]> wrote:
> I wrote an issue
> <http://code.google.com/p/iliadproject/issues/detail?id=18>and
> included an st
> file<http://code.google.com/p/iliadproject/issues/attachmentText?id=18&aid...>which
> triggers the supposed bug, it'd be of great help if someone else
> running Iliad 0.9.1 on Pharo 1.1.1 could try this out and confirm whether
> they experience the same problems. Thanks!
>
I tried to simulate  the issue, but your 'buggyApp' works ok. My
config is like yours, maybe except one thing: I loaded  Iliad-
Core0.9.1-SA.3 (i think ConfigurationOfIliad loads Iliad-Core0.9.1-SA.
2)

My SO is Linux.

Cheers!
Thiago Lino

Reply | Threaded
Open this post in threaded view
|

Re: 2 newbies questions

thiago_sl
Nicolas, i think the ConfigurationOfIliad need an update, to load
Iliad-Core0.9.1-SA.3

On 2 mar, 11:25, AxiNat <[hidden email]> wrote:

> Wow true,
>
> Disregard the bug then, the issue is fixed in Iliad-Core0.9.1-SA.3!
>
> Thanks :)
>
> 2011/3/2 Thiago SL <[hidden email]>
>
> > Hi Bernat.
>
> > On 2 mar, 05:47, AxiNat <[hidden email]> wrote:
> > > I wrote an issue
> > > <http://code.google.com/p/iliadproject/issues/detail?id=18>and
> > > included an st
> > > file<
> >http://code.google.com/p/iliadproject/issues/attachmentText?id=18&aid..
> > .>which
> > > triggers the supposed bug, it'd be of great help if someone else
> > > running Iliad 0.9.1 on Pharo 1.1.1 could try this out and confirm whether
> > > they experience the same problems. Thanks!
>
> > I tried to simulate  the issue, but your 'buggyApp' works ok. My
> > config is like yours, maybe except one thing: I loaded  Iliad-
> > Core0.9.1-SA.3 (i think ConfigurationOfIliad loads Iliad-Core0.9.1-SA.
> > 2)
>
> > My SO is Linux.
>
Reply | Threaded
Open this post in threaded view
|

Re: 2 newbies questions

sebastien audier
Hi guys,

The pharo version is a bit late with the gnu-smalltalk version. So we have to synchronize both, and I think that we'll make it in few days. (May be a release 1.0)
Some bug will be fixed and some features will be added.
So, I am sorry for the late, and thanks to you for the bug report.

--
Sébastien AUDIER

ObjectFusion S.A.R.L.
Applications web, consulting, design
http://www.objectfusion.fr
Reply | Threaded
Open this post in threaded view
|

Re: 2 newbies questions

thiago_sl
In reply to this post by thiago_sl
>
>  2 - I have already reported to Nicolas, but i want to Know if someone
> else had the same problem. With lighbox + formula, #selectOn: and
> #numberInputOn: doesnt work. The buttons save and cancel do nothing,
> and i cant properly debug in Pharo. There are a work around, to still
> use de lightbox?
>

I found an issue in ILNumberInputField, #fieldContents.
fieldContents
        ^[:e |
                e input
                        value: (self value ifNil: [''] ifNotNil: [self value
greaseString]);
                        action: [:val | self value: val asNumber ]]

When the the field is empty, the call 'self value: val asNumber'
fails. So change it to:
   fieldContents
        ^[:e |
                e input
                        value: (self value ifNil: [''] ifNotNil: [self value
greaseString]);
                        action: [:val | (val isEmpty) ifFalse: [ self value: val
asNumber ]]]

Now the numberInputOn is working as expected, in lightbox.
I think that is necessary to apply an similar patch to the official
code.

Cheers,
Thiago Lino
Reply | Threaded
Open this post in threaded view
|

Re: 2 newbies questions

Nicolas Petton
Hi guys,

Sorry for the late answer, I was travelling.

Yes, indeed, it fixes the issue. Thanks!

I'll push all changes monday, and do a new release, with a Metacello
configuration too.

Cheers,
Nico

Le mercredi 02 mars 2011 à 11:30 -0800, Thiago SL a écrit :

> >
> >  2 - I have already reported to Nicolas, but i want to Know if someone
> > else had the same problem. With lighbox + formula, #selectOn: and
> > #numberInputOn: doesnt work. The buttons save and cancel do nothing,
> > and i cant properly debug in Pharo. There are a work around, to still
> > use de lightbox?
> >
>
> I found an issue in ILNumberInputField, #fieldContents.
> fieldContents
> ^[:e |
> e input
> value: (self value ifNil: [''] ifNotNil: [self value
> greaseString]);
> action: [:val | self value: val asNumber ]]
>
> When the the field is empty, the call 'self value: val asNumber'
> fails. So change it to:
>    fieldContents
> ^[:e |
> e input
> value: (self value ifNil: [''] ifNotNil: [self value
> greaseString]);
> action: [:val | (val isEmpty) ifFalse: [ self value: val
> asNumber ]]]
>
> Now the numberInputOn is working as expected, in lightbox.
> I think that is necessary to apply an similar patch to the official
> code.
>
> Cheers,
> Thiago Lino