You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by petros <pe...@cypoz.com> on 2008/03/23 14:23:26 UTC

T5: LayoutCmpnt and inherit: prefix

I have a UserAddUpdate page with a property called readOnly. This property is
used to enable/disable components to simulate edit/read mode on the page.
The embedded AddressCmpnt template uses "inherit:readOnly" to enable/disable
its components. 

I am now refactored the UserAddUpdate page and created a AddUpdateLayout
cmpnt so I can re-use it in other pages such as HotelAddUpdate pages.
Everything works fine but except that when I start using the
"inherit:readOnly" in the HotelAddUpdate page I am getting the following
exception. Any ideas why this problem occurs ?

***********************************************
HotelAddUpdatePage.html
<div t:type="AddUpdateLayoutCmpnt"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
	<div class="t-beaneditor-row">
		<label t:type="Label" for="hname">Hotel Name</label>
		<input t:type="TextField" t:id="hname" value="hotel?.name" 
disabled="inherit:readOnly"/>		
	</div>
</div>
***********************************************

java.lang.NullPointerException
Stack
traceorg.apache.tapestry.internal.services.PageLoaderProcessor.findBinding(PageLoaderProcessor.java:249)
        *
org.apache.tapestry.internal.services.PageLoaderProcessor.bindParameterFromTemplate(PageLoaderProcessor.java:170)
        *
org.apache.tapestry.internal.services.PageLoaderProcessor.attribute(PageLoaderProcessor.java:299)
        *
org.apache.tapestry.internal.services.PageLoaderProcessor.loadTemplateForComponent(PageLoaderProcessor.java:504)
        *
org.apache.tapestry.internal.services.PageLoaderProcessor.workComponentQueue(PageLoaderProcessor.java:807)
        *
org.apache.tapestry.internal.services.PageLoaderProcessor.loadPage(PageLoaderProcessor.java:392)
        *
org.apache.tapestry.internal.services.PageLoaderImpl.loadPage(PageLoaderImpl.java:59)
        *
org.apache.tapestry.internal.services.PagePoolCache.checkout(PagePoolCache.java:188)
        *
org.apache.tapestry.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:107)
        *
org.apache.tapestry.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:43)
        *
org.apache.tapestry.internal.services.LinkFactoryImpl.createPageLink(LinkFactoryImpl.java:273)
        *
org.apache.tapestry.internal.structure.PageImpl.createPageLink(PageImpl.java:161)
-- 
View this message in context: http://www.nabble.com/T5%3A-LayoutCmpnt-and-inherit%3A-prefix-tp16235911p16235911.html
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: T5: LayoutCmpnt and inherit: prefix

Posted by Howard Lewis Ship <hl...@gmail.com>.
disabled="inherit:readOnly"

That says "inherit the disabled parameter from the containing
component's readOnly parameter".

There is no containing component parameter, because the containg of
the AddUpdateLayoutCmpnt is the page, which doesn't have parameters,
just properties.

So strip out "inherit:" to reference the property readOnly and it will work.


