Hi Ramon,

Can you please post your code using [link:gist.github.com] - this will preserve the formatting, and I will glady debug it.

Thanks,

Anton

By on 1/31/2011 7:20 AM ()
By on 1/31/2011 9:19 AM ()

Hi Ramon,

Can you try moving getBooksAsLiList and its dependencies to the Client? The HTML constructors such as LI currently are implemented as DOM manipulations and only work on the client.

Let me know if it helps or alternatively post a more self-contained example that I could fix on the GitHub. Thanks!

--A

By on 2/2/2011 1:43 AM ()

Hurray, works (at least partially)!

I understand why you decided on this limitation, though I wonder if it was written somewhere (not saying it wasn't, I might have missed it).

In order to get it work, I removed the RPC attributes and added JS attribute to the functions. But it still didn't work until I moved the functions into the Values module (in the main file). When looking at the generated .js file (WebSharperProject.dll.js) nothing from the Books.fs file was send to the client.

[link:gist.github.com] (both files and the .js output)

Edit: Weird as hell... I compiled again (after renaming "book" to "item" - and it worked).

If we're at it, why doesn't WebSharper agree to compile (sprintf "Something: %d" 4)? It said that sprintf doesn't have the JavaScriptAttribute. Shouldn't the be one of the functions who does work in JS? It is quite useful...

By on 2/2/2011 3:56 AM ()

Hi Ramon,

Sorry for a late reply - we have been busy with the latest beta (Beta 5). I tried your example now and it does indeed work for me too. Maybe there was something with the build scripts not copying the files? I will be keeping an eye on that.

Concerning sprintf, it's useful but not straightforward to implement - we have this feature requested regularly but have not implemented it yet.

Thanks,

Anton

By on 2/7/2011 9:22 AM ()

Don't worry about being late, the Beta 5 is really cool - worth the wait :)

Well, sprintf would be cool - I'll be waiting. I'll try doing something manually (either write a small JS library and a WebSharper stub, or a WebSharper RPC function).

By on 2/7/2011 10:35 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper