<div dir="ltr">The Ur/Web manual section on IDs (<a href="http://www.impredicative.com/ur/manual.pdf">http://www.impredicative.com/ur/manual.pdf</a>, section 8.6.2) specifies that [id] is an abstract type, with the only way to generate them being [fresh : transaction id]. It also makes clear that there's no way to force the ID to be something in particular.<div><br></div><div>The pattern that Logitext uses is to generate a unique ID and both set a node's ID with it and pass it to a JavaScript function via the FFI. This seems like exactly the way to do what you need. For your case, it would look something like this:</div><div><br></div><div>datepicker : transaction xml =</div><div> nid <- fresh;</div><div> return <xml></div><div> <div id={nid}/></div><div> <active code={annotateDatepicker nid; return <xml/>}/></div><div> </xml></div><div><br></div><div>where [annotateDatepicker : id -> transaction unit] is an JavaScript FFI function that takes an ID and calls the function from the JavaScript library using that ID. In this case, that would be</div><div><br></div><div>function annotateDatepicker(nid) {</div><div> $('#' + nid + ' div').datepicker({})</div><div>}</div><div><br></div><div>or something similar (not an expert on this library). It's possible you could put the [annotateDatepicker] call outside the XML right after the [nid <- fresh;], but I don't know if it would work.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 2, 2015 at 2:52 PM, Timothy Beyer <span dir="ltr"><<a href="mailto:beyert@fastmail.net" target="_blank">beyert@fastmail.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">At Sun, 2 Aug 2015 01:06:48 -0300,<br>
<span class="">Stefan Scott Alexander wrote:<br>
> but the compiler gives errors complaining about this id in this tag.<br>
><br>
> This datepicker library uses an id tag in the <div> enclosing the <input> tag. Is there a way<br>
> to set an id tag for a <div> in Ur/Web?<br>
<br>
</span>Yes, it is very common to set an id attribute for a div element, especially<br>
when using jQuery.<br>
<br>
A common AJAX idiom in Javascript is to set id or class attributes for various<br>
elements, then send targeted HTML to those elements at runtime, based on user<br>
input.<br>
<br>
Regards,<br>
Tim<br>
<br>
_______________________________________________<br>
Ur mailing list<br>
<a href="mailto:Ur@impredicative.com">Ur@impredicative.com</a><br>
<a href="http://www.impredicative.com/cgi-bin/mailman/listinfo/ur" rel="noreferrer" target="_blank">http://www.impredicative.com/cgi-bin/mailman/listinfo/ur</a><br>
</blockquote></div><br></div>