fluid-work IRC Logs-2009-12-02
[03:54:57 EST(-0500)] * joan2 (n=jgarci@120.Red-213-96-26.staticIP.rima-tde.net) has joined #fluid-work <boyan1> target: <boyan1> it reads <michelled> model = }
[05:21:42 EST(-0500)] * joan2 (n=jgarci@120.Red-213-96-26.staticIP.rima-tde.net) has joined #fluid-work
[05:58:39 EST(-0500)] * sveto_ (n=sveto@85.187.19.183) has joined #fluid-work
[06:03:14 EST(-0500)] * joan2 (n=jgarci@120.Red-213-96-26.staticIP.rima-tde.net) has joined #fluid-work
[06:33:36 EST(-0500)] * boyan1 (n=boyan@62.44.108.2) has joined #fluid-work
[08:16:18 EST(-0500)] * michelled (n=michelle@142.150.154.193) has joined #fluid-work
[08:21:20 EST(-0500)] <boyan1> michelled: hi
[08:21:32 EST(-0500)] <michelled> hi boyan1
[08:21:57 EST(-0500)] <boyan1> can I use valuebinding on UILink components in the Renderer
[08:22:19 EST(-0500)] <boyan1> I'm trying to bind the img src that is to be rendered to the value from the model
[08:22:39 EST(-0500)] <boyan1> so in the component tree I am trying something like
[08:22:49 EST(-0500)]
[08:22:53 EST(-0500)] <boyan1> will that work?
[08:23:16 EST(-0500)] <boyan1> (another issue is I cannot construct the EL path correctly right now
[08:23:19 EST(-0500)] <boyan1> )
[08:23:23 EST(-0500)] <michelled> I'm actually not sure - I haven't tried with UILing
[08:23:25 EST(-0500)] <michelled> UILink
[08:24:21 EST(-0500)] <michelled> what is the trouble you are having with the EL path?
[08:25:04 EST(-0500)] <boyan1> michelled: well, my model is an array of plain objects, each one holding a target and an image property
[08:25:08 EST(-0500)] <boyan1> like:
[08:25:16 EST(-0500)] * laurel (n=Laurel@142.150.154.178) has joined #fluid-work
[08:25:23 EST(-0500)] <boyan1> [
[08:25:23 EST(-0500)] <boyan1> {
[08:25:23 EST(-0500)] <boyan1> target: null,
[08:25:23 EST(-0500)] <boyan1> image: null
[08:25:23 EST(-0500)] <boyan1> }
[08:25:23 EST(-0500)] <boyan1> ]
[08:25:43 EST(-0500)] <boyan1> and I am doing the valuebinding in a fluid.transform
[08:26:20 EST(-0500)] <boyan1> so I want to get the image value of the corresponding item in the array
[08:26:41 EST(-0500)] <boyan1> something like "that.model[i].image"
[08:27:11 EST(-0500)] <boyan1> I'm not sure if what I want to do is possible at all
[08:28:37 EST(-0500)] <michelled> one second boyan1 - I'm a little distracted
[08:30:17 EST(-0500)] <boyan1> ok
[08:36:36 EST(-0500)] * Justin_o (n=Justin@142.150.154.171) has joined #fluid-work
[08:38:30 EST(-0500)] <michelled> ok, I'm back - just reading your code
[08:39:05 EST(-0500)] <michelled> boyan1: I'm not sure that will work - it depends on when 'i' is evaluated and where it's defined
[08:39:14 EST(-0500)] <michelled> you might always get the last value of 'i'
[08:41:07 EST(-0500)] <boyan1> michelled: I know about this issue with 'i', there's a solution I think, currently I am trying to test with [0] and the path is still incorrect
[08:41:23 EST(-0500)] <boyan1> in other examples I see it is not prefixed with that.model
[08:41:58 EST(-0500)] <michelled> which example in particular?
[08:43:05 EST(-0500)] <boyan1> well, I am looking at RendererTests.js, line 540
[08:43:10 EST(-0500)]
[08:43:18 EST(-0500)] <boyan1> which is similar to what I need I think
[08:44:37 EST(-0500)] <michelled> that does look like what you want
[08:45:16 EST(-0500)] * athena (n=athena@75.58.127.15) has joined #fluid-work
[08:45:20 EST(-0500)] <michelled> right, have you used valuebinding before boyan1?
[08:45:45 EST(-0500)] <michelled> basically, the string you give to the valuebinding is the EL path relative to the model that you will then pass along to the renderer
[08:45:53 EST(-0500)] <boyan1> michelled: no, I haven't
[08:46:03 EST(-0500)] <michelled> so you wouldn't want 'that.model'
[08:46:28 EST(-0500)] <boyan1> ok, I thought so as well
[08:47:12 EST(-0500)] * joan2 (n=jgarci@120.Red-213-96-26.staticIP.rima-tde.net) has joined #fluid-work
[08:48:18 EST(-0500)] <boyan1> I can't think of how to bind in a fluid.transform loop when the model is an array of objects and the EL path should get a single item of the array (the current one) and then the image property of that item
[08:48:50 EST(-0500)] <michelled> I think your model will need to be an object that contains an array
[08:49:13 EST(-0500)]
[08:49:28 EST(-0500)] <boyan1> ok, I will try that
[08:50:29 EST(-0500)] <Justin_o> michelled, boyan1: I think
[08:50:49 EST(-0500)] <Justin_o> that there is away to do it with the array of objects... by using the index in the el path
[08:50:56 EST(-0500)] <Justin_o> i think colin saw something like that...
[08:51:05 EST(-0500)] <Justin_o> so you could have obj.0.key
[08:51:39 EST(-0500)] <Justin_o> but i'm not entirely sure if that fits into your context here
[08:52:45 EST(-0500)] <boyan1> Justin_o: that might work, I will try it
[08:53:00 EST(-0500)] <michelled> Justin_o: that was one of the issues - the other problem is that boyan1's model is simply an array model = [1,2,3]
[08:53:19 EST(-0500)] <michelled> so if he passes that model to the renderer he can't really specify an elpath relative to it
[08:53:23 EST(-0500)] <michelled> [0]
[08:57:36 EST(-0500)] <michelled> boyan1: what are you trying to do with the valuebinding?
[09:00:04 EST(-0500)] <michelled> valuebinding is generally used when you want the renderer to manage changes between the model and the renderered UI
[09:00:17 EST(-0500)] <michelled> I'm wondering if valuebinding is actually what you want
[09:00:36 EST(-0500)] <boyan1> michelled: well I want to bind the model (list of images) to the rendered tree so that when I click on the "Take picture" button, a new image is added to the model and the markup is updated correspondingly
[09:01:06 EST(-0500)] <boyan1> I thought there are two ways to achieve that - with valuebinding and by firing a modelChanged event
[09:01:19 EST(-0500)] <boyan1> and first tried with valuebinding
[09:02:02 EST(-0500)] <boyan1> this will also automatically keep the model in sync if the images are reordered
[09:03:42 EST(-0500)] <michelled> valuebinding isn't going to do the trick as far as adding to the tree goes
[09:04:07 EST(-0500)] <michelled> you will need to use 'rerender'
[09:04:21 EST(-0500)] <michelled> I think you'll need to remake the tree but I could be wrong about that
[09:05:12 EST(-0500)] * anastasiac (n=team@142.150.154.189) has joined #fluid-work
[09:07:36 EST(-0500)] <boyan1> ok, so here's my other idea about all that:
[09:07:36 EST(-0500)] <boyan1> When the "Take picture" button is click, I add the new image to the model and fire a "modelChanged" event
[09:07:36 EST(-0500)] <boyan1> In the listener for it, I re-render the component tree, adding the new image.
[09:07:36 EST(-0500)] <boyan1> I am not sure if this will behave correctly with the image reorderer but I can try
[09:09:31 EST(-0500)] <michelled> that makes sense boyan1. I think in rerendering you will actually have to recreate the reorderer on the page too
[09:11:21 EST(-0500)] <Justin_o> boyan1: I'm wondering if you should even be using the render for this, maybe you should just be using jquery to append the necessary markup
[09:12:30 EST(-0500)] <boyan1> Justin_o, that might be reasonable, I am currently using jquery to change the src attribute of the image in preview
[09:12:47 EST(-0500)] <michelled> boyan1: so use the renderer for the first rendering of the page - so that if someone opens a project where they've already got 200 pages then you aren't trying to manually create that markup
[09:13:51 EST(-0500)] <Justin_o> boyan1: i believe there is a "refresh" function in the reorderer that you will need to call to make the new items reorderable with the rest
[09:17:57 EST(-0500)] <michelled> boyan1, just to clarify something I want to point out that valuebinding wouldn't help with reordering images either. Essentially, the nodes themselves are being moved -their values aren't changing. So that wouldn't be tracked. valuebinding is really useful for things like textfields where a user can change the value of a node in the tree
[09:18:19 EST(-0500)] <michelled> does that make sense?
[09:18:34 EST(-0500)] * clown (n=clown@142.150.154.101) has joined #fluid-work
[09:19:27 EST(-0500)] <boyan1> michelled: yes, I think so
[09:19:52 EST(-0500)] <boyan1> michelled, Justin_o: so, to summarize, I am going to use the renderer when I initialize the component, and initialize the reorderer then
[09:19:52 EST(-0500)] <boyan1> on adding a picture, I use jQuery to insert the necessary markup and refresh() to make the new image reorderable
[09:20:22 EST(-0500)] <michelled> yes
[09:20:45 EST(-0500)] <Justin_o> boyan1: that sounds right
[09:22:03 EST(-0500)] <boyan1> michelled, Justin_o: ok, thanks for your help, I will try to make it work this way.
[09:23:43 EST(-0500)] * fj4000 (n=Jacob@142.150.154.164) has joined #fluid-work
[09:23:54 EST(-0500)] <Justin_o> boyan1: thanks... we are running off to a meeting so we may not be online for a while
[09:29:07 EST(-0500)] * jessm (n=Jess@c-71-232-1-65.hsd1.ma.comcast.net) has joined #fluid-work
[09:31:16 EST(-0500)] * clown (n=clown@user149-220.wireless.utoronto.ca) has joined #fluid-work
[09:33:36 EST(-0500)] * colinclark (n=colin@user146-51.wireless.utoronto.ca) has joined #fluid-work
[09:56:11 EST(-0500)] * michelled (n=michelle@user147-207.wireless.utoronto.ca) has joined #fluid-work
[10:18:25 EST(-0500)] * EricDalquist (n=dalquist@bohemia.doit.wisc.edu) has joined #fluid-work
[10:20:54 EST(-0500)] * justin_o (n=jmo@user147-95.wireless.utoronto.ca) has joined #fluid-work
[10:41:44 EST(-0500)] * justin_o (n=jmo@user147-95.wireless.utoronto.ca) has joined #fluid-work
[10:58:28 EST(-0500)] * colinclark (n=colin@142.150.154.101) has joined #fluid-work
[10:58:53 EST(-0500)] * jhung_ca (n=Jon@H204.C204.cci.switchworks.net) has joined #fluid-work
[10:59:54 EST(-0500)] * fj4000 (n=Jacob@142.150.154.164) has joined #fluid-work
[11:02:18 EST(-0500)] * boyan (n=Administ@84.238.192.26) has joined #fluid-work
[11:03:00 EST(-0500)] * michelled (n=michelle@142.150.154.193) has joined #fluid-work
[11:09:59 EST(-0500)] * yura1 (n=yura@142.150.154.132) has joined #fluid-work
[11:24:48 EST(-0500)] * mackrauss (n=Armin@142.150.154.101) has joined #fluid-work
[11:31:06 EST(-0500)] * clown (n=clown@142.150.154.101) has joined #fluid-work
[11:41:55 EST(-0500)] * colinclark (n=colin@142.150.154.101) has joined #fluid-work
[11:45:14 EST(-0500)] * justin_o (n=jmo@142.150.154.101) has joined #fluid-work
[11:46:03 EST(-0500)] * clown (n=clown@142.150.154.101) has joined #fluid-work
[11:53:10 EST(-0500)] * mackrauss (n=Armin@user149-138.wireless.utoronto.ca) has joined #fluid-work
[12:00:28 EST(-0500)] * colinclark (n=colin@142.150.154.130) has joined #fluid-work
[12:02:07 EST(-0500)] * jessm (n=Jess@c-71-232-1-65.hsd1.ma.comcast.net) has joined #fluid-work
[12:15:00 EST(-0500)] * mackrauss (n=Armin@user149-138.wireless.utoronto.ca) has joined #fluid-work
[13:09:27 EST(-0500)] * colinclark (n=colin@142.150.154.130) has joined #fluid-work
[14:17:57 EST(-0500)] * colinclark (n=colin@142.150.154.130) has joined #fluid-work
[14:19:03 EST(-0500)] * justin_o (n=jmo@142.150.154.101) has joined #fluid-work
[14:24:25 EST(-0500)] * fj4000 (n=Jacob@142.150.154.164) has joined #fluid-work
[14:27:24 EST(-0500)] * jessm (n=Jess@c-71-232-1-65.hsd1.ma.comcast.net) has joined #fluid-work
[14:52:16 EST(-0500)] * colinclark_ (n=colin@142.150.154.101) has joined #fluid-work
[15:01:19 EST(-0500)] * colinclark__ (n=colin@142.150.154.130) has joined #fluid-work
[15:32:02 EST(-0500)] * michelled (n=michelle@142.150.154.193) has joined #fluid-work
[16:15:27 EST(-0500)] * justin_o (n=jmo@142.150.154.101) has joined #fluid-work
[16:22:34 EST(-0500)] * laurel (n=Laurel@142.150.154.178) has left #fluid-work
[17:07:28 EST(-0500)] * anastasiac (n=team@142.150.154.189) has left #fluid-work
[17:21:34 EST(-0500)] * clown (n=clown@142.150.154.101) has left #fluid-work
[19:02:24 EST(-0500)] * colinclark_ (n=colin@142.150.154.101) has joined #fluid-work