Tasks, Components, Magritte and Style

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

Tasks, Components, Magritte and Style

Daniel Lyons
Hi,

I'm extremely new to Seaside, and I'm getting a bit confused at the intersection between these four concepts. All I want is:

1. Consistent style.
2. A Task involving a Magritte-generated component, with the same style.

Unless I'm mistaken, the right way to get consistent style is to implement updateRoot on your component to call addStyle. How does one go about this if the root of your app is a WATask subclass? I think I'm not understanding something fundamental about either nesting components or the relationship between tasks and components, because it seems like you would want to be able to say, this component in the tree is actually the first step in a task. For example, to render a containing component that has within it a login component, but without requiring the user click on "Login" before showing the login form. I can see how to kick off a task in response to an event like clicking.

I apologize for asking such a simple question in such a confounding way, this is just such a radical departure from what I'm used to, I feel like I'm missing something very basic.

Thanks,
 

Daniel Lyons

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

Re: Tasks, Components, Magritte and Style

Daniel Lyons

On Mar 8, 2011, at 11:26 PM, Daniel Lyons wrote:

> Hi,
>
> I'm extremely new to Seaside, and I'm getting a bit confused at the intersection between these four concepts. All I want is:
>
> 1. Consistent style.
> 2. A Task involving a Magritte-generated component, with the same style.
>
> Unless I'm mistaken, the right way to get consistent style is to implement updateRoot on your component to call addStyle. How does one go about this if the root of your app is a WATask subclass? I think I'm not understanding something fundamental about either nesting components or the relationship between tasks and components, because it seems like you would want to be able to say, this component in the tree is actually the first step in a task. For example, to render a containing component that has within it a login component, but without requiring the user click on "Login" before showing the login form. I can see how to kick off a task in response to an event like clicking.

Apparently part of the answer is to add onAnswer: to an embedded component, to catch the answer and return it to a parent component. That solves one operational question, but I'm still unclear about how to do styling properly.


Daniel Lyons

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

Re: Tasks, Components, Magritte and Style

Nick
Hi,

I might be misunderstanding your question, but can't you wrap up your
WATask within a WAComponent? WAWelcome could serve as a template. As
for styles hopefully the book covers it:
http://book.seaside.st/book/in-action/serving-files/css-and-js

Feel free to ask away if I misunderstood.

Nick

On 9 March 2011 06:45, Daniel Lyons <[hidden email]> wrote:

>
> On Mar 8, 2011, at 11:26 PM, Daniel Lyons wrote:
>
>> Hi,
>>
>> I'm extremely new to Seaside, and I'm getting a bit confused at the intersection between these four concepts. All I want is:
>>
>> 1. Consistent style.
>> 2. A Task involving a Magritte-generated component, with the same style.
>>
>> Unless I'm mistaken, the right way to get consistent style is to implement updateRoot on your component to call addStyle. How does one go about this if the root of your app is a WATask subclass? I think I'm not understanding something fundamental about either nesting components or the relationship between tasks and components, because it seems like you would want to be able to say, this component in the tree is actually the first step in a task. For example, to render a containing component that has within it a login component, but without requiring the user click on "Login" before showing the login form. I can see how to kick off a task in response to an event like clicking.
>
> Apparently part of the answer is to add onAnswer: to an embedded component, to catch the answer and return it to a parent component. That solves one operational question, but I'm still unclear about how to do styling properly.
>
> —
> Daniel Lyons
>
> _______________________________________________
> 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: Tasks, Components, Magritte and Style

Daniel Lyons
Nick,

On Mar 9, 2011, at 4:40 AM, Nick Ager wrote:

> I might be misunderstanding your question, but can't you wrap up your
> WATask within a WAComponent?

I'm not quite sure how to do that. I see how to delegate a callback to a task, or embed components within other components. But that may actually be sufficient, or I could do something like look at the session for a logged in user to decide whether to show the logged in view or the login page, I guess.

> WAWelcome could serve as a template.


Thanks! I'm reading the code now. I should have thought to look there first. If I still can't figure it out, hopefully I'll figure out how to word what I'm asking.


Daniel Lyons

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