How to return input from in external (non-seaside) form to a WAComponent?

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

How to return input from in external (non-seaside) form to a WAComponent?

Chuck Kasmire
I am trying to direct input to a form that is outside
of seaside and then bring that form input back into
the component that 'called' it. In my attempts at
hacking this I have come up with:

someActionMethod
  result := self session redirectTo: 'http://      
localhost:8080/C:/formtest.html').
"this works"

self inform: 'You entered: ', result contents.
"this does not work"

This in fact does bring up my form in the browser. But
the 'inform:' part is never seen.

I defined a subclass of WAEntryPoint and specified its
path as: 'FormInput'
 
In the form I defined its action as:  
action="http://localhost:8080/seaside/FormInput"
method="get"

In the WAEntryPoint subclass I defined:

handleRequest: aRequest

        | response s |
        s := WriteStream on: String new.
        aRequest fields associationsDo: [:assoc | s
nextPutAll: '#', assoc key, '=', assoc value; cr ].
        response := WAResponse document: s contents mimeType:
'text/plain'.
        ^response

'response' is seen in my Browser. What seems to be
missing is some sort of linkage between the session
and the entry point. Such that the Response created in
the entry point is directed back as an 'answer' to the
origional call to the form.

Am I on the right track? Any suggestions?

Thanks,
-Chuck



 
__________________________________________________________________________________________
Check out the New Yahoo! Mail - Fire up a more powerful email and get things done faster.
(http://advision.webevents.yahoo.com/mailbeta)

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

Re: How to return input from in external (non-seaside) form to a WAComponent?

Jason Johnson-3
I'm confused.  If you leave the site, why do you expect them to ever
come back?  Does the site you forward to send them back somehow?  What
you might try to get what you want is an IFrame or something, so that
you aren't leaving your application.

Chuck Kasmire wrote:

> I am trying to direct input to a form that is outside
> of seaside and then bring that form input back into
> the component that 'called' it. In my attempts at
> hacking this I have come up with:
>
> someActionMethod
>   result := self session redirectTo: 'http://      
> localhost:8080/C:/formtest.html').
> "this works"
>
> self inform: 'You entered: ', result contents.
> "this does not work"
>
> This in fact does bring up my form in the browser. But
> the 'inform:' part is never seen.
>
> I defined a subclass of WAEntryPoint and specified its
> path as: 'FormInput'
>  
> In the form I defined its action as:  
> action="http://localhost:8080/seaside/FormInput"
> method="get"
>
> In the WAEntryPoint subclass I defined:
>
> handleRequest: aRequest
>
> | response s |
> s := WriteStream on: String new.
> aRequest fields associationsDo: [:assoc | s
> nextPutAll: '#', assoc key, '=', assoc value; cr ].
> response := WAResponse document: s contents mimeType:
> 'text/plain'.
> ^response
>
> 'response' is seen in my Browser. What seems to be
> missing is some sort of linkage between the session
> and the entry point. Such that the Response created in
> the entry point is directed back as an 'answer' to the
> origional call to the form.
>
> Am I on the right track? Any suggestions?
>
> Thanks,
> -Chuck
>
>
>
>  
> __________________________________________________________________________________________
> Check out the New Yahoo! Mail - Fire up a more powerful email and get things done faster.
> (http://advision.webevents.yahoo.com/mailbeta)
>
> _______________________________________________
> 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: How to return input from in external (non-seaside) form to a WAComponent?

Chuck Kasmire
Thanks. Its a bit of a confusing idea. But this is
what I am trying to do:

I have an application that manages an inventory. It
allows me to open an editor where I can enter a
description for an item along with other information.

The users of this application would like to be able to
have a variety of editors based on the type of item it
is. For example: if the item is a truck then it would
have fields appropriate for a truck (engine size, type
of fuel, turbo, whatever). If it is a pallet of bricks
then my 'generic' editor will do just fine.

If I can get someone else to create forms to capture
the data as they want( in Nvu, etc), then I just have
to collect that data when the form is submitted and
enter it into my description.

I actually don't want to leave the site. I just
couldn't see how i could 'insert' the form (in html)
inside of a Seaside component. That would certainly be
preferable.

Does IFrame support this? I am not sure what the
function of IFrame is.

-Chuck

--- Jason Johnson <[hidden email]> wrote:

> I'm confused.  If you leave the site, why do you
> expect them to ever
> come back?  Does the site you forward to send them
> back somehow?  What
> you might try to get what you want is an IFrame or
> something, so that
> you aren't leaving your application.
>
> Chuck Kasmire wrote:
> > I am trying to direct input to a form that is
> outside
> > of seaside and then bring that form input back
> into
> > the component that 'called' it. In my attempts at
> > hacking this I have come up with:
> >
> > someActionMethod
> >   result := self session redirectTo: 'http://    
>  
> > localhost:8080/C:/formtest.html').
> > "this works"
> >
> > self inform: 'You entered: ', result contents.
> > "this does not work"
> >
> > This in fact does bring up my form in the browser.
> But
> > the 'inform:' part is never seen.
> >
> > I defined a subclass of WAEntryPoint and specified
> its
> > path as: 'FormInput'
> >  
> > In the form I defined its action as:  
> > action="http://localhost:8080/seaside/FormInput"
> > method="get"
> >
> > In the WAEntryPoint subclass I defined:
> >
> > handleRequest: aRequest
> >
> > | response s |
> > s := WriteStream on: String new.
> > aRequest fields associationsDo: [:assoc | s
> > nextPutAll: '#', assoc key, '=', assoc value; cr
> ].
> > response := WAResponse document: s contents
> mimeType:
> > 'text/plain'.
> > ^response
> >
> > 'response' is seen in my Browser. What seems to be
> > missing is some sort of linkage between the
> session
> > and the entry point. Such that the Response
> created in
> > the entry point is directed back as an 'answer' to
> the
> > origional call to the form.
> >
> > Am I on the right track? Any suggestions?
> >
> > Thanks,
> > -Chuck
> >
> >
> >
> >  
> >
>
__________________________________________________________________________________________
> > Check out the New Yahoo! Mail - Fire up a more
> powerful email and get things done faster.
> > (http://advision.webevents.yahoo.com/mailbeta)
> >
> > _______________________________________________
> > 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
>



 
____________________________________________________________________________________
Low, Low, Low Rates! Check out Yahoo! Messenger's cheap PC-to-Phone call rates
(http://voice.yahoo.com)

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

Re: How to return input from in external (non-seaside) form to a WAComponent?

Jason Johnson-3
Chuck Kasmire wrote:

> Thanks. Its a bit of a confusing idea. But this is
> what I am trying to do:
>
> I have an application that manages an inventory. It
> allows me to open an editor where I can enter a
> description for an item along with other information.
>
> The users of this application would like to be able to
> have a variety of editors based on the type of item it
> is. For example: if the item is a truck then it would
> have fields appropriate for a truck (engine size, type
> of fuel, turbo, whatever). If it is a pallet of bricks
> then my 'generic' editor will do just fine.
>
> If I can get someone else to create forms to capture
> the data as they want( in Nvu, etc), then I just have
> to collect that data when the form is submitted and
> enter it into my description.
>
> I actually don't want to leave the site. I just
> couldn't see how i could 'insert' the form (in html)
> inside of a Seaside component. That would certainly be
> preferable.
>
> Does IFrame support this? I am not sure what the
> function of IFrame is.
>
> -Chuck
>
>  

An IFrame is a seaside aware html frame.  So you can point to other
sites inside one but still be in your site.  But it sounds like what you
actually would want here would be Magritte.  With that system you make
the model of your data, Truck in your example, and then some description
of what the parts mean and then it will display in the browser in a way
that lets someone create instances from that.

Hope this helps,
Jason

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

Re: How to return input from in external (non-seaside) form to a WAComponent?

cbeler
In reply to this post by Chuck Kasmire
I'm not sure I understand well...

but it seems you're mixing things...

If it's simple form, it's probably better and simpler to do them
directly in seaside (or Magritte). Then instead of asking your users to
build a form with Nvu, you make a seaside component that generates the
appropriate form from descriptions (and Magritte already provide
something like that - descriptions are described themselves).
I suggest you to do the tutorial (exercices) to get used to Magritte and
especially the part 5 (http://www.lukas-renggli.ch/smalltalk/magritte)

But if you have already a site in another language than seaside and you
want to use existing forms, it's possible. I did it once but it's not
nice as I need to to adapt the non-seaside-page to send the session
variables (_s and _k) back in the same time as the form variables. Then
to get all the data you want in seaside, you use  
... (aRenderer context request) at: 'yourFormVar' ifAbsent: []

hope this helps

Cédrick

Chuck Kasmire a écrit :

> Thanks. Its a bit of a confusing idea. But this is
> what I am trying to do:
>
> I have an application that manages an inventory. It
> allows me to open an editor where I can enter a
> description for an item along with other information.
>
> The users of this application would like to be able to
> have a variety of editors based on the type of item it
> is. For example: if the item is a truck then it would
> have fields appropriate for a truck (engine size, type
> of fuel, turbo, whatever). If it is a pallet of bricks
> then my 'generic' editor will do just fine.
>
> If I can get someone else to create forms to capture
> the data as they want( in Nvu, etc), then I just have
> to collect that data when the form is submitted and
> enter it into my description.
>
> I actually don't want to leave the site. I just
> couldn't see how i could 'insert' the form (in html)
> inside of a Seaside component. That would certainly be
> preferable.
>
> Does IFrame support this? I am not sure what the
> function of IFrame is.
>
> -Chuck
>
> --- Jason Johnson <[hidden email]> wrote:
>
>  
>> I'm confused.  If you leave the site, why do you
>> expect them to ever
>> come back?  Does the site you forward to send them
>> back somehow?  What
>> you might try to get what you want is an IFrame or
>> something, so that
>> you aren't leaving your application.
>>
>> Chuck Kasmire wrote:
>>    
>>> I am trying to direct input to a form that is
>>>      
>> outside
>>    
>>> of seaside and then bring that form input back
>>>      
>> into
>>    
>>> the component that 'called' it. In my attempts at
>>> hacking this I have come up with:
>>>
>>> someActionMethod
>>>   result := self session redirectTo: 'http://    
>>>      
>>  
>>    
>>> localhost:8080/C:/formtest.html').
>>> "this works"
>>>
>>> self inform: 'You entered: ', result contents.
>>> "this does not work"
>>>
>>> This in fact does bring up my form in the browser.
>>>      
>> But
>>    
>>> the 'inform:' part is never seen.
>>>
>>> I defined a subclass of WAEntryPoint and specified
>>>      
>> its
>>    
>>> path as: 'FormInput'
>>>  
>>> In the form I defined its action as:  
>>> action="http://localhost:8080/seaside/FormInput"
>>> method="get"
>>>
>>> In the WAEntryPoint subclass I defined:
>>>
>>> handleRequest: aRequest
>>>
>>> | response s |
>>> s := WriteStream on: String new.
>>> aRequest fields associationsDo: [:assoc | s
>>> nextPutAll: '#', assoc key, '=', assoc value; cr
>>>      
>> ].
>>    
>>> response := WAResponse document: s contents
>>>      
>> mimeType:
>>    
>>> 'text/plain'.
>>> ^response
>>>
>>> 'response' is seen in my Browser. What seems to be
>>> missing is some sort of linkage between the
>>>      
>> session
>>    
>>> and the entry point. Such that the Response
>>>      
>> created in
>>    
>>> the entry point is directed back as an 'answer' to
>>>      
>> the
>>    
>>> origional call to the form.
>>>
>>> Am I on the right track? Any suggestions?
>>>
>>> Thanks,
>>> -Chuck
>>>
>>>
>>>
>>>  
>>>
>>>      
> __________________________________________________________________________________________
>  
>>> Check out the New Yahoo! Mail - Fire up a more
>>>      
>> powerful email and get things done faster.
>>    
>>> (http://advision.webevents.yahoo.com/mailbeta)
>>>
>>> _______________________________________________
>>> 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
>  
>
>
>
>  
> ____________________________________________________________________________________
> Low, Low, Low Rates! Check out Yahoo! Messenger's cheap PC-to-Phone call rates
> (http://voice.yahoo.com)
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>  

--

*/Cédrick/**/ Béler/*

*/DOCTORANT/*

* *

*L*aboratoire *G*énie de *P*roduction - Equipe Production Automatisée

Ecole Nationale d'Ingénieurs de Tarbes - http://www.enit.fr 
<http://www.enit.fr/>

 

47, Avenue d'Azereix - BP 1629

F-65016 TARBES Cedex - FRANCE

 

_Phone:_      (+33) (0)5 62 44 27 00 (poste 28 37)

_Fax:_        (+33) (0)5 62 44 27 08

_Mobile:_     (+33) (0)6 81 33 02 04

 

E-mail: [hidden email] <mailto:[hidden email]>

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

Re: How to return input from in external (non-seaside) form to a WAComponent?

Chuck Kasmire
Thank you. It looks like Magritte offers the best and
cleanest solution for what I am trying to do.

-Chuck

--- Cédrick Béler <[hidden email]> wrote:

> I'm not sure I understand well...
>
> but it seems you're mixing things...
>
> If it's simple form, it's probably better and
> simpler to do them
> directly in seaside (or Magritte). Then instead of
> asking your users to
> build a form with Nvu, you make a seaside component
> that generates the
> appropriate form from descriptions (and Magritte
> already provide
> something like that - descriptions are described
> themselves).
> I suggest you to do the tutorial (exercices) to get
> used to Magritte and
> especially the part 5
> (http://www.lukas-renggli.ch/smalltalk/magritte)
>
> But if you have already a site in another language
> than seaside and you
> want to use existing forms, it's possible. I did it
> once but it's not
> nice as I need to to adapt the non-seaside-page to
> send the session
> variables (_s and _k) back in the same time as the
> form variables. Then
> to get all the data you want in seaside, you use  
> ... (aRenderer context request) at: 'yourFormVar'
> ifAbsent: []
>
> hope this helps
>
> Cédrick
>
> Chuck Kasmire a écrit :
> > Thanks. Its a bit of a confusing idea. But this is
> > what I am trying to do:
> >
> > I have an application that manages an inventory.
> It
> > allows me to open an editor where I can enter a
> > description for an item along with other
> information.
> >
> > The users of this application would like to be
> able to
> > have a variety of editors based on the type of
> item it
> > is. For example: if the item is a truck then it
> would
> > have fields appropriate for a truck (engine size,
> type
> > of fuel, turbo, whatever). If it is a pallet of
> bricks
> > then my 'generic' editor will do just fine.
> >
> > If I can get someone else to create forms to
> capture
> > the data as they want( in Nvu, etc), then I just
> have
> > to collect that data when the form is submitted
> and
> > enter it into my description.
> >
> > I actually don't want to leave the site. I just
> > couldn't see how i could 'insert' the form (in
> html)
> > inside of a Seaside component. That would
> certainly be
> > preferable.
> >
> > Does IFrame support this? I am not sure what the
> > function of IFrame is.
> >
> > -Chuck
> >
> > --- Jason Johnson <[hidden email]> wrote:
> >
> >  
> >> I'm confused.  If you leave the site, why do you
> >> expect them to ever
> >> come back?  Does the site you forward to send
> them
> >> back somehow?  What
> >> you might try to get what you want is an IFrame
> or
> >> something, so that
> >> you aren't leaving your application.
> >>
> >> Chuck Kasmire wrote:
> >>    
> >>> I am trying to direct input to a form that is
> >>>      
> >> outside
> >>    
> >>> of seaside and then bring that form input back
> >>>      
> >> into
> >>    
> >>> the component that 'called' it. In my attempts
> at
> >>> hacking this I have come up with:
> >>>
> >>> someActionMethod
> >>>   result := self session redirectTo: 'http://  
>  
> >>>      
> >>  
> >>    
> >>> localhost:8080/C:/formtest.html').
> >>> "this works"
> >>>
> >>> self inform: 'You entered: ', result contents.
> >>> "this does not work"
> >>>
> >>> This in fact does bring up my form in the
> browser.
> >>>      
> >> But
> >>    
> >>> the 'inform:' part is never seen.
> >>>
> >>> I defined a subclass of WAEntryPoint and
> specified
> >>>      
> >> its
> >>    
> >>> path as: 'FormInput'
> >>>  
> >>> In the form I defined its action as:  
> >>> action="http://localhost:8080/seaside/FormInput"
> >>> method="get"
> >>>
> >>> In the WAEntryPoint subclass I defined:
> >>>
> >>> handleRequest: aRequest
> >>>
> >>> | response s |
> >>> s := WriteStream on: String new.
> >>> aRequest fields associationsDo: [:assoc | s
> >>> nextPutAll: '#', assoc key, '=', assoc value; cr
> >>>      
> >> ].
> >>    
> >>> response := WAResponse document: s contents
> >>>      
> >> mimeType:
> >>    
> >>> 'text/plain'.
> >>> ^response
> >>>
> >>> 'response' is seen in my Browser. What seems to
> be
> >>> missing is some sort of linkage between the
> >>>      
> >> session
> >>    
> >>> and the entry point. Such that the Response
> >>>      
> >> created in
> >>    
> >>> the entry point is directed back as an 'answer'
> to
> >>>      
> >> the
> >>    
> >>> origional call to the form.
> >>>
> >>> Am I on the right track? Any suggestions?
> >>>
> >>> Thanks,
> >>> -Chuck
> >>>
> >>>
> >>>
> >>>  
> >>>
> >>>      
> >
>
__________________________________________________________________________________________

> >  
> >>> Check out the New Yahoo! Mail - Fire up a more
> >>>      
> >> powerful email and get things done faster.
> >>    
> >>> (http://advision.webevents.yahoo.com/mailbeta)
> >>>
> >>> _______________________________________________
> >>> Seaside mailing list
> >>> [hidden email]
> >>>
> >>>      
> >
>
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >  
> >>>  
> >>>      
> >> _______________________________________________
> >> Seaside mailing list
> >> [hidden email]
>
=== message truncated ===




 
____________________________________________________________________________________
Sponsored Link

For just $24.99/mo., Vonage offers unlimited local and long- distance calling.
Sign up now. http://www.vonage.com/startsavingnow/
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside