trying to use WASelectTag and its not working....

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

trying to use WASelectTag and its not working....

LawsonEnglish
  Why isn't this working?




Basically I'm trying to let people browse (read only) the code for the
page component they are looking at, but its not working. The callback is
never called.

#createText: value
"obtain source code for selected method"
     self sourceCode: self sourceCodeAt: value

#renderContentOn: html
"..."
html text: 'source code'.

     html select
             list:  (self class selectors);
         selected: #renderContentOn: ;
         callback: [:value | self createText: value     ].
              html break.

  html textArea
          value: self sourceCode;
         rows: 30;
         columns: 60.
         html break.

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

RE: trying to use WASelectTag and its not working....

Boris Popov, DeepCove Labs (SNN)
Do you expect it to be called on change or on form submit? If the
former, you need #beSubmitOnChange (or use proper JS library to wire
this event), if the latter, please post a complete example of a form.

Regards,

-Boris

--
DeepCove Labs Ltd.
+1 (604) 689-0322
4th floor, 595 Howe Street
Vancouver, British Columbia
Canada V6C 2T5
http://tinyurl.com/r7uw4

PacNet Services (Europe) Ltd.
+353 (0)61 714-360
Shannon Airport House, SFZ
County Clare, Ireland
http://tinyurl.com/y952amr

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message header.
Unless otherwise indicated, it contains information that is private and
confidential. If you have received it in error, please notify the sender
and delete the entire message including any attachments.

Thank you.


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Lawson
English
Sent: 10 September 2010 12:46
To: Seaside - general discussion
Subject: [Seaside] trying to use WASelectTag and its not working....

  Why isn't this working?




Basically I'm trying to let people browse (read only) the code for the
page component they are looking at, but its not working. The callback is
never called.

#createText: value
"obtain source code for selected method"
     self sourceCode: self sourceCodeAt: value

#renderContentOn: html
"..."
html text: 'source code'.

     html select
             list:  (self class selectors);
         selected: #renderContentOn: ;
         callback: [:value | self createText: value     ].
              html break.

  html textArea
          value: self sourceCode;
         rows: 30;
         columns: 60.
         html break.

_______________________________________________
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: trying to use WASelectTag and its not working....

Nick
Hi Lawson,
 
Do you expect it to be called on change or on form submit? If the
former, you need #beSubmitOnChange (or use proper JS library to wire
this event), if the latter, please post a complete example of a form.


    html select
            list:  (self class selectors);
        selected: #renderContentOn: ;
        callback: [:value | self createText: value     ].
             html break.

As Boris says, your callback will only be evalulated when the form is submitted. So you need to add a form and a submit button or a call to #beSubmitOnChange. Something like:

html form:[
   html select
           list:  (self class selectors);
       selected: #renderContentOn: ;
beSubmitOnChange;
       callback: [:value | self halt ].
].

or instead of #beSubmitOnChange use:

html submitButton with: 'lookup'.

inside the form

Nick
 

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

Re: trying to use WASelectTag and its not working....

LawsonEnglish
beSubmitOnChange;  doesn't work, but html submitButton with: 'lookup'.  does, thanks.


Its working, but it would be more elegant if it used beSubmitOnChange.


Still missing some syntax thing apparently.
==================
html form:[
    html text: 'source code: '.
    html select
        list:  (self class selectors);
        selected: self codeSelector ;
        beSubmitOnChange;
        callback: [:value | self codeSelector: value ].
        "html submitButton with: 'lookup'."
    html break.
    html textArea
        value: (self class sourceCodeAt: self codeSelector);
        rows: 30;
        columns: 60.
]
==================


On 9/10/10 4:57 AM, Nick Ager wrote:
Hi Lawson,
 
Do you expect it to be called on change or on form submit? If the
former, you need #beSubmitOnChange (or use proper JS library to wire
this event), if the latter, please post a complete example of a form.


    html select
            list:  (self class selectors);
        selected: #renderContentOn: ;
        callback: [:value | self createText: value     ].
             html break.

As Boris says, your callback will only be evalulated when the form is submitted. So you need to add a form and a submit button or a call to #beSubmitOnChange. Something like:

html form:[
   html select
           list:  (self class selectors);
       selected: #renderContentOn: ;
beSubmitOnChange;
       callback: [:value | self halt ].
].

or instead of #beSubmitOnChange use:

html submitButton with: 'lookup'.

inside the form

Nick
 
_______________________________________________ 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: trying to use WASelectTag and its not working....

Bart Veenstra
Serializing the select box on the change event is very simple when you use JQuery:

 html select
        list:  (self class selectors);
        selected: self codeSelector ;
        onChange: (html jQuery ajax serializeThisWithHidden);
        callback: [:value | self codeSelector: value ].

Regards.

Bart



2010/9/10 Lawson English <[hidden email]>
beSubmitOnChange;  doesn't work, but html submitButton with: 'lookup'.  does, thanks.


Its working, but it would be more elegant if it used beSubmitOnChange.


Still missing some syntax thing apparently.
==================
html form:[
    html text: 'source code: '.

    html select
        list:  (self class selectors);
        selected: self codeSelector ;
        beSubmitOnChange;
        callback: [:value | self codeSelector: value ].
        "html submitButton with: 'lookup'."
    html break.
    html textArea
        value: (self class sourceCodeAt: self codeSelector);
        rows: 30;
        columns: 60.
]
==================



On 9/10/10 4:57 AM, Nick Ager wrote:
Hi Lawson,
 
Do you expect it to be called on change or on form submit? If the
former, you need #beSubmitOnChange (or use proper JS library to wire
this event), if the latter, please post a complete example of a form.


    html select
            list:  (self class selectors);
        selected: #renderContentOn: ;
        callback: [:value | self createText: value     ].
             html break.

As Boris says, your callback will only be evalulated when the form is submitted. So you need to add a form and a submit button or a call to #beSubmitOnChange. Something like:

html form:[
   html select
           list:  (self class selectors);
       selected: #renderContentOn: ;
beSubmitOnChange;
       callback: [:value | self halt ].
].

or instead of #beSubmitOnChange use:

html submitButton with: 'lookup'.

inside the form

Nick
 
_______________________________________________ seaside mailing list


_______________________________________________
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: trying to use WASelectTag and its not working....

Philippe Marschall
In reply to this post by LawsonEnglish
2010/9/10 Lawson English <[hidden email]>:

> beSubmitOnChange;  doesn't work, but html submitButton with: 'lookup'.
> does, thanks.
>
>
> Its working, but it would be more elegant if it used beSubmitOnChange.
>
>
> Still missing some syntax thing apparently.
> ==================
> html form:[
>     html text: 'source code: '.
>     html select
>         list:  (self class selectors);
>         selected: self codeSelector ;
>         beSubmitOnChange;
>         callback: [:value | self codeSelector: value ].
>         "html submitButton with: 'lookup'."
>     html break.
>     html textArea
>         value: (self class sourceCodeAt: self codeSelector);
>         rows: 30;
>         columns: 60.
> ]
> ==================

Your code with #beSubmitOnChange works very nicely here once I add a
guard for a nil codeSelector. Can you provide us with a full fileout
of your code?

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside