Lifted,

It appears that the interface for binding a namespace is side-effecting.
That's fine. But, i can't seem to understand the semantics. For example,

   - if one puts a call to bind at the beginning of a block for a method
   that handles a post, and yet returns a different nodeseq, the desired effect
   is not present.
   - If one nests the bind call inside the construction of a nodeseq, the
   effect is not present.
   - On the other hand, if one puts a call to bind on a completely different
   form, the desired effect is present in the post handler.

i find that a little confusing. Is there a clean, simple model that will
help me understand how to use bind?

Best wishes,

--greg

On Wed, Apr 29, 2009 at 11:17 AM, Meredith Gregory <lgreg.mered...@gmail.com
> wrote:

> David,
>
> Thanks for the suggestion, but no joy. The error is the same. BTW, the only
> difference i could spot between your proposal and mine was changing the
> "-->" to "->".
>
> Best wishes,
>
> --greg
>
> XML Parsing Error: prefix not bound to a namespace
> Location: http://localhost:8080/AJAXREPLForm
> Line Number 78, Column 58:        <label for="initTimeField">Initial time
> :</label><hello:initTimeField></hello:initTimeField>
> ---------------------------------------------------------^
>
> On Wed, Apr 29, 2009 at 11:00 AM, David Pollak <
> feeder.of.the.be...@gmail.com> wrote:
>
>> Try:
>>
>>   def show(xhtml: NodeSeq): NodeSeq = {
>>     <xml:group>{
>>       bind( "hello", xhtml,
>>        "initialTimeField" -> text("Nil", (updateInitialTime _)) % ("size"
>> -> "60") % ("id" -> "initialTimeField"),
>>        "finalTimeField" -> text("Nil", (updateFinalTime _)) % ("size" ->
>> "60") % ("id" -> "finalTimeField"),
>>        "submit" -> <button type="button">{?("Go")}</button> % ("onclick"
>> -> ajaxCall(JsRaw("$('#initialTimeField').attr('value')"), s =>
>> updateInitialTime(s)))
>>        )
>>     }
>>       <br/>
>>       <div id="resultChart">{whatNode(evalStr())}</div>
>>     </xml:group>
>>   }
>> }
>>
>>
>> On Wed, Apr 29, 2009 at 10:51 AM, Meredith Gregory <
>> lgreg.mered...@gmail.com> wrote:
>>
>>> Lifted,
>>>
>>> i'm getting the following error. i've run into this before and resolved
>>> it, but i can't for the life of me remember what i did. All my other lift
>>> sites are constructed pretty much isomorphic to this one. Any help would be
>>> greatly appreciated.
>>>
>>> Best wishes,
>>>
>>> --greg
>>>
>>> XML Parsing Error: prefix not bound to a namespace
>>> Location: http://localhost:8080/AJAXREPLForm
>>> Line Number 78, Column 58:        <label for="initTimeField">Initial time
>>> :</label><hello:initTimeField></hello:initTimeField>
>>> ---------------------------------------------------------^
>>>
>>> <lift:surround with="default" at="content">
>>>     <h1>R-E-P-L</h1>
>>>     <lift:REPLForm.show form="POST">
>>>         <label for="initTimeField">Initial time
>>> :</label><hello:initTimeField/>
>>>         <label for="finalTimeField">Final time
>>> :</label><hello:finalTimeField/>
>>>     <hello:submit/><br/>
>>>         Result: <hello:resultChart/>
>>>     </lift:REPLForm.show>
>>> </lift:surround>
>>>
>>> class REPLForm {
>>>  // ...
>>>
>>> // close to what i usually do
>>> //   def show(xhtml: NodeSeq): NodeSeq = {
>>> //     <xml:group>
>>> //       <label for="initialTimeField">Inital time :</label>
>>> //       { text("Nil", (updateInitialTime _)) % ("size" -> "60") % ("id"
>>> -> "initialTimeField") }
>>> //       <label for="finalTimeField">Final time :</label>
>>> //       { text("Nil", (updateFinalTime _)) % ("size" -> "60") % ("id" ->
>>> "finalTimeField") }
>>> //       { <button type="button">{?("Go")}</button> %
>>> //        ("onclick" ->
>>> ajaxCall(JsRaw("$('#initialTimeField').attr('value')"), s =>
>>> updateInitialTime(s))) }
>>> //       <br/>
>>> //       <div id="resultChart">{whatNode(evalStr())}</div>
>>> //     </xml:group>
>>> //   }
>>>
>>> // attempt to resolve the problem by putting in a call to bind
>>>   def show(xhtml: NodeSeq): NodeSeq = {
>>>     <xml:group>{
>>>       bind( "hello", xhtml,
>>>        "initialTimeField" --> text("Nil", (updateInitialTime _)) %
>>> ("size" -> "60") % ("id" -> "initialTimeField"),
>>>        "finalTimeField" --> text("Nil", (updateFinalTime _)) % ("size" ->
>>> "60") % ("id" -> "finalTimeField"),
>>>        "submit" --> <button type="button">{?("Go")}</button> % ("onclick"
>>> -> ajaxCall(JsRaw("$('#initialTimeField').attr('value')"), s =>
>>> updateInitialTime(s)))
>>>       )
>>>     }
>>>       <br/>
>>>       <div id="resultChart">{whatNode(evalStr())}</div>
>>>     </xml:group>
>>>   }
>>> }
>>>
>>> --
>>> L.G. Meredith
>>> Managing Partner
>>> Biosimilarity LLC
>>> 1219 NW 83rd St
>>> Seattle, WA 98117
>>>
>>> +1 206.650.3740
>>>
>>> http://biosimilarity.blogspot.com
>>>
>>>
>>>
>>
>>
>> --
>> Lift, the simply functional web framework http://liftweb.net
>> Beginning Scala http://www.apress.com/book/view/1430219890
>> Follow me: http://twitter.com/dpp
>> Git some: http://github.com/dpp
>>
>> >>
>>
>
>
> --
> L.G. Meredith
> Managing Partner
> Biosimilarity LLC
> 1219 NW 83rd St
> Seattle, WA 98117
>
> +1 206.650.3740
>
> http://biosimilarity.blogspot.com
>



-- 
L.G. Meredith
Managing Partner
Biosimilarity LLC
1219 NW 83rd St
Seattle, WA 98117

+1 206.650.3740

http://biosimilarity.blogspot.com

--~--~---------~--~----~------------~-------~--~----~
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