[Seaside] JQDialog close and confirm

Paul DeBruicker pdebruic at gmail.com
Thu Dec 1 22:40:17 UTC 2011


Hi Malte,

Try this:

renderContentOn:html

     html div
         id:'myDialog';
         script:(html jQuery new dialog buttons: (self test: html)).


With #test: being the same as what you described in your email below.

My #addDialogButtonsOn:html was meant to be sent from a render method 
and not as part of the creation of the dialog box itself.  Sorry for not 
being more specifc.

Paul



On 11-12-01 01:40 AM, Malte Grunwald wrote:
> Hello Paul,
>
> thank you that you tried to help me and  all you wrote makes totally 
> sense to me,  but it still does not work.
>
> At the moment I am getting the error: "Undefined Object does not 
> understand parent" and I do not know why.
>
> Maybe you can have a look over my code, if you have some time.
>
> /renderDialogCheckboxOn: html with: aString id: anIdString width: 
> anInteger
>     "Creates a modal dialog. The title is Created out of the id 
> without the div prefix."
>
>     (html div)
>         id: anIdString;
>         script: ((html jQuery new dialog)
>                     title: (anIdString copyFrom: 4 to: anIdString size);
>                     autoOpen: false;
>                     modal: true;
>                     width: 350;
>                     height: 'auto';
>                     resizable: false;
>                     buttons: (self addDialogButtonsOn: html));
>         with:
>                 [(html form)
>                     id: #checkForm;
>                     with:
>                             [html div:
>                                     [html
>                                         text: ('Ich ' , self session 
> user firstName , ' ' , self session user lastName
>                                                 , ' bin mit den Kosten 
> in Höhe von xx einverstanden.') asUTF8String].
>                             (html div)
>                                 id: #checkBoxDiv;
>                                 with:
>                                         [(html checkbox)
>                                             onChange: html jQuery ajax 
> serializeForm;
>                                             callback:
>                                                     [:value |
>                                                     self payAt: 
> #WoodListWf put: value.
>                                                     self createWoodList];
>                                             value: (self session 
> paymentDict at: #WoodListWf)]]]/
>
>
> addDialogButtonsOn: html
>     html script: ((html jQuery id: 'divKostenpflichtig') dialog 
> buttons: (self test: html))
>
> test: 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: 
> #checkForm);
>                                 script: [:s | self actionFinish: s]) 
> asFunction;
>                     yourself);
>         asArray
>
> I hope you ll find something, please let me know.
>
> Thank you very much.
>
> Kind regards
>
> Malte Grunwald
>
>
> Am 28.11.2011 20:37, schrieb Paul DeBruicker:
>> You could use:
>>
>> MyComponent>>#addDialogButtonsOn:html
>> html script: ((html jQuery id: 'myDialog') dialog buttons:(self 
>> dialogButtonsOn:html)).
>>
>> MyComponent>> #dialogButtonsOn: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
>>
>>
>>
>> On 11-11-28 05:56 AM, Malte Grunwald wrote:
>>> Thank you so far for your quick respond,
>>> but do you maybe have another example? Which method calls your 
>>> example-method?
>>> I tried it with JQDialog<<buttons:  but it did not work, am i 
>>> missing something?
>>> Thank you very much.
>>>
>>> Kind Regards
>>>
>>> Malte Grunwald
>>>
>>> Am 25.11.2011 13:48, schrieb Jan van de Sandt:
>>>> Hi,
>>>>
>>>> Sure. I use this a lot. For example you can set the buttons of a 
>>>> JQuery dialog this:
>>>>
>>>> ^ 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
>>>>
>>>> In the #actionFinish: method I check the form ans show an error 
>>>> message or close the dialog.
>>>>
>>>> Jan.
>>>>
>>>>
>>>> On Fri, Nov 25, 2011 at 12:55 PM, Malte Grunwald 
>>>> <malte.grunwald at googlemail.com 
>>>> <mailto:malte.grunwald at googlemail.com>> wrote:
>>>>
>>>>     Hey everyone,
>>>>
>>>>     I am actually playing around with the JQDialog, now i have a
>>>>     problem.
>>>>
>>>>     Beside my close button, i want to create a confirm button,
>>>>     which serializes a form and then closes the dialog, like it is
>>>>     in every normal Desktopapplication.
>>>>
>>>>     Is there any possibility to combine this two actions?
>>>>
>>>>     Thank you very much.
>>>>
>>>>     Kind Regards
>>>>
>>>>     Malte
>>>>     _______________________________________________
>>>>     seaside mailing list
>>>>     seaside at lists.squeakfoundation.org
>>>>     <mailto: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
>>
>>
>>
>> _______________________________________________
>> 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/20111201/91eebd11/attachment-0001.htm


More information about the seaside mailing list