triggering forms

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

triggering forms

keith1y
I never seem to be able to get triggerForm: to work for me.

I would like to have a link which opens google maps on the address what
the user has typed into a form.

I tried this:

renderContentOn: html

    html popupAnchor
        onClick: (self evaluator triggerForm: 'form');
        url:  self value asString;
        with: self description label.


any ideas as to what I am doing wrong here?

Keith

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

Re: triggering forms

Lukas Renggli
>  renderContentOn: html
>
>     html popupAnchor
>         onClick: (self evaluator triggerForm: 'form');
>         url:  self value asString;
>         with: self description label.
>
>
>  any ideas as to what I am doing wrong here?

What does FireBug say about your code?

Where is your form with the ID 'form'?

      html form id: 'form'; with: [ ...

Lukas

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

Re: triggering forms

keith1y
Lukas Renggli wrote:

>>  renderContentOn: html
>>
>>     html popupAnchor
>>         onClick: (self evaluator triggerForm: 'form');
>>         url:  self value asString;
>>         with: self description label.
>>
>>
>>  any ideas as to what I am doing wrong here?
>>    
>
> What does FireBug say about your code?
>
> Where is your form with the ID 'form'?
>
>       html form id: 'form'; with: [ ...
>
> Lukas
>  
I changed MAContainerDecoration to render as

*renderContentOn: html

    "added an id for the form so that we can potentially trigger the form"
   
    html form
        id: 'form';
        multipart: self isMultipart;
        defaultAction: [ self component perform: self default ];
        with: [ self renderOwnerOn: html; renderButtonsOn: html ]

I dont know that FireBug says anything, should it?

thanks in advance

Keith
*

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

Re: triggering forms

Randal L. Schwartz
>>>>> "Keith" == Keith Hodges <[hidden email]> writes:

Keith> I changed MAContainerDecoration to render as

Keith> *renderContentOn: html

Keith>    "added an id for the form so that we can potentially trigger the form"
Keith>    html form
Keith>        id: 'form';

You can't do this, because you can't have two items in the same
HTML DOM that have the same "id".  You'll need to autogenerate the id.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: triggering forms

Lukas Renggli
In reply to this post by keith1y
> I changed MAContainerDecoration to render as
>
>  *renderContentOn: html

Ok, that makes sense.

>  I dont know that FireBug says anything, should it?

Only now I noticed that you are using #popupAnchor. Does it work when
you use a normal #anchor? I am not sure how the popup anchors interact
with asynchronous requests. Usually asynchronous requests are aborted
when a new page loads (in your case this is a new window, that's why i
am unsure). Maybe this issue can be solved by using the onComplete:
event on the #evaluator and only open the new window in there?

Another thing I noticed is that the #evaluator does not have a
#callback:. This should not be a problem for newer versions of Seaside
(2.8). If you don't have a callback it makes more sense to use a
#requestor.

Lukas

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

Re: triggering forms

Lukas Renggli
In reply to this post by keith1y
> I changed MAContainerDecoration to render as
>
>  *renderContentOn: html

Ok, that makes sense.

>  I dont know that FireBug says anything, should it?

Only now I noticed that you are using #popupAnchor. Does it work when
you use a normal #anchor? I am not sure how the popup anchors interact
with asynchronous requests. Usually asynchronous requests are aborted
when a new page loads (in your case this is a new window, that's why i
am unsure). Maybe this issue can be solved by using the onComplete:
event on the #evaluator and only open the new window in there?

Another thing I noticed is that the #evaluator does not have a
#callback:. This should not be a problem for newer versions of Seaside
(2.8). If you don't have a callback it makes more sense to use a
#requestor.

Lukas

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

Re: triggering forms

keith1y

> Only now I noticed that you are using #popupAnchor. Does it work when
> you use a normal #anchor? I am not sure how the popup anchors interact
> with asynchronous requests. Usually asynchronous requests are aborted
> when a new page loads (in your case this is a new window, that's why i
> am unsure). Maybe this issue can be solved by using the onComplete:
> event on the #evaluator and only open the new window in there?
>
> Another thing I noticed is that the #evaluator does not have a
> #callback:. This should not be a problem for newer versions of Seaside
> (2.8). If you don't have a callback it makes more sense to use a
> #requestor.
>  
requestor does not seem to respond to triggerForm:

A standard anchor does not submit the form either.

Keith

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

Re: triggering forms

Lukas Renggli
> requestor does not seem to respond to triggerForm:

Sorry, it is called #request (probably not the best method name for
that JavaScript object).

>  A standard anchor does not submit the form either.

But it goes to a new page? As I said, going to a new page drops all
asynchronous activity in the browser, so your request is probably
never sent off.

Does something like (without URL and callback) work?

    html anchor onClick: (...); with: 'go'

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside