Html5 inputs examples for seaside

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

Html5 inputs examples for seaside

OswallVernyAC
I would like to know if you have examples of use for html5 inputs in Seaside 3.3.
I am with the Seaside book on the website. I have examples of textInput and others, however I am interested in inputs of numbers, dates, months, html5 colors, apply calculations and get results.
I have errors in syntax.
I need to establish memory variables that should not persist and then perform calculations on methods and only totals persist.

Thanks in advance.
Oswall


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

Re: Html5 inputs examples for seaside

Paul DeBruicker
If you browse implementors of #textInput you'll see that its defined in
WAHtmlCanvas.  In that class in the tags-input protocol there are also
#dateInput5, #numberInput, #monthInput, #colorInput.

The default install of Seaside comes with examples of all of the inputs.  I
think if you go to http://127.0.0.1:8080/browse you can see them.

What code are you trying that gives you errors?  Can you post it here?   If
you can it will make figuring out whats wrong much easier.



An example of a component that takes two numbers and calculates a result
then displays  it is:  


WAComponent subclass: #MyComponent
        instanceVariableNames: 'firstNumber secondNumber result'
        classVariableNames: ''
        package: 'MyPackage'

MyComponent>>#initialize
   super initialize.
   firstNumber:=0.
   secondNumber :=0.
   result:='Nothing yet'.

MyComponent>>#firstNumber
    ^ firstNumber

MyComponent>>#secondNumber
    ^ secondNumber

MyComponent>>#firstNumber: aNumberString
     firstNumber := aNumberString asNumber

MyComponent>>#secondNumber: aNumberString
    secondNumber := aNumberString asNumber

MyComponent >> #calculateResult
   result := firstNumber raisedTo: secondNumber.

MyComponent>>#renderContentOn: html

html form
   id:'myForm';
   with:[

  html numberInput
     step: 0.1;
     min: -1;
     max: 1;
     on: #firstNumber of: self.

  html numberInput
     step: 10;
     min: -100;
     max: 100;
     on: #secondNumber of: self.

  html hiddenInput
     callback: [self calculateResult].

  html submitButton
    with:'Calculate Result'].


html heading level1; with:'Result:'.
html heading level3; with: result.




You can change the #calculateResult method to do anything including
persisting the value of result in another object or data store.  You can
change the number inputs to ignore the stored value of #firstNumber or
#secondNumber and always use a default value like this:

html numberInput
     step: 0.1;
     min: -1;
     max: 1;
     value: -0.7;
     callback:[:val | self firstNumber: val ].

  html numberInput
     step: 10;
     min: -100;
     max: 100;
    value: 20;
    callback:[:val |self  secondNumber: val].







OswallVernyAC wrote

> I would like to know if you have examples of use for html5 inputs in
> Seaside 3.3.
> I am with the Seaside book on the website. I have examples of textInput
> and
> others, however I am interested in inputs of numbers, dates, months, html5
> colors, apply calculations and get results.
> I have errors in syntax.
> I need to establish memory variables that should not persist and then
> perform calculations on methods and only totals persist.
>
> Thanks in advance.
> Oswall
>
> _______________________________________________
> seaside mailing list

> seaside@.squeakfoundation

> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside





--
Sent from: http://forum.world.st/Seaside-General-f86180.html
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Html5 inputs examples for seaside

Philippe Marschall
In reply to this post by OswallVernyAC
On Wed, Oct 30, 2019 at 6:25 PM Oswall Verny Arguedas C.
<[hidden email]> wrote:
>
> I would like to know if you have examples of use for html5 inputs in Seaside 3.3.

You can have a look at WAHtml5InputTest.

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

Re: Html5 inputs examples for seaside

Juan-2


On Mon, Nov 4, 2019 at 7:04 PM Philippe Marschall <[hidden email]> wrote:
On Wed, Oct 30, 2019 at 6:25 PM Oswall Verny Arguedas C.
<[hidden email]> wrote:
>
> I would like to know if you have examples of use for html5 inputs in Seaside 3.3.

You can have a look at WAHtml5InputTest.

Cheers
Philippe
_______________________________________________
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

server (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Solved Re: Html5 inputs examples for seaside

OswallVernyAC
Solved,

Thank you all for the directions.
The problem was with the syntax.
Here taking experience.

Oswall


El lun., 4 de nov. de 2019 a la(s) 17:03, Juan ([hidden email]) escribió:


On Mon, Nov 4, 2019 at 7:04 PM Philippe Marschall <[hidden email]> wrote:
On Wed, Oct 30, 2019 at 6:25 PM Oswall Verny Arguedas C.
<[hidden email]> wrote:
>
> I would like to know if you have examples of use for html5 inputs in Seaside 3.3.

You can have a look at WAHtml5InputTest.

Cheers
Philippe
_______________________________________________
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