Francisco Martins | 10 Feb 21:57
Picon
Gravatar

How do I use JQuery with Javascript variable

Johan, I did some research and with help of a co-worker detected the
cause of themalfunction. Now it works! A string containing the
javascript can be generated inSmalltalk using apostrophes repeated. As
for quotes no problem. The code to render the radio buttons was using
group, which prevented the "values" ​​were rendered. I made a version
that worked obstrusive. See below:

renderContentOn: html
	html
		form: [
			html
				div: [
					(html label)
						for: #radioYes;
						with: 'What is your answer?'.
					(html radioButton)
						id: #radioYes;
						name: #someRadioGroup;
						selected: true;
						value: 'yes';
						with: 'Yes'.
					(html radioButton)
						id: #radioNo;
						name: #someRadioGroup;
						value: 'no';
						with: 'No'.
					(html radioButton)
						id: #radioMaybe;
						name: #someRadioGroup;
						value: 'maybe';
(Continue reading)

Francisco Martins | 10 Feb 21:52
Picon
Gravatar

Re: Re: Re: How do I use JQuery with Javascript variable

Johan, I did some research and with help of a co-worker detected the cause of themalfunction. Now it works! A string containing the javascript can be generated inSmalltalk using apostrophes repeated. As for quotes no problem. The code to render the radio buttons was using group, which prevented the "values" ​​were rendered. I made a version that worked obstrusive. See below:


renderContentOn: html
html
form: [ 
html
div: [ 
(html label)
for: #radioYes;
with: 'What is your answer?'.
(html radioButton)
id: #radioYes;
name: #someRadioGroup;
selected: true;
value: 'yes';
with: 'Yes'.
(html radioButton)
id: #radioNo;
name: #someRadioGroup;
value: 'no';
with: 'No'.
(html radioButton)
id: #radioMaybe;
name: #someRadioGroup;
value: 'maybe';
with: 'Maybe'.
(html radioButton)
id: #radioConfused;
name: #someRadioGroup;
value: 'confused';
with: 'I dunno' ].
html
div: [ 
(html button)
type: #button;
id: #testButton;
class: #green90x24;
onClick:
'var checkedValue = $(''[name="someRadioGroup"]:radio:checked'').val();
$(''#result'').html(''The radio element with value <tt>''+ checkedValue +''</tt> is checked.'');';
with: 'Which?' ].
html div id: #result ]


Then I had the idea of ​​making a non-obstrusive, which also worked. See below: 
renderContentOn: html 
html document
addLoadScript: ((html jQuery: #testButton)
onClick: 'var checkedValue = $(''[name="someRadioGroup"]:radio:checked'').val();
$(''#result'').html(''The radio element with value <tt>''+ checkedValue +''</tt> is checked.'');').
html
form: [html
div: [html label for: #radioYes;
with: 'What is your answer?'.
html radioButton id: #radioYes;
name: #someRadioGroup;
selected: true;
value: 'yes';
with: 'Yes'.
html radioButton id: #radioNo;
name: #someRadioGroup;
value: 'no';
with: 'No'.
html radioButton id: #radioMaybe;
name: #someRadioGroup;
value: 'maybe';
with: 'Maybe'.
html radioButton id: #radioConfused;
name: #someRadioGroup;
value: 'confused';
with: 'I dunno'].
html
div: [html button type: #button;
id: #testButton;
class: #green90x24;
with: 'Which?'].
html div id: #result]

The version below to render the radio buttons do not work because the "group" that prevents the "values" are rendered:

                                          html
radioGroup: [:group | 
html radioButton id: #radioYes;
group: group;
name: #someRadioGroup;
value: #yes;
selected: true;
with: 'Yes'.
html radioButton id: #radioNo;
group: group;
name: #someRadioGroup;
value: #no;
with: 'No'.
html radioButton id: #radioMaybe;
group: group;
name: #someRadioGroup;
value: #maybe;
with: 'Maybe'.
html radioButton id: #radioConfused;
group: group;
name: #someRadioGroup;
value: #confused;
with: 'I dunno']].

Thanks for your attention that helped me in solving the problem.
--
Sds.,

Francisco Ary Martins
http://chicoary.wordpress.com
----
"A filosofia não é senão uma poesia sofisticada."
Montaigne
_______________________________________________
seaside mailing list
seaside <at> lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Torsten Bergmann | 10 Feb 10:22
Picon
Picon

Webapp Test tools

Hi,

what tools do you use for testing your (Seaside) web app?
Any experience to share?

Thanks
Torsten
--

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
Stephan Eggermont | 6 Feb 13:32
Picon
Favicon
Gravatar

FOSDEM devroom

Yesterday we had a nice day filled with great presentations.

Getting to Brussels the day before proved to be a challenge, 
as the Dutch railways showed to have lots of trouble with
3 cm of snow and a cold night. Andy showed us a good place
to eat and talk near the Central Station.

In the end all presenters managed to be on time and the whole
day ran smoothly. As the devroom was the second day of 
FOSDEM, we thought it wise not to start too early. That was 
a good idea, as the ULB was still very quiet when Norbert 
showed us how to create REST/json/xml based services.
Markus followed with the Pharo Vision. 

Gradually more people came to the devroom until the 
jQueryMobile presentation was so filled that we had to refuse
people entering the room. The Amber presentation also attracted 
a lot of people new to smalltalk. The ability to create a fast feedback
cycle apparently is a major issue for javascript developers. 
The progress made since ESUG2011 is impressive. 

The next subjects (working with many cores, making smalltalk fast,
spoon) still attracted over 40 participants.

The introduction to smalltalk attracted quite a lot of young developers.
Some remarks by participants:
- a consistent set of keybindings, allowing switching between
 windows is essential (a developer who has trouble using a
 mouse for longer periods);
- current developers are no longer used to free floating windows,
 it doesn't matter if it is better, to attract new people you need to
 remove barriers to entry (a freepascal maintainer);
- I would have expected to have started with the basics (we focused
 on the things we experienced as difficult and different, using the 
 different inspectors and browsers to navigate a large codebase,
 debugger driven development)
And some reminder for ourselves
- Tests for the domain model are not enough to ensure that the
 whole application works correctly;
- Throw away old builds;
- Check if there are enough power strips.

I very much liked talking to people otherwise only known from 
the mailing lists and the cross-pollination between the different
dialects. I would have liked to have more time for discussions.
A lunch break might be a good idea. 

And finally a remark for next years devroom manager: don't expect
to see much from FOSDEM :)

Stephan Eggermont
Milan Mimica | 4 Feb 18:12
Picon

multiple components

Hello!


   Some of my more complex views contain a hierarchy of components, each component taking care of some small part of UI logic. This view is implemented as a container component which delegates rendering to several sub-components. From outside, this view looks like an ordinary WAComponent. Everything goo so far. A small problem arises when such component tries to #call: another component. Since technically it is usually the inner component sending #call: to self, the new view doesn't replace the whole hierarchy, but only the inner component that actually sent #call:, which is not fine in this case.
What am I doing now, is sending each inner component a reference to its container component and then the inner object sends #call: to its container instead of self. I find it ugly, need to elaborate why? Is there a better solution?

A similar problem arises with #answer -- you cannot #answer from an inner component because it wasn't the one which wall #call-ed in the first place. Again I need a reference to a container component to #answer from there.


--
Milan Mimica
http://sparklet.sf.net
_______________________________________________
seaside mailing list
seaside <at> lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
sergio_101 | 3 Feb 05:20

which vm for pier

i have two new pier sites going up, and i am not sure where the issue
is, but the headless server seems to die after a few hours..

i got the vm from one of the cog prebuilt binaries, but i would have
to go searching around to find out where..

the details are:

VM Version:     Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.140]
VM Type:        32bit
Endianness:     little

anyway.. i was wondering which one everyone was currently using on
their deployed systems..

thanks!

--

-- 
----
peace,
sergio
photographer, journalist, visionary

http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
Esteban Lorenzano | 29 Jan 21:44
Picon
Gravatar

pier2 loaded successfully on Pharo 1.4

Hi,

with seaside 3.0 fixed (as I send in another mail), I can report that pier2 loads and runs out of the box on
pharo 1.4

best,
Esteban
Esteban Lorenzano | 29 Jan 21:23
Picon
Gravatar

loading Seaside 3.0.6.3 in Pharo 1.4

Hi,

I loaded last version of seaside into a pharo 1.4 image. 
Everything looks working fine, but there a couple of fixes: 

1) 

KomLogger>>#attachTranscript
	self detachTheTranscript.
	^(self streams detect: [:ea | ea isTranscriptStream] ifNone: [nil]) 
		ifNil: [self addStream: TranscriptStream new]

"TranscriptStream" is not anymore on pharo and should be replaced with ThreadSafeTranscript

2) String>>#withBlanksTrimmed is deprecated, and now it should use #trimBoth

how can I proceed to apply this fixes into seaside (without breaking other platforms)?

cheers,
Esteban
Francisco Martins | 28 Jan 23:55
Picon
Gravatar

How do I use JQuery with Javascript variable

I'm trying to code some examples in the book I found JQuery JQuery in
Action, Second Edition.

The example has the following code snippet:

<script type="text/javascript">
      $(function(){
        $('#testButton').click(function(){
          var checkedValue = $('[name="someRadioGroup"]:radio:checked').val();
          $('#result').html('The radio element with value <tt>' +
checkedValue + '</tt> is checked.');
        });
      });
</script>

I do not know what to write on the line with a comment below:

	html document addLoadScript: (
			(html jQuery: #testButton) onClick: (
				(html jQuery: #result) load html: [:renderer| |checkedValue|
					checkedValue := 'What is equivalent to the code in the comment?'.
"var checkedValue =
$('[name=''someRadioGroup'']:radio:checked').val();"
					renderer html: 'The radio element with value <tt>' , checkedValue
, '</tt> is checked.'
				]
			)
	).

Thanks for any help.

chicoary
Stephan Eggermont | 24 Jan 10:02
Picon
Favicon
Gravatar

FOSDEM2012 smalltalk devroom 5 feb, sprint 4 feb

Feb 4-5 2012 Brussels hosts FOSDEM2012, 
the free and open software developers european meeting. 

Sunday there will be a smalltalk devroom (AW 1.126) with 
a number of interesting presentations.

09:30 Norbert Hartl, Take a small REST. Simple approaches for REST in smalltalk
10:00 Stephane Ducasse, Marcus Denker, The next steps for the Pharo Vision
11:00 Laurent Laffont, John Thornton, Amber, the Smalltalk for web developers
12:00 Nick Ager, An introduction to jQuery Mobile
12:30 Stefan Marr, RoarVM, Sly
13:00 David Chisnall, Compiling Smalltalk to fast native Code
13:30 Craig Latta, Spoon
14:00 Stephan Eggermont, Willem van den Ende, Diego Lont, Back to the future, (re)learn smalltalk
(till 16:30).

http://fosdem.org/2012/schedule/track/smalltalk_devroom

As there is no devroom on saturday, the VUB has kindly offered to organise
a sprint. There will be a room available at walking distance from FOSDEM. 

Stephan
Malte Grunwald | 24 Jan 09:06
Gravatar

JQDialog button problems

Hey everybody,

I have this problem for a while now and not found a solution until now.
I already brought this up, a few months ago, some people tried to help me, but I did not found a solution.

I will use a JQDialog with multiple buttons, i.e. "cancel" and "confirm".
The cancel button should only close the window.
No problem so far.
But now the tricky part, the "confirm" button should serialize a form, send an ajax request to update a div container and then close the window.

My problem is, I am not able to attach more than one method to a button.

Here my example dialog:

(html div)
        id: anIdString;
        script: (((html jQuery id: anIdString) dialog)
                    title: (anIdString copyFrom: 4 to: anIdString size);
                    autoOpen: false;
                    modal: true;
                    width: anInteger;
                    height: 'auto';
                    resizable: false;
                    addButton: 'Close' do: html jQuery new dialog close);
        with: [self dialogContent: html]

This is a suggestion, Jan van de Sandt made. Thanks again.

testButtons: html
^ OrderedCollection new
add: (Dictionary new
at: 'id' put: html nextId ;
at: 'text' put: 'Annuleer' ;
at: 'click' put: (html jQuery ajax script: [ :h | self actionCancel: h ]) asFunction ;
yourself) ;
add: (Dictionary new
at: 'id' put: html nextId ;
at: 'text' put: 'Ok' ;
at: 'click' put: (html jQuery ajax 
serializeForm: (html jQuery id: self personDataFormId) ;
script: [ :s | self actionFinish: s ]) asFunction ;
yourself) ;
asArray



(html div)
        id: anIdString;
        script: (((html jQuery id: anIdString) dialog)
                    title: (anIdString copyFrom: 4 to: anIdString size);
                    autoOpen: false;
                    modal: true;
                    width: anInteger;
                    height: 'auto';
                    resizable: false;
                    addButton: 'Close' do: html jQuery new dialog close);
                    buttons: (self testButtons: html);
        with: [self dialogContent: html]


But this did not work for me.
Maybe somebody have an idea.

Thank you very much!

Kind regards

Malte

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

Gmane