On Sun, Mar 23, 2008 at 6:47 PM, petros <pe...@cypoz.com> wrote:
>
>  The readOnly parameter belogs to the AddUpdateLayoutCmpnt and is declared
>  like this
>  @Property
>  private boolean readOnly;
>
>  I then use the AddUpdateLayoutCmpnt as the layout of this
>
> <div t:type="AddUpdateLayoutCmpnt"
>  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>      <input t:type="TextField" t:id="name" value="object?.name"
>  disabled="inherit:readOnly"/>
>  </div>
>
>  When the page above renders I am getting the error
>
>  Petros
>
>
>
>
>  Howard Lewis Ship wrote:
>  >
>  > Looks like a bug. PageLoaderProcessor.java:249 is:
>  >
>  >        // This may return null if the parameter is not bound in the
>  > loading component.
>  >
>  >             Binding existing =
>  > loadingComponentBindingMap.get(loadingParameterName);
>  >
>  >
>  > It looks like loadingComponentBindingMap may be null when the loading
>  > component is a page.
>  >
>  > The error is responsable ... where are you inheritting the readOnly
>  > parameter from? ... but the a NPE is not acceptible, it should be an
>  > exception that identifies what you are doing wrong (using inherit:
>  > where it doesn't make sense).
>  >
>  > On Sun, Mar 23, 2008 at 6:23 AM, petros <pe...@cypoz.com> wrote:
>  >>
>  >>  I have a UserAddUpdate page with a property called readOnly. This
>  >> property is
>  >>  used to enable/disable components to simulate edit/read mode on the
>  >> page.
>  >>  The embedded AddressCmpnt template uses "inherit:readOnly" to
>  >> enable/disable
>  >>  its components.
>  >>
>  >>  I am now refactored the UserAddUpdate page and created a AddUpdateLayout
>  >>  cmpnt so I can re-use it in other pages such as HotelAddUpdate pages.
>  >>  Everything works fine but except that when I start using the
>  >>  "inherit:readOnly" in the HotelAddUpdate page I am getting the following
>  >>  exception. Any ideas why this problem occurs ?
>  >>
>  >>  ***********************************************
>  >>  HotelAddUpdatePage.html
>  >>  <div t:type="AddUpdateLayoutCmpnt"
>  >>  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>  >>         <div class="t-beaneditor-row">
>  >>                 <label t:type="Label" for="hname">Hotel Name</label>
>  >>                 <input t:type="TextField" t:id="hname"
>  >> value="hotel?.name"
>  >>  disabled="inherit:readOnly"/>
>  >>         </div>
>  >>  </div>
>  >>  ***********************************************
>  >>
>  >>  java.lang.NullPointerException
>  >>  Stack
>  >>
>  >> traceorg.apache.tapestry.internal.services.PageLoaderProcessor.findBinding(PageLoaderProcessor.java:249)
>  >>         *
>  >>
>  >> org.apache.tapestry.internal.services.PageLoaderProcessor.bindParameterFromTemplate(PageLoaderProcessor.java:170)
>  >>         *
>  >>
>  >> org.apache.tapestry.internal.services.PageLoaderProcessor.attribute(PageLoaderProcessor.java:299)
>  >>         *
>  >>
>  >> org.apache.tapestry.internal.services.PageLoaderProcessor.loadTemplateForComponent(PageLoaderProcessor.java:504)
>  >>         *
>  >>
>  >> org.apache.tapestry.internal.services.PageLoaderProcessor.workComponentQueue(PageLoaderProcessor.java:807)
>  >>         *
>  >>
>  >> org.apache.tapestry.internal.services.PageLoaderProcessor.loadPage(PageLoaderProcessor.java:392)
>  >>         *
>  >>
>  >> org.apache.tapestry.internal.services.PageLoaderImpl.loadPage(PageLoaderImpl.java:59)
>  >>         *
>  >>
>  >> org.apache.tapestry.internal.services.PagePoolCache.checkout(PagePoolCache.java:188)
>  >>         *
>  >>
>  >> org.apache.tapestry.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:107)
>  >>         *
>  >>
>  >> org.apache.tapestry.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:43)
>  >>         *
>  >>
>  >> org.apache.tapestry.internal.services.LinkFactoryImpl.createPageLink(LinkFactoryImpl.java:273)
>  >>         *
>  >>
>  >> org.apache.tapestry.internal.structure.PageImpl.createPageLink(PageImpl.java:161)
>  >>  --
>  >>  View this message in context:
>  >> http://www.nabble.com/T5%3A-LayoutCmpnt-and-inherit%3A-prefix-tp16235911p16235911.html
>  >>  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
>  >>
>  >>
>  >
>  >
>  >
>  > --
>  > Howard M. Lewis Ship
>  >
>  > Creator Apache Tapestry and Apache HiveMind
>  >
>  > ---------------------------------------------------------------------
>  > 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/T5%3A-LayoutCmpnt-and-inherit%3A-prefix-tp16235911p16244194.html
>
>
> 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
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: T5: LayoutCmpnt and inherit: prefix

Posted by petros <pe...@cypoz.com>.
The readOnly parameter belogs to the AddUpdateLayoutCmpnt and is declared
like this
@Property	
private boolean readOnly;

I then use the AddUpdateLayoutCmpnt as the layout of this
<div t:type="AddUpdateLayoutCmpnt"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
     <input t:type="TextField" t:id="name" value="object?.name" 
disabled="inherit:readOnly"/>
</div>

When the page above renders I am getting the error 

Petros


Howard Lewis Ship wrote:
> 
> Looks like a bug. PageLoaderProcessor.java:249 is:
> 
>        // This may return null if the parameter is not bound in the
> loading component.
> 
>             Binding existing =
> loadingComponentBindingMap.get(loadingParameterName);
> 
> 
> It looks like loadingComponentBindingMap may be null when the loading
> component is a page.
> 
> The error is responsable ... where are you inheritting the readOnly
> parameter from? ... but the a NPE is not acceptible, it should be an
> exception that identifies what you are doing wrong (using inherit:
> where it doesn't make sense).
> 
> On Sun, Mar 23, 2008 at 6:23 AM, petros <pe...@cypoz.com> wrote:
>>
>>  I have a UserAddUpdate page with a property called readOnly. This
>> property is
>>  used to enable/disable components to simulate edit/read mode on the
>> page.
>>  The embedded AddressCmpnt template uses "inherit:readOnly" to
>> enable/disable
>>  its components.
>>
>>  I am now refactored the UserAddUpdate page and created a AddUpdateLayout
>>  cmpnt so I can re-use it in other pages such as HotelAddUpdate pages.
>>  Everything works fine but except that when I start using the
>>  "inherit:readOnly" in the HotelAddUpdate page I am getting the following
>>  exception. Any ideas why this problem occurs ?
>>
>>  ***********************************************
>>  HotelAddUpdatePage.html
>>  <div t:type="AddUpdateLayoutCmpnt"
>>  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>>         <div class="t-beaneditor-row">
>>                 <label t:type="Label" for="hname">Hotel Name</label>
>>                 <input t:type="TextField" t:id="hname"
>> value="hotel?.name"
>>  disabled="inherit:readOnly"/>
>>         </div>
>>  </div>
>>  ***********************************************
>>
>>  java.lang.NullPointerException
>>  Stack
>> 
>> traceorg.apache.tapestry.internal.services.PageLoaderProcessor.findBinding(PageLoaderProcessor.java:249)
>>         *
>> 
>> org.apache.tapestry.internal.services.PageLoaderProcessor.bindParameterFromTemplate(PageLoaderProcessor.java:170)
>>         *
>> 
>> org.apache.tapestry.internal.services.PageLoaderProcessor.attribute(PageLoaderProcessor.java:299)
>>         *
>> 
>> org.apache.tapestry.internal.services.PageLoaderProcessor.loadTemplateForComponent(PageLoaderProcessor.java:504)
>>         *
>> 
>> org.apache.tapestry.internal.services.PageLoaderProcessor.workComponentQueue(PageLoaderProcessor.java:807)
>>         *
>> 
>> org.apache.tapestry.internal.services.PageLoaderProcessor.loadPage(PageLoaderProcessor.java:392)
>>         *
>> 
>> org.apache.tapestry.internal.services.PageLoaderImpl.loadPage(PageLoaderImpl.java:59)
>>         *
>> 
>> org.apache.tapestry.internal.services.PagePoolCache.checkout(PagePoolCache.java:188)
>>         *
>> 
>> org.apache.tapestry.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:107)
>>         *
>> 
>> org.apache.tapestry.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:43)
>>         *
>> 
>> org.apache.tapestry.internal.services.LinkFactoryImpl.createPageLink(LinkFactoryImpl.java:273)
>>         *
>> 
>> org.apache.tapestry.internal.structure.PageImpl.createPageLink(PageImpl.java:161)
>>  --
>>  View this message in context:
>> http://www.nabble.com/T5%3A-LayoutCmpnt-and-inherit%3A-prefix-tp16235911p16235911.html
>>  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
>>
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator Apache Tapestry and Apache HiveMind
> 
> ---------------------------------------------------------------------
> 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/T5%3A-LayoutCmpnt-and-inherit%3A-prefix-tp16235911p16244194.html
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: T5: LayoutCmpnt and inherit: prefix

Posted by Howard Lewis Ship <hl...@gmail.com>.
Looks like a bug. PageLoaderProcessor.java:249 is:

       // This may return null if the parameter is not bound in the
loading component.

            Binding existing =
loadingComponentBindingMap.get(loadingParameterName);


It looks like loadingComponentBindingMap may be null when the loading
component is a page.

The error is responsable ... where are you inheritting the readOnly
parameter from? ... but the a NPE is not acceptible, it should be an
exception that identifies what you are doing wrong (using inherit:
where it doesn't make sense).

On Sun, Mar 23, 2008 at 6:23 AM, petros <pe...@cypoz.com> wrote:
>
>  I have a UserAddUpdate page with a property called readOnly. This property is
>  used to enable/disable components to simulate edit/read mode on the page.
>  The embedded AddressCmpnt template uses "inherit:readOnly" to enable/disable
>  its components.
>
>  I am now refactored the UserAddUpdate page and created a AddUpdateLayout
>  cmpnt so I can re-use it in other pages such as HotelAddUpdate pages.
>  Everything works fine but except that when I start using the
>  "inherit:readOnly" in the HotelAddUpdate page I am getting the following
>  exception. Any ideas why this problem occurs ?
>
>  ***********************************************
>  HotelAddUpdatePage.html
>  <div t:type="AddUpdateLayoutCmpnt"
>  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>         <div class="t-beaneditor-row">
>                 <label t:type="Label" for="hname">Hotel Name</label>
>                 <input t:type="TextField" t:id="hname" value="hotel?.name"
>  disabled="inherit:readOnly"/>
>         </div>
>  </div>
>  ***********************************************
>
>  java.lang.NullPointerException
>  Stack
>  traceorg.apache.tapestry.internal.services.PageLoaderProcessor.findBinding(PageLoaderProcessor.java:249)
>         *
>  org.apache.tapestry.internal.services.PageLoaderProcessor.bindParameterFromTemplate(PageLoaderProcessor.java:170)
>         *
>  org.apache.tapestry.internal.services.PageLoaderProcessor.attribute(PageLoaderProcessor.java:299)
>         *
>  org.apache.tapestry.internal.services.PageLoaderProcessor.loadTemplateForComponent(PageLoaderProcessor.java:504)
>         *
>  org.apache.tapestry.internal.services.PageLoaderProcessor.workComponentQueue(PageLoaderProcessor.java:807)
>         *
>  org.apache.tapestry.internal.services.PageLoaderProcessor.loadPage(PageLoaderProcessor.java:392)
>         *
>  org.apache.tapestry.internal.services.PageLoaderImpl.loadPage(PageLoaderImpl.java:59)
>         *
>  org.apache.tapestry.internal.services.PagePoolCache.checkout(PagePoolCache.java:188)
>         *
>  org.apache.tapestry.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:107)
>         *
>  org.apache.tapestry.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:43)
>         *
>  org.apache.tapestry.internal.services.LinkFactoryImpl.createPageLink(LinkFactoryImpl.java:273)
>         *
>  org.apache.tapestry.internal.structure.PageImpl.createPageLink(PageImpl.java:161)
>  --
>  View this message in context: http://www.nabble.com/T5%3A-LayoutCmpnt-and-inherit%3A-prefix-tp16235911p16235911.html
>  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
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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