You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vinicius Carvalho <ja...@gmail.com> on 2005/06/20 03:56:30 UTC

Property binding question

Hello there! Must I always bind a value from a foreach in a page to a
property on its class?

for example:

<span jwcid="feedLoop@Foreach" source="ognl:category.userFeeds"
value="ognl:userFeed">

My page must have a UserFeed property?

Regards

Vinicius Carvalho

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Property binding question

Posted by Jamie Orchard-Hays <ja...@dang.com>.
You don't need the setter. Just the getter is required (unless you try  
to set the property!).


On Jun 20, 2005, at 11:05 PM, Geoff Longman wrote:

> Is title a true property with getTitle()? I forget if you also need
> setTitle() for it to be a true property..brain fart.
>
> if not you have to do the ognl equivalent of a method invocation
> instead of a property access.
>
> ie. to invoke an arbitrary method use the whole method name in the  
> expression...
>
> ognl::components.feedLoop.value.title()
>
> if the method is title() that is.
>
> Geoff
>
>
>
> On 6/20/05, Vinicius Carvalho <ja...@gmail.com> wrote:
>> Well I tried:
>> ognl:components.feedLoop.value as the value property.
>> So to access a method from it I tried:
>> ognl:components.feedLoop.value.title
>> and I'm getting an error:
>> ognl.NoSuchPropertyException
>> org.apache.tapestry.components.Foreach$Enhance_6.value
>>
>> Any ideas?
>>
>> On 6/20/05, Robert Zeigler <robertz@scazdl.org > wrote:
>>> Like Todd said, you only need the the source. You can always get to  
>>> the
>>> value like:
>>> ognl:components.feedLoop.value
>>>
>>> Robert
>>>
>>> Pablo Ruggia wrote:
>>>>> From what I know, only source is required.
>>>>
>>>> On 6/19/05, Vinicius Carvalho <java.vinicius@gmail.com > wrote:
>>>>
>>>>> Hello there! Must I always bind a value from a foreach in a page  
>>>>> to a
>>>>> property on its class?
>>>>>
>>>>> for example:
>>>>>
>>>>> <span jwcid="feedLoop@Foreach" source="ognl:category.userFeeds"
>>>>> value="ognl:userFeed">
>>>>>
>>>>> My page must have a UserFeed property?
>>>>>
>>>>> Regards
>>>>>
>>>>> Vinicius Carvalho
>>>>>
>>>>> ------------------------------------------------------------------- 
>>>>> --
>>>>> To unsubscribe, e-mail:  
>>>>> tapestry-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail:  
>>>>> tapestry-user-help@jakarta.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:  
>>> tapestry-user-help@jakarta.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Property binding question

Posted by Robert Zeigler <ro...@scazdl.org>.
If it has a getter and no setter, it's considered a read-only property,
and ognl can read this property just fine like any other property.
Not sure if I understood how you did your binding exactly...
It's sounds like you tried setting the value parameter to the value
property... which is sorta circular.
So, if you want to reference the current "value" without explicitly
binding a property to the value, you use the components.feedLoop.value
path. So, something like,
<span jwcid="feedLoop@Foreach" source="ognl:category.userFeeds">
  <span jwcid="@Insert" value="ognl:components.feedLoop.value.title"/>
</span>

This may be what you're doing already, but, it's not clear to me from
what you posted if it is or not.


Robert


Geoff Longman wrote:
> Is title a true property with getTitle()? I forget if you also need
> setTitle() for it to be a true property..brain fart.
> 
> if not you have to do the ognl equivalent of a method invocation
> instead of a property access.
> 
> ie. to invoke an arbitrary method use the whole method name in the expression...
> 
> ognl::components.feedLoop.value.title()
> 
> if the method is title() that is.
> 
> Geoff
> 
> 
> 
> On 6/20/05, Vinicius Carvalho <ja...@gmail.com> wrote:
> 
>>Well I tried:
>>ognl:components.feedLoop.value as the value property.
>>So to access a method from it I tried:
>>ognl:components.feedLoop.value.title
>>and I'm getting an error:
>>ognl.NoSuchPropertyException
>>org.apache.tapestry.components.Foreach$Enhance_6.value
>>
>>Any ideas?
>>
>>On 6/20/05, Robert Zeigler <robertz@scazdl.org > wrote:
>>
>>>Like Todd said, you only need the the source. You can always get to the
>>>value like:
>>>ognl:components.feedLoop.value
>>>
>>>Robert
>>>
>>>Pablo Ruggia wrote:
>>>
>>>>>>From what I know, only source is required.
>>>>
>>>>On 6/19/05, Vinicius Carvalho <java.vinicius@gmail.com > wrote:
>>>>
>>>>
>>>>>Hello there! Must I always bind a value from a foreach in a page to a
>>>>>property on its class?
>>>>>
>>>>>for example:
>>>>>
>>>>><span jwcid="feedLoop@Foreach" source="ognl:category.userFeeds"
>>>>>value="ognl:userFeed">
>>>>>
>>>>>My page must have a UserFeed property?
>>>>>
>>>>>Regards
>>>>>
>>>>>Vinicius Carvalho
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org 
>>>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org 
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org 
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org 
>>>
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org 
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org 
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Property binding question

