JQDialog close and confirm

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

JQDialog close and confirm

Malte Grunwald
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
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: JQDialog close and confirm

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 <[hidden email]> 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
[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: JQDialog close and confirm

Malte Grunwald
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 <[hidden email]> 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
[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
Reply | Threaded
Open this post in threaded view
|

Re: JQDialog close and confirm

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 <[hidden email]> 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
[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


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

Re: JQDialog close and confirm

Paul DeBruicker
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 <[hidden email]> 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
[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



_______________________________________________
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: JQDialog close and confirm

Paul DeBruicker
Hi Malte,

I don't know what you should check next.  It seems like because there are three buttons in your dialog in the screenshot but only two in the #test:html method you sent earlier there might be other things going on. 

I think that you should create a very simple example component that only displays an empty dialog.  Ignore the rest of your application. Start from scratch.  Then work to get only one button displayed properly in the one empty dialog.  Then attempt to get another button to display.  If you cannot get one working post the code of your simple example component so other people can attempt diagnose what's going on. 


Do you get any errors/warnings in Firebug? Does the javascript that Seaside outputs look like its well formed and matches whats expected by jQuery as described here:

http://jqueryui.com/demos/dialog/#option-buttons

?

Also, other people on the Seaside list may have better ideas so please keep this discussion on the list. 




On 11-12-02 04:25 AM, Malte Grunwald wrote:
Hello Paul,

thank you so much for your help.

I do not want to bother you, BUT it still does not work. I implemented it exactly like you explained it to me, but all i get is the number of buttons I want, without any function or the right label. The label is a default label, I guess, starting from 0 up to the number of buttons I have. I attached you a screen shot.

It seems as the Array, which is created in the test method, would not be used at all. I debuged through the whole thing, but I did not found, what I am doing wrong.

Thanks again for your help and your time!

Kind regards

Malte 

Am 01.12.2011 23:40, schrieb Paul DeBruicker:
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 <[hidden email]> 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
[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



_______________________________________________
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: JQDialog close and confirm

Malte Grunwald
In reply to this post by Jan van de Sandt
Hello everyone,

I have the problem i try to use buttons in JQDialog.
I tried it the way Jan showed me, but it does not work.
The buttons will be created, but with the label 0,1,2... depending on the size of my button Array.
(Picture in the attachment, size of my button array is three in this case)
The buttons have no functionality. And I really do not have any idea what I am doing wrong.
Even starting from the scratch by creating  a new component did not help.
I tried now in Dolphin and Pharo and i still do not know what am I missing.

Maybe anybody had the same problem.

Regards

Malte

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 <[hidden email]> 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
[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

Dialog.jpg (59K) Download Attachment