Using SUInPlaceEditor in a different way

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

Using SUInPlaceEditor in a different way

Rajeev Lochan
Dear Seasiders,
I have been bit by Seaside Bug and have been trying my hands on it. I am quite a newbie and have got an interesting question to ask. I have been trying to make a simple web application which has to do the following thing.

The page should have a Button/Anchor for Creating a List of Contents. On clicking that, he should be rendered with a SUInPlaceEditor in the same page. Once he enters the details and press OK, it should show the entered content. If he wants to edit it, he can either click and edit. By clicking the button again, another SUInPlaceEditor should render itself just beneath the previous one and so on.

I tried on the lines of MyAddressBook example (http://objectcentric.wordpress.com/2007/01/17/scriptacu-list-tutorialpart-1/ ) to have 2 pages, one page lists all the items and another page where you get SUInPlaceEditor to enter the details. Unlike in a normal textInput field, where upon saving, the repository updates itself, I am not able to achieve the same with my application. Am I missing something ?

In the example of scriptaculous, the text (inst variable) of SUInPlaceEditorTest is initialized to 'Click and Edit me". I believe, to have persistence, we need to go for Class Instance Variables, how do we do this.

It would be great to discus further with you all. Is there any tutorial specific for Scriptaculous ?

Anticipating for your help,
Rajeev

--
Rajeev Lochan

Co-founder, AR-CAD.com

http://www.ar-cad.com
+91 9212090622 (Gurgaon)
080 65355873 (Bangalore)
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Using SUInPlaceEditor in a different way

Lukas Renggli
> In the example of scriptaculous, the text (inst variable) of
> SUInPlaceEditorTest is initialized to 'Click and Edit me". I believe, to
> have persistence, we need to go for Class Instance Variables, how do we do
> this.

I don't quite understand what you are trying to do. To change the text
you have 'Click and Edit me" the option #clickToEditText:.

> It would be great to discus further with you all. Is there any tutorial
> specific for Scriptaculous ?

Except for the shipped functional test cases and some blog posts,
there are none. However it should be fairly easy to follow any
script.aculo.us or prototypes tutorial.

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: Using SUInPlaceEditor in a different way

Rajeev Lochan
Sorry Lukas for making it so complicated. In simpler terms, I shall put it in this way.
There is a page (SomeComponentView) which renders us a Heading and a SUInPlaceEditor form/field

Upon entering say Item 1, I press OK button . Now I want this detail to be saved somewhere in persistence. In the present example (SUInPlaceEditorTest), upon clicking NewSession in the ToolBar, the content is reset to Clickme&EditMe...

After saving the content in some variable or it should render a button on the next line to the entered Item 1. By pressing the Button, another SUInPlaceEditor form/field should be rendered. The user can again enter something say Item 2 and presses OK. Similarly, he can create a list of as many items as he wants and finally save the whole list of items.

I hope it is clear now. If any clarifications, please let me know.

Regards,
Rajeev


On 5/21/07, Lukas Renggli <[hidden email]> wrote:
> In the example of scriptaculous, the text (inst variable) of
> SUInPlaceEditorTest is initialized to 'Click and Edit me". I believe, to
> have persistence, we need to go for Class Instance Variables, how do we do
> this.

I don't quite understand what you are trying to do. To change the text
you have 'Click and Edit me" the option #clickToEditText:.

> It would be great to discus further with you all. Is there any tutorial
> specific for Scriptaculous ?

Except for the shipped functional test cases and some blog posts,
there are none. However it should be fairly easy to follow any
script.aculo.us or prototypes tutorial.

Lukas

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



--
Rajeev Lochan

Co-founder, AR-CAD.com

http://www.ar-cad.com
+91 9212090622 (Gurgaon)
080 65355873 (Bangalore)
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Using SUInPlaceEditor in a different way

Lukas Renggli
> Upon entering say Item 1, I press OK button . Now I want this detail to be
> saved somewhere in persistence. In the present example
> (SUInPlaceEditorTest), upon clicking NewSession in the ToolBar, the content
> is reset to Clickme&EditMe...

Allright, now I understand. So this is rather a persistency problem
than an AJAX (or SUInPlaceEditorTest) one. Most productive
applications would probably use a database for that, but in your case
this is probably overkill.

I updated the material for my tutorials:

      http://www.lukas-renggli.ch/smalltalk/seaside

In your case the code for 'The Art of Seaside' would be interesting,
where I also store the model on the class-side of some class.

Hope this helps.

Cheers,
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: Using SUInPlaceEditor in a different way

Rajeev Lochan
Thanks a lot Lukas, The tutorial is indeed one of the best I have come across. I downloaded the code and loaded it. I then completed the codes from the notes of yours, which as been explained splendidly. I have a question.

Do we have to use
ToDoListView>>rendererClass
^ WARenderCanvas

What purpose does this serve?

After Completing the code, I ran into the following error message upon pressing Add New
Button and then Saving a New Item. Am I missing something ?

Error: Components not found while processing callbacks: an Array(a ToDoItemView)

  • WARender(Object)>>error:
    selfa WARender
    temps
    aString'Components not found while processing callbacks: an Array(a ToDoItemView)'
    inst vars
    roota WAToolFrame
    contexta WARenderingContext
    requesta WARequest
    urla WAUrl
  • WARender>>unprocessedCallbacks:
    selfa WARender
    temps
    aCollection an Array(a WAValueCallback a WADispatchCallback a WAValueCallback a WAValueCallback a WAValueCallbac...etc...
    ownersan Array(a ToDoItemView)
    eaa WAActionCallback
    inst vars
    roota WAToolFrame
    contexta WARenderingContext
    requesta WARequest
    url a WAUrl
  • WARender>>processCallbacks
    selfa WARender
    temps
    lastPosition 0
    callbackStreama WACallbackStream
    eaa WAToolFrame
    inst vars
    roota WAToolFrame
    contexta WARenderingContext
    requesta WARequest
    urla WAUrl
  • WARender>>render
    selfa WARender
    temps
    unil
    inst vars
    roota WAToolFrame
    contexta WARenderingContext
    requesta WARequest
    urla WAUrl
  • [] in WARender>>go {[self render]}
    selfa WARender
    temps
    inst vars
    roota WAToolFrame
    context a WARenderingContext
    requesta WARequest
    urla WAUrl


I am going through your Web 2.0 Tutorial as well. Shall get back to you when done.

Thanks again for your timely help. I would love to see more tutorials from your side.

Regards,
Rajeev




On 5/21/07, Lukas Renggli <[hidden email]> wrote:
> Upon entering say Item 1, I press OK button . Now I want this detail to be
> saved somewhere in persistence. In the present example
> (SUInPlaceEditorTest), upon clicking NewSession in the ToolBar, the content
> is reset to Clickme&EditMe...

Allright, now I understand. So this is rather a persistency problem
than an AJAX (or SUInPlaceEditorTest) one. Most productive
applications would probably use a database for that, but in your case
this is probably overkill.

I updated the material for my tutorials:

      http://www.lukas-renggli.ch/smalltalk/seaside

In your case the code for 'The Art of Seaside' would be interesting,
where I also store the model on the class-side of some class.

Hope this helps.

Cheers,
Lukas

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



--
Rajeev Lochan

Co-founder, AR-CAD.com

http://www.ar-cad.com
+91 9212090622 (Gurgaon)
080 65355873 (Bangalore)
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Using SUInPlaceEditor in a different way

Lukas Renggli
> Thanks a lot Lukas, The tutorial is indeed one of the best I have come
> across. I downloaded the code and loaded it. I then completed the codes from
> the notes of yours, which as been explained splendidly. I have a question.

Thanks for the feedback. The notes are not really complete, as these
was just what I needed during the presentation last ESUG.

> Do we have to use
> ToDoListView>>rendererClass
>  ^ WARenderCanvas

Not anymore in Seaside 2.7 and 2.8.

> What purpose does this serve?

Change the rendering class, the class of the object passed into
#renderContentOn:. It doesn't server an important purpose in current
versions of Seaside, since now there is only WARenderCanvas.

> After Completing the code, I ran into the following error message upon
> pressing Add New Button and then Saving a New Item. Am I missing
> something ?
>
> Error: Components not found while processing callbacks: an Array(a
> ToDoItemView)
> WARender(Object)>>error:

There is this line missing in my notes (I updated the notes):

- ToDoListView>>children
        ^ Array with: editor

> Thanks again for your timely help. I would love to see more tutorials from
> your side.

Creating new tutorials is so much of work ... unfortunately :-(

Lukas

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