1779 Posts in 582 Topics by 556 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 393 Views |
-
Rendering a CompositeField in tempate via dataFieldByName()

28 December 2011 at 1:39pm
Hi there, long time lurker first time poster.
Here's my problem in a nutshell http://www.sspaste.com/paste/show/4efa627a0f228
I have put my questions at the bottom of the snippet.I'm a designer by trade, so a simple problem like this is much bigger for me than most of you, I'm sure. Thank you in advance : )
-
Re: Rendering a CompositeField in tempate via dataFieldByName()

28 December 2011 at 5:22pm
Ok bonus question first since that one's easy: $dataFieldByName() still works even though the fields are in a composite field, at least that's what the docs say.
The crux of $fieldByName() (first letter is lower case) is that it's defined on the FieldSet class and not the Form class. Doing something like
<% control Fields %>
$fieldByName(RoomsField)
<% end_control %>Should work. Hope that helps.
-
Re: Rendering a CompositeField in tempate via dataFieldByName()

28 December 2011 at 5:32pm Last edited: 28 December 2011 5:33pm
I tried
<% control Fields %>
$fieldByName(RoomsField)
<% end_control %>before, but that didn't work. Your point about FieldSet/Form classes made me try a couple more things, though.
This is what ended up working:$Fields.fieldByName(RoomsField)
Which is bizzare, since it's the same thing? (or is it?)
I gave up on this not long after I posted this question, but your reply made me revisit this and I'm happy it did. Thank you! Have a good New Years : D -
Re: Rendering a CompositeField in tempate via dataFieldByName()

29 December 2011 at 1:30am
Yes that's really bizzare since they are supposed to be the same thing. I'm glad it worked out!
| 393 Views | ||
|
Page:
1
|
Go to Top |

