Well, you could do it with bind too, or just write your own xml recursion. :)
With chooseTemplate, you (1) need to have a specific location in the xml that 
you're "bind"ing the results of chooseTemplate to, i.e., the BindParam that 
holds the chosen part of the view. (2) The part of the view selected with 
chooseTemplate is "contextless" -- there's no particular place in the view it 
belongs. (3) Whichever template is not being used has to be replaced with 
NodeSeq.Empty.
Now these issues are solved if you put the alternatives inside the node that's 
being used in bind, but what if you accidentally include another xml element 
with the same prefix/label somewhere else?
I'm not saying there isn't a place for chooseTemplate, but for this usage, to 
me it seems much cleaner using an inline switch. For a two-way switch you need 
2 nodes, not 3, and they go in the right place in the view.
If I'm not being clear I'll try to post illustrational examples later.
As to confusing newbies looking through the code, as per David's suggestion it 
will go into a separate object, which I called BindPlus (any other suggestion 
for a name?), which also will have an implicit allowing you to call the bind 
methods on a NodeSeq, allowing one to chain bind calls (useful for multiple 
prefixes & nested binding like binding a name inside a link). The idea is that 
all sorts of binding extras can go there.
I obviously have no problem with Josh using lift-wizard if it's good enough now 
or in two days, as was pretty clear from my original message! But his main 
concern seemed to be switching the view, so I mentioned this option as well.


-------------------------------------
Timothy Perrett<timo...@getintheloop.eu> wrote:


It just seems to me that you can already do what you detailed using  
chooseTemplate? My concern about having multiple ways to do a single  
task IMHO makes it more confusing for n00bs... Much better if there is  
a clear problem:solution relationship :-) we already have  
chooseTemplate right?

About wizard, you are right that is what dpp said - however, it's been  
my experience of dave that if the comunity is discussing soemthing and  
it keeps comming up (like the wizard) then he generally rolls his  
sleeves up and gets the job done somehow!

Cheers, Tim

Sent from my iPhone

On 13 Sep 2009, at 21:35, Naftoli Gugenheim <naftoli...@gmail.com>  
wrote:

>
> What do you mean mixed messages?
> Do you object to committing bindSwitch--after all it's much more  
> general and basic than wizards--or that it's what Josh should use?
> Also, I read that DPP said it would take him 2-3 days once he found  
> 2-3 days free to apply himself to lift-wizard. Did I miss a message  
> where he said that he found the time already?
>
>
> -------------------------------------
> Timothy Perrett<timo...@getintheloop.eu> wrote:
>
>
> Naftoli,
>
> Whilst I commend your idea of bindSwitch, im really not sure that is
> the right way forward and would only confuse people (we dont want
> mixed messages). DPP will in two days or less have the wizard in a
> workable state so i would recommend doing just hanging out until that
> is completed... by the sounds of it that will provide a much better
> solution for Josh.
>
> Cheers, Tim
>
> On 13 Sep 2009, at 20:33, Naftoli Gugenheim wrote:
>
>>
>> I will try, G-d willing, to commit code today that allows you to
>> "bindSwitch" -- that is, you give it a list of nodes, one of which
>> is bound; and the others are replaced with NodeSeq.Empty. I used it
>> in a view that had several parts that depend on the state. E.g., if
>> you have not selected a client you see a search box with a button
>> that either chooses a client if there's 1  result, or taked you to a
>> search page. Once a client is selected, you see the clients info
>> with a hyperlink to edit his info, and a button to unselect the
>> client.
>> So you could also use it for wizards. But there's also lift-wizard,
>> which is a work in progress and may be more than what you need; I
>> haven't looked at it myself. But my understanding is that there are
>> usable pieces, it just needs to be polished and tied together.
>>
>>
>> -------------------------------------
>> Josh Suereth<joshua.suer...@gmail.com> wrote:
>>
>> All,
>>
>> I write to you (unfortunately still) as a lift n00b.  I'm trying to
>> modify a
>> form such that it looks more "wizard" like.  i.e.  I want it to
>> specifically
>> state "You've completed part 1, you're on step 2 of 5", etc.
>>
>> How should I accomplish this in view-first rendering?  Normal MVC,
>> I'd make
>> one controll that redirects you to the appropriate wizard screen
>> depending
>> on what steps have already been accomplished (i.e. the controller
>> figures
>> out which step you're on and sends you to the appropraite view".
>>
>> In Lift, I'm thinking I have a few options:
>>
>> 1) Have my stateful snippet actually return the various pages in
>> code.  I'm
>> not happy with this, as my view would reside in the controller, but
>> I could
>> git'r'done this way.
>>
>> 2) Attempt to learn the lift-wizard library (is this stable/ 
>> released?)
>>
>> 3) Spend more time trying to be inventive.
>>
>>
>> Anyone have any thoughts?
>>
>> - Josh
>>
>>
>>
>>>
>>
>
>
>
>
> >
>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to