Posted by Geoff Longman <gl...@gmail.com>.
Is title a true property with getTitle()? I forget if you also need
setTitle() for it to be a true property..brain fart.

if not you have to do the ognl equivalent of a method invocation
instead of a property access.

ie. to invoke an arbitrary method use the whole method name in the expression...

ognl::components.feedLoop.value.title()

if the method is title() that is.

Geoff



On 6/20/05, Vinicius Carvalho <ja...@gmail.com> wrote:
> Well I tried:
> ognl:components.feedLoop.value as the value property.
> So to access a method from it I tried:
> ognl:components.feedLoop.value.title
> and I'm getting an error:
> ognl.NoSuchPropertyException
> org.apache.tapestry.components.Foreach$Enhance_6.value
> 
> Any ideas?
> 
> On 6/20/05, Robert Zeigler <robertz@scazdl.org > wrote:
> > Like Todd said, you only need the the source. You can always get to the
> > value like:
> > ognl:components.feedLoop.value
> >
> > Robert
> >
> > Pablo Ruggia wrote:
> > >>From what I know, only source is required.
> > >
> > > On 6/19/05, Vinicius Carvalho <java.vinicius@gmail.com > wrote:
> > >
> > >>Hello there! Must I always bind a value from a foreach in a page to a
> > >>property on its class?
> > >>
> > >>for example:
> > >>
> > >><span jwcid="feedLoop@Foreach" source="ognl:category.userFeeds"
> > >>value="ognl:userFeed">
> > >>
> > >>My page must have a UserFeed property?
> > >>
> > >>Regards
> > >>
> > >>Vinicius Carvalho
> > >>
> > >>---------------------------------------------------------------------
> > >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org 
> > >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org 
> > >>
> > >>
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org 
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org 
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org 
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org 
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Property binding question

Posted by Vinicius Carvalho <ja...@gmail.com>.
Well I tried:
ognl:components.feedLoop.value as the value property.
So to access a method from it I tried:
ognl:components.feedLoop.value.title
and I'm getting an error: 
ognl.NoSuchPropertyException
org.apache.tapestry.components.Foreach$Enhance_6.value

Any ideas?

On 6/20/05, Robert Zeigler <ro...@scazdl.org> wrote:
> Like Todd said, you only need the the source. You can always get to the
> value like:
> ognl:components.feedLoop.value
> 
> Robert
> 
> Pablo Ruggia wrote:
> >>From what I know, only source is required.
> >
> > On 6/19/05, Vinicius Carvalho <ja...@gmail.com> wrote:
> >
> >>Hello there! Must I always bind a value from a foreach in a page to a
> >>property on its class?
> >>
> >>for example:
> >>
> >><span jwcid="feedLoop@Foreach" source="ognl:category.userFeeds"
> >>value="ognl:userFeed">
> >>
> >>My page must have a UserFeed property?
> >>
> >>Regards
> >>
> >>Vinicius Carvalho
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Property binding question

Posted by Robert Zeigler <ro...@scazdl.org>.
Like Todd said, you only need the the source. You can always get to the
value like:
ognl:components.feedLoop.value

Robert

Pablo Ruggia wrote:
>>>From what I know, only source is required.
> 
> On 6/19/05, Vinicius Carvalho <ja...@gmail.com> wrote: 
> 
>>Hello there! Must I always bind a value from a foreach in a page to a
>>property on its class?
>>
>>for example:
>>
>><span jwcid="feedLoop@Foreach" source="ognl:category.userFeeds"
>>value="ognl:userFeed">
>>
>>My page must have a UserFeed property?
>>
>>Regards
>>
>>Vinicius Carvalho
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Property binding question

Posted by Pablo Ruggia <pr...@gmail.com>.
>From what I know, only source is required.

On 6/19/05, Vinicius Carvalho <ja...@gmail.com> wrote: 
> 
> Hello there! Must I always bind a value from a foreach in a page to a
> property on its class?
> 
> for example:
> 
> <span jwcid="feedLoop@Foreach" source="ognl:category.userFeeds"
> value="ognl:userFeed">
> 
> My page must have a UserFeed property?
> 
> Regards
> 
> Vinicius Carvalho
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>