Thanks for that amazingly quick response!

I only wish I understood the proposed solution! :-)

So (confession time) I simplified things a little, the actual
JavaScript is…

var theDialog = $(…).dialog( { autoOpen: true, width: 500, modal:
true, close: function() { theDialog.destroy; }; } )

How do I assemble this, or is there any documentation / examples you
can point me to.

Thanks very much,

Stuart.

On Mar 9, 5:14 pm, Ross Mellgren <dri...@gmail.com> wrote:
> Whoops, I meant Str(fixHtml(...)) not JsStr(fixHtml(...))
>
> -Ross
>
> On Mar 9, 2010, at 12:14 PM, Ross Mellgren wrote:
>
>
>
> > Try this (I haven't tested it, so there could be lurking bugs):
>
> > case class JQueryNodeSeq(ns: NodeSeq) extends JsExp with JQueryLeft with 
> > HtmlFixer {
> >    override def toJsCmd = "jQuery(" + JsStr(fixHtml("NodeSeqDialog", 
> > ns)).toJsCmd + ")"
> > }
>
> > Then JQueryNodeSeq(ns) ~> JsFunc("dialog")
>
> > -Ross
>
> > On Mar 9, 2010, at 12:06 PM, Stuart Roebuck wrote:
>
> >> I'm trying to produce a web page with editable content.
>
> >> When the user clicks an edit button on a line it uses jQuery to
> >> display a modal dialog which allows fields of that line to be edited.
>
> >> I can easily produce a snippet to produce the lines using the backend
> >> data and an XHTML template and binding etc.
>
> >> However, I also want the template to include the template for the
> >> dialog.  So I want the ajax button callback to send JavaScript to
> >> instantiate the jQuery UI dialog based on the template and bindings.
>
> >> To build this I need to assemble a JsCmd containing the NodeSeq that
> >> comes from the XHTML sequence and the bindings.
>
> >> In short, if this was straight jQuery I would have some JavaScript of
> >> the form:
>
> >> $(<div title="Dialog Title">theFormNodeSeq</div>).dialog()
>
> >> But in my case theFormNodeSeq comes from a NodeSeq that was assembled
> >> from part of the XHTML template and the bindings and the end result
> >> needs to be a JsCmd.
>
> >> So I'm trying to do something like:
>
> >> JsCmds.Run("$(" + theFormNodeSeq.toString + ").dialog()")
>
> >> But I need to address escaping issues with the HTML and I also need to
> >> pre-process any "<lift:… />" commands in theFormNodeSeq.
>
> >> Any advice (please)?
>
> >> --
> >> You received this message because you are subscribed to the Google Groups 
> >> "Lift" group.
> >> To post to this group, send email to lift...@googlegroups.com.
> >> To unsubscribe from this group, send email to 
> >> liftweb+unsubscr...@googlegroups.com.
> >> For more options, visit this group 
> >> athttp://groups.google.com/group/liftweb?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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