Hi all.

I have essentially the following setup in a website:

class AjaxTest {
   def render =
      <div>
         <div id="foo">foo</div>
         {getAjaxForm}
      </div>

   def getAjaxForm = SHtml.ajaxForm(
         SHtml.submit("submit", () => ()),
         Run(customJSStr))

   def customJSStr = "document.getElementById('foo').innerHTML = '" +
aStr + "';"

   val aStr = SHtml.a(() => SetHtml("foo", Text("baz")), Text
("bar")).toString
}



when aStr is displayed (with text 'bar'), the link is inactive.


I'm using Run(customJSStr) instead of SetHtml as, in the actual app,
the situation is slightly more complicated (and the RHS of the
assignment operator in the javascript expression has some more stuff
fetched from the document).

Note also that if the ajaxForm uses SetHtml() instead of Run() it
works as expected.

So the question is -- is there a straightforward explanation for
what's going on here (I'm still kinda cargo-culting lift).

And, unconditional upon the answer to the last question, is there a
way to make aStr a valid, active link (or, I guess, string
representing one) while retaining the ability to have an arbitrarily
complex javascript expression in customJSStr (this would actually be
defined in a separate js file, of course).


Thanks much,
KP

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