You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Micha Roon <dr...@gmail.com> on 2006/11/07 13:41:10 UTC
OGNL Notation for accessing List Element
I am trying to get at a specific element in a list that is return by a GET
method in my page.
I went to the OGNL home page and saw that the notation
session.attribute["foo"] will get the foo element of the attribute list (
http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/indexing.html see
here )
I tried this notation in Tapestry and it told me back that it did not
understand:
Where did I go wrong?
thanks for your help,
Micha
--
View this message in context: http://www.nabble.com/OGNL-Notation-for-accessing-List-Element-tf2588481.html#a7217632
Sent from the Tapestry - User mailing list archive at Nabble.com.
Re: OGNL Notation for accessing List Element
Posted by Micha Roon <dr...@gmail.com>.
Thank you for the tip.
the second version (page.getName('titi') works. I find it odd though that
"official" OGNL notation does not work.
Cheers,
Micha
Bill Holloway wrote:
>
> Use parentheses rather than square brackets:
>
> ognl:getName('titi')
>
> OR (if that doesn't do it),
>
> ognl:page.getName('titi')
>
> Cheers,
> Bill
>
>
> On 11/8/06, Micha Roon <dr...@gmail.com> wrote:
>>
>>
>> I have one page (Home.html) with its Class (Home.java) and in the class I
>> have the two methods
>> public String getName(String which){ return which;}
>> public void setName(String which){return;}
>>
>>
>>
>> In the html I have just one tag for the test: jwcid="@Insert"
>> value="ognl:name['titi']"
>>
>>
>>
>> I have attached the error message that Tapestry gives me
>> http://www.nabble.com/file/4033/errorMessage.htm errorMessage.htm
>>
>>
>>
>> Martin Strand-4 wrote:
>> >
>> > How does the code for that method look? it's supposed to look like
>> this:
>> >
>> > public PropertyType getPropertyName(IndexType index)
>> > public void setPropertyName(IndexType index, PropertyType value)
>> >
>> > On Tue, 07 Nov 2006 13:41:10 +0100, Micha Roon wrote:
>> >
>> >>
>> >> I am trying to get at a specific element in a list that is return by a
>> >> GET
>> >> method in my page.
>> >>
>> >> I went to the OGNL home page and saw that the notation
>> >> session.attribute["foo"] will get the foo element of the attribute
>> list (
>> >>
>> http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/indexing.html
>> >> see
>> >> here )
>> >>
>> >> I tried this notation in Tapestry and it told me back that it did not
>> >> understand:
>> >>
>> >> Where did I go wrong?
>> >>
>> >> thanks for your help,
>> >>
>> >> Micha
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> > For additional commands, e-mail: users-help@tapestry.apache.org
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/OGNL-Notation-for-accessing-List-Element-tf2588481.html#a7234561
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>
>
> --
> "Budgets are moral documents."
>
> -- Ann Richards
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/OGNL-Notation-for-accessing-List-Element-tf2588481.html#a7335452
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: OGNL Notation for accessing List Element
Posted by Bill Holloway <bi...@gmail.com>.
Use parentheses rather than square brackets:
ognl:getName('titi')
OR (if that doesn't do it),
ognl:page.getName('titi')
Cheers,
Bill
On 11/8/06, Micha Roon <dr...@gmail.com> wrote:
>
>
> I have one page (Home.html) with its Class (Home.java) and in the class I
> have the two methods
> public String getName(String which){ return which;}
> public void setName(String which){return;}
>
>
>
> In the html I have just one tag for the test: jwcid="@Insert"
> value="ognl:name['titi']"
>
>
>
> I have attached the error message that Tapestry gives me
> http://www.nabble.com/file/4033/errorMessage.htm errorMessage.htm
>
>
>
> Martin Strand-4 wrote:
> >
> > How does the code for that method look? it's supposed to look like this:
> >
> > public PropertyType getPropertyName(IndexType index)
> > public void setPropertyName(IndexType index, PropertyType value)
> >
> > On Tue, 07 Nov 2006 13:41:10 +0100, Micha Roon wrote:
> >
> >>
> >> I am trying to get at a specific element in a list that is return by a
> >> GET
> >> method in my page.
> >>
> >> I went to the OGNL home page and saw that the notation
> >> session.attribute["foo"] will get the foo element of the attribute list (
> >> http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/indexing.html
> >> see
> >> here )
> >>
> >> I tried this notation in Tapestry and it told me back that it did not
> >> understand:
> >>
> >> Where did I go wrong?
> >>
> >> thanks for your help,
> >>
> >> Micha
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/OGNL-Notation-for-accessing-List-Element-tf2588481.html#a7234561
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
--
"Budgets are moral documents."
-- Ann Richards
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: OGNL Notation for accessing List Element
Posted by Micha Roon <dr...@gmail.com>.
I have one page (Home.html) with its Class (Home.java) and in the class I
have the two methods
public String getName(String which){ return which;}
public void setName(String which){return;}
In the html I have just one tag for the test: jwcid="@Insert"
value="ognl:name['titi']"
I have attached the error message that Tapestry gives me
http://www.nabble.com/file/4033/errorMessage.htm errorMessage.htm
Martin Strand-4 wrote:
>
> How does the code for that method look? it's supposed to look like this:
>
> public PropertyType getPropertyName(IndexType index)
> public void setPropertyName(IndexType index, PropertyType value)
>
> On Tue, 07 Nov 2006 13:41:10 +0100, Micha Roon wrote:
>
>>
>> I am trying to get at a specific element in a list that is return by a
>> GET
>> method in my page.
>>
>> I went to the OGNL home page and saw that the notation
>> session.attribute["foo"] will get the foo element of the attribute list (
>> http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/indexing.html
>> see
>> here )
>>
>> I tried this notation in Tapestry and it told me back that it did not
>> understand:
>>
>> Where did I go wrong?
>>
>> thanks for your help,
>>
>> Micha
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/OGNL-Notation-for-accessing-List-Element-tf2588481.html#a7234561
Sent from the Tapestry - User mailing list archive at Nabble.com.
Re: OGNL Notation for accessing List Element
Posted by Martin Strand <do...@gmail.com>.
How does the code for that method look? it's supposed to look like this:
public PropertyType getPropertyName(IndexType index)
public void setPropertyName(IndexType index, PropertyType value)
On Tue, 07 Nov 2006 13:41:10 +0100, Micha Roon <dr...@gmail.com> wrote:
>
> I am trying to get at a specific element in a list that is return by a
> GET
> method in my page.
>
> I went to the OGNL home page and saw that the notation
> session.attribute["foo"] will get the foo element of the attribute list (
> http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/indexing.html
> see
> here )
>
> I tried this notation in Tapestry and it told me back that it did not
> understand:
>
> Where did I go wrong?
>
> thanks for your help,
>
> Micha
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org