client side programming

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

client side programming

mmimica
Hi!

I am aware that Seaside is primary a server-side technology, but in
lack of any mature client side technology that would fit well with
seaside, I have to use Javascript generator that Seaside offers.
I am currently trying to integrate jQGrid to perform CRUD operations
in my application. I have started from what has already been done in
jQueryWidgetBox. It's just an attempt, to see where it leads to, but
I'm not very happy with it already. It needs to support all sorts of
custom editors, be flexible and extensible... Now the implementation
is spread across 5 classes with many selectors, which, you must admit,
use unreadable code to produce JS that is also unreadable in the
generated HTML. Hard to debug and follow.
If I would be typing JS by hand, that would be one day of work and
would produce a screen of readable and compact JS code.

The question is, am I missing something? Can this be done in a easier way?


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

RE: client side programming

Robert Sirois
That's where I ended up, too, Milan. Writing straight js for JQGrid. I've found it easier in many cases to do that elsewhere as well.

RS

> Date: Sun, 11 Sep 2011 15:39:23 +0200

> From: [hidden email]
> To: [hidden email]
> Subject: [Seaside] client side programming
>
> Hi!
>
> I am aware that Seaside is primary a server-side technology, but in
> lack of any mature client side technology that would fit well with
> seaside, I have to use Javascript generator that Seaside offers.
> I am currently trying to integrate jQGrid to perform CRUD operations
> in my application. I have started from what has already been done in
> jQueryWidgetBox. It's just an attempt, to see where it leads to, but
> I'm not very happy with it already. It needs to support all sorts of
> custom editors, be flexible and extensible... Now the implementation
> is spread across 5 classes with many selectors, which, you must admit,
> use unreadable code to produce JS that is also unreadable in the
> generated HTML. Hard to debug and follow.
> If I would be typing JS by hand, that would be one day of work and
> would produce a screen of readable and compact JS code.
>
> The question is, am I missing something? Can this be done in a easier way?
>
>
> --
> Milan Mimica
> http://sparklet.sf.net
> _______________________________________________
> 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: client side programming

mmimica
Okay then, but how do you inject callbacks? Or you use REST-like API?


On 11 September 2011 16:41, Robert Sirois <[hidden email]> wrote:

> That's where I ended up, too, Milan. Writing straight js for JQGrid. I've
> found it easier in many cases to do that elsewhere as well.
> RS
>
>> Date: Sun, 11 Sep 2011 15:39:23 +0200
>> From: [hidden email]
>> To: [hidden email]
>> Subject: [Seaside] client side programming
>>
>> Hi!
>>
>> I am aware that Seaside is primary a server-side technology, but in
>> lack of any mature client side technology that would fit well with
>> seaside, I have to use Javascript generator that Seaside offers.
>> I am currently trying to integrate jQGrid to perform CRUD operations
>> in my application. I have started from what has already been done in
>> jQueryWidgetBox. It's just an attempt, to see where it leads to, but
>> I'm not very happy with it already. It needs to support all sorts of
>> custom editors, be flexible and extensible... Now the implementation
>> is spread across 5 classes with many selectors, which, you must admit,
>> use unreadable code to produce JS that is also unreadable in the
>> generated HTML. Hard to debug and follow.
>> If I would be typing JS by hand, that would be one day of work and
>> would produce a screen of readable and compact JS code.
>>
>> The question is, am I missing something? Can this be done in a easier way?
>>
>>
>> --
>> Milan Mimica
>> http://sparklet.sf.net
>> _______________________________________________
>> 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
>
>



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

RE: client side programming

Robert Sirois
Binding click events after the fact :/

RS

> Date: Sun, 11 Sep 2011 18:00:54 +0200

> Subject: Re: [Seaside] client side programming
> From: [hidden email]
> To: [hidden email]
>
> Okay then, but how do you inject callbacks? Or you use REST-like API?
>
>
> On 11 September 2011 16:41, Robert Sirois <[hidden email]> wrote:
> > That's where I ended up, too, Milan. Writing straight js for JQGrid. I've
> > found it easier in many cases to do that elsewhere as well.
> > RS
> >
> >> Date: Sun, 11 Sep 2011 15:39:23 +0200
> >> From: [hidden email]
> >> To: [hidden email]
> >> Subject: [Seaside] client side programming
> >>
> >> Hi!
> >>
> >> I am aware that Seaside is primary a server-side technology, but in
> >> lack of any mature client side technology that would fit well with
> >> seaside, I have to use Javascript generator that Seaside offers.
> >> I am currently trying to integrate jQGrid to perform CRUD operations
> >> in my application. I have started from what has already been done in
> >> jQueryWidgetBox. It's just an attempt, to see where it leads to, but
> >> I'm not very happy with it already. It needs to support all sorts of
> >> custom editors, be flexible and extensible... Now the implementation
> >> is spread across 5 classes with many selectors, which, you must admit,
> >> use unreadable code to produce JS that is also unreadable in the
> >> generated HTML. Hard to debug and follow.
> >> If I would be typing JS by hand, that would be one day of work and
> >> would produce a screen of readable and compact JS code.
> >>
> >> The question is, am I missing something? Can this be done in a easier way?
> >>
> >>
> >> --
> >> Milan Mimica
> >> http://sparklet.sf.net
> >> _______________________________________________
> >> 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
> >
> >
>
>
>
> --
> Milan Mimica
> http://sparklet.sf.net
> _______________________________________________
> 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: client side programming

mmimica
Sorry, I didn't understand that. Could you elaborate please?

On 11 September 2011 18:08, Robert Sirois <[hidden email]> wrote:
> Binding click events after the fact :/
> RS
>




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

RE: client side programming

Robert Sirois
data do: [:t |
	html document addLoadScript: ((html jQuery: t title asSymbol) live: 'click' do: ((html jQuery ajax callback: [ ... ]) onComplete: html javascript refresh)).
].

RS

> Date: Sun, 11 Sep 2011 18:10:42 +0200

> Subject: Re: [Seaside] client side programming
> From: [hidden email]
> To: [hidden email]
>
> Sorry, I didn't understand that. Could you elaborate please?
>
> On 11 September 2011 18:08, Robert Sirois <[hidden email]> wrote:
> > Binding click events after the fact :/
> > RS
> >
>
>
>
>
> --
> Milan Mimica
> http://sparklet.sf.net
> _______________________________________________
> 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: client side programming

mmimica
Oh, funny :)

On 11 September 2011 18:14, Robert Sirois <[hidden email]> wrote:

> data do: [:t |
>
> html document addLoadScript: ((html jQuery: t title asSymbol) live: 'click'
> do: ((html jQuery ajax callback: [ ... ]) onComplete: html javascript
> refresh)).
>
> ].
>
> RS
>
>> Date: Sun, 11 Sep 2011 18:10:42 +0200
>> Subject: Re: [Seaside] client side programming
>> From: [hidden email]
>> To: [hidden email]
>>
>> Sorry, I didn't understand that. Could you elaborate please?
>>
>> On 11 September 2011 18:08, Robert Sirois <[hidden email]> wrote:
>> > Binding click events after the fact :/
>> > RS
>> >
>>
>>
>>
>>
>> --
>> Milan Mimica
>> http://sparklet.sf.net
>> _______________________________________________
>> 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
>
>



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

RE: client side programming

Robert Sirois
Hey, it works ;)

RS

> Date: Sun, 11 Sep 2011 18:20:25 +0200

> Subject: Re: [Seaside] client side programming
> From: [hidden email]
> To: [hidden email]
>
> Oh, funny :)
>
> On 11 September 2011 18:14, Robert Sirois <[hidden email]> wrote:
> > data do: [:t |
> >
> > html document addLoadScript: ((html jQuery: t title asSymbol) live: 'click'
> > do: ((html jQuery ajax callback: [ ... ]) onComplete: html javascript
> > refresh)).
> >
> > ].
> >
> > RS
> >
> >> Date: Sun, 11 Sep 2011 18:10:42 +0200
> >> Subject: Re: [Seaside] client side programming
> >> From: [hidden email]
> >> To: [hidden email]
> >>
> >> Sorry, I didn't understand that. Could you elaborate please?
> >>
> >> On 11 September 2011 18:08, Robert Sirois <[hidden email]> wrote:
> >> > Binding click events after the fact :/
> >> > RS
> >> >
> >>
> >>
> >>
> >>
> >> --
> >> Milan Mimica
> >> http://sparklet.sf.net
> >> _______________________________________________
> >> 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
> >
> >
>
>
>
> --
> Milan Mimica
> http://sparklet.sf.net
> _______________________________________________
> 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: client side programming

Johan Brichau-2
In reply to this post by Robert Sirois
Hi,

When we want to use a Seaside callback in the place of a Javascript callback in external Javascript code, we frequently do this:
- Generate a named Javascript function definition from within Seaside.
- Use the named Javascript function as a callback in the external Javascript code.

For example, the following code generates a one-argument Javascript function that, when called, will do the callback

        html document addLoadScript:  ((html jQuery ajax
                                                                        callback:[:val | … ]
                                                                        value: (JSStream on: 'argument')) asFunction:#(argument)) assignTo: 'callbackFunction)

Then use 'callbackFunction' in your external javascript. E.g.:

$('.callbacked').selectable({onSelect:callbackFunction})


It probably makes sense to come up with a good abstraction for this kind of interactions in Seaside. We should think about it…

Johan

On 11 Sep 2011, at 18:14, Robert Sirois wrote:

> data do: [:t |
> html document addLoadScript: ((html jQuery: t title asSymbol) live: 'click' do: ((html jQuery ajax callback: [ ... ]) onComplete: html javascript refresh)).
> ].
>
> RS
>
> > Date: Sun, 11 Sep 2011 18:10:42 +0200
> > Subject: Re: [Seaside] client side programming
> > From: [hidden email]
> > To: [hidden email]
> >
> > Sorry, I didn't understand that. Could you elaborate please?
> >
> > On 11 September 2011 18:08, Robert Sirois <[hidden email]> wrote:
> > > Binding click events after the fact :/
> > > RS
> > >
> >
> >
> >
> >
> > --
> > Milan Mimica
> > http://sparklet.sf.net
> > _______________________________________________
> > 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