You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Nikolaos Konstantinou <nk...@upcom.eu> on 2007/10/10 14:28:40 UTC

DirectLink problem

I 'm having this peculiar problem with the page I'm trying to create (I'm
using Tapestry 4.1.3. When the page loads, I get a Tapestry Exception
Unable to read OGNL expression '<parsed OGNL expression>' of
$HomePage_0@3c1[Home]: source is null for getProperty(null,
"selectedCountryId") [context:/WEB-INF/Home.xhtml, line 130]

The "mystery" is that the error is traced at the DirectLink component;
Tapestry does not have any problem with the Hidden component, arising
suspicions that the problem is not actually that selectedCountryId is null
(it should have a problem with the Hidden component) but that there's
something I'm not doing right with the DirectLink component. What could be
the case?

Line 96:
<form action="#" jwcid="quoteForm">
                      <input type="hidden" jwcid="@Hidden"
value="ognl:selectedCountryId"/>

...
Line 130:
                                        <a href="LocationSearch.xhtml"
                                          id="pickdestsearchlink"
                                          onclick='document.getElementById
("pickdestsearch").checked="checked"'
                                          jwcid="@DirectLink"
                                          listener="ognl:
listeners.goToLocationSearch"
                                          parameters="ognl:new
java.lang.Object[] {selectedCountryId, selectedLocationId == -1 ?
otherCityId : selectedLocationId, checkIn == null ? null : checkIn.time,
checkOut == null ? null : checkOut.time, adultsPerRoom}"

                                          >Search for a destination<br/>
using keywords</a>


<http://www.cn.ntua.gr/%7Enkons>

Re: DirectLink problem

Posted by Nikolaos Konstantinou <nk...@cn.ntua.gr>.
Thanks for the tip, now it worked :)

Like you said, I had to assign a listener and transfer the code to the java
page. It worked but I understand there is a problem with ognl; theoretically
the previous approach should also work. Thanks a lot anyway :)

On 10/10/07, andyhot <an...@di.uoa.gr> wrote:
>
> Not sure why this fails - I'd also try
>
> parameters="ognl:{selectedCountryId, selectedLocationId == -1 ?
> otherCityId : selectedLocationId,
> checkIn == null ? null : checkIn.time, checkOut == null ? null :
> checkOut.time, adultsPerRoom}"
>
> but I'd really go with simplifying the ognl expression of this direct
> link, i.e.
> moving the code into the java.
>
> PS. listener="ognl:listeners.goToLocationSearch" should be updated to
> listener="listener:goToLocationSearch" (faster & cleaner)
>
> Nikolaos Konstantinou wrote:
> > I 'm having this peculiar problem with the page I'm trying to create
> (I'm
> > using Tapestry 4.1.3. When the page loads, I get a Tapestry Exception
> > Unable to read OGNL expression '<parsed OGNL expression>' of
> > $HomePage_0@3c1[Home]: source is null for getProperty(null,
> > "selectedCountryId") [context:/WEB-INF/Home.xhtml, line 130]
> >
> > The "mystery" is that the error is traced at the DirectLink component;
> > Tapestry does not have any problem with the Hidden component, arising
> > suspicions that the problem is not actually that selectedCountryId is
> null
> > (it should have a problem with the Hidden component) but that there's
> > something I'm not doing right with the DirectLink component. What could
> be
> > the case?
> >
> > Line 96:
> > <form action="#" jwcid="quoteForm">
> >                       <input type="hidden" jwcid="@Hidden"
> > value="ognl:selectedCountryId"/>
> >
> > ...
> > Line 130:
> >                                         <a href="LocationSearch.xhtml"
> >                                           id="pickdestsearchlink"
> >                                           onclick='
> document.getElementById
> > ("pickdestsearch").checked="checked"'
> >                                           jwcid="@DirectLink"
> >                                           listener="ognl:
> > listeners.goToLocationSearch"
> >                                           parameters="ognl:new
> > java.lang.Object[] {selectedCountryId, selectedLocationId == -1 ?
> > otherCityId : selectedLocationId, checkIn == null ? null : checkIn.time,
> > checkOut == null ? null : checkOut.time, adultsPerRoom}"
> >
> >                                           >Search for a destination<br/>
> > using keywords</a>
> >
> >
> > <http://www.cn.ntua.gr/%7Enkons>
> >
> >
>
> --
> Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
> Tapestry / Tacos developer
> Open Source / JEE Consulting
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Nikolaos Konstantinou
PhD Student - Research Assistant
Homepage: http://www.cn.ntua.gr/~nkons

Re: DirectLink problem

Posted by andyhot <an...@di.uoa.gr>.
Not sure why this fails - I'd also try

parameters="ognl:{selectedCountryId, selectedLocationId == -1 ? otherCityId : selectedLocationId, 
checkIn == null ? null : checkIn.time, checkOut == null ? null : checkOut.time, adultsPerRoom}"

but I'd really go with simplifying the ognl expression of this direct 
link, i.e.
moving the code into the java.

PS. listener="ognl:listeners.goToLocationSearch" should be updated to 
listener="listener:goToLocationSearch" (faster & cleaner)

Nikolaos Konstantinou wrote:
> I 'm having this peculiar problem with the page I'm trying to create (I'm
> using Tapestry 4.1.3. When the page loads, I get a Tapestry Exception
> Unable to read OGNL expression '<parsed OGNL expression>' of
> $HomePage_0@3c1[Home]: source is null for getProperty(null,
> "selectedCountryId") [context:/WEB-INF/Home.xhtml, line 130]
>
> The "mystery" is that the error is traced at the DirectLink component;
> Tapestry does not have any problem with the Hidden component, arising
> suspicions that the problem is not actually that selectedCountryId is null
> (it should have a problem with the Hidden component) but that there's
> something I'm not doing right with the DirectLink component. What could be
> the case?
>
> Line 96:
> <form action="#" jwcid="quoteForm">
>                       <input type="hidden" jwcid="@Hidden"
> value="ognl:selectedCountryId"/>
>
> ...
> Line 130:
>                                         <a href="LocationSearch.xhtml"
>                                           id="pickdestsearchlink"
>                                           onclick='document.getElementById
> ("pickdestsearch").checked="checked"'
>                                           jwcid="@DirectLink"
>                                           listener="ognl:
> listeners.goToLocationSearch"
>                                           parameters="ognl:new
> java.lang.Object[] {selectedCountryId, selectedLocationId == -1 ?
> otherCityId : selectedLocationId, checkIn == null ? null : checkIn.time,
> checkOut == null ? null : checkOut.time, adultsPerRoom}"
>
>                                           >Search for a destination<br/>
> using keywords</a>
>
>
> <http://www.cn.ntua.gr/%7Enkons>
>
>   

-- 
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting


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