[Seaside] Problem smalltalk code

Johan Brichau johan at inceptive.be
Wed Oct 27 07:39:57 UTC 2010


Changing the selection in the scroll list does not submit the form automatically. You either need to have an explicit submit button, which will trigger the callbacks on the server-side, or you need to make the form submit on the 'change' event of the scroll list.

If you want the form to submit when changing the selection in the scroll list, you can use the jQuery ajax serialize functionality like this:

html select
		list: ...
		callback: ....
		onChange: (html jQuery ajax serializeForm)


Johan

On 27 Oct 2010, at 09:05, Alexandre BP wrote:

> Thank you for you reply Robert,
> 
> Unfortunately it doesn't work. The variable selected is not updated directly when I change from 'a' to 'b' in the scroll list.
> Any idea why it doesn't work?
>  
> 
> From: watchlala at hotmail.com
> To: seaside at lists.squeakfoundation.org
> Subject: RE: [Seaside] Problem smalltalk code
> Date: Tue, 26 Oct 2010 10:38:09 -0600
> 
> Browse WAChoiceDialog.
> 
> You can make it as simple as:
> 
> renderContentOn: html
> 
>     html form: [ html select list: (Array with: 'a' with: 'b'); callback: [:v | self selected: v ] ].
>     html text: self selected.
> 
> selected
>     ^selected ifNil: [ selected := 'Choose a value to print.' ].
> 
> selected: aRenderable
>     selected := aRenderable.
> 
> (Doing this from memory)
> RS
> 
> From: abalonpe at ulb.ac.be
> To: seaside at lists.squeakfoundation.org
> Date: Tue, 26 Oct 2010 16:20:16 +0000
> Subject: [Seaside] Problem smalltalk code
> 
> Hi,
> 
> I'm stuck on a problem with smalltalk.
> Here is my code:
> 
> 	 renderBibTypeOn: canvas 
> 
> 	| tagID | 
> 	canvas div: [ 
> 		canvas label 
> 			for: (tagID := canvas nextId); 
> 			with: 'BibteX Type:'. 
> 		canvas select 
> 			id: tagID; 
> 			selected: bibEntry bibType ; 
> 			list: bibEntry bibTypeList; 
> 			callback: [:value | bibEntry bibType: value].
> 		 ].
> 
> I'd like to change what is displayed on my webpage according to what the user choose from the scroll list.
> I saw that there was an exemple of this on localhost-->browse-->examples-->examplebrowser 
> but the code of this exemple is not online on the contraty of the other examples.
> Could you help me with this code or post the code of the examplebrowser?
> 
> Thank you very much
> alex
> 
> _______________________________________________ seaside mailing list seaside at lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> 
> _______________________________________________ seaside mailing list seaside at lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20101027/cefb6c2b/attachment.htm


More information about the seaside mailing list