Re: Component parameter becoming null

2015-10-23 Thread Casey Link
Do you mean the "container" variable in the loop?

That might explain it, as every iteration through the loop the value
changes. Is there a way to suspend the dual-binding nature, or pass a
copy of the value?

Casey

On 10/23/2015 03:25 PM, Thiago H de Paula Figueiredo wrote:
> On Fri, 23 Oct 2015 07:01:51 -0200, Casey Link
>  wrote:
>
>> Ah yea, I screwed up the example in my email, but yes, it's declared
>> like so:
>>
>> @Parameter(required = true)
>> List fooList;
>>
>> Mind you it works for the "normal" static cases, and the case where it's
>> passed as a property (#1 and #2), but not inside a .
>
> By any chance does your code change the value of the fooList field?
> The prop binding is bidirectional so, if you change it's value, it
> changes the property which was bound to that parameter too.
>
>>
>> Casey Link
>>
>> Outskirts Labs { https://outskirtslabs.com }
>> Technology for Changemakers
>>
>> On 10/23/2015 10:36 AM, Nathan Quirynen wrote:
>>> Just checking to be sure, but are you sure you didn't forget the
>>> @Parameter on the fooList property in your component?
>>>
>>> Nathan
>>>
>>> On 23/10/15 10:14, Casey Link wrote:
 This is a strange one.

 I have a Foo component that wraps a progressive display (not sure if
 that part is relevant). One of the parameters to this component is a
 list of strings, "t:fooList":

 @Property
 List fooList;

 In the page I'm trying to include it in, it works as expected if I set
 fooList with:

 1. t:fooList="list:literal:aFoo"
 2. t:fooList="prop:someFooList"

 But if I wrap my Foo component in a  and try to set the
 fooList
 that way, I get errors:

 
  
 

 where those properties are:
 public List> listofFooLists(){...}

 @Property
 List aFooList;

 The specific error is an NPE in the Foo component when it tries to
 access it's fooList field.

 I'm not sure if being a progressiveDisplay component has anything
 to do
 with it, but somewhere along the way the fooList is being nulled. By
 printing out ${aFooList} besides mt  I can see that what is
 being passed to the component is indeed, not null.

 I'd appreciate any advice, as this is quite a stumper for me.

 Cheers,
 Casey


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


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



Re: Passing parent layout's object to nested page

2015-10-23 Thread Thiago H de Paula Figueiredo

On Fri, 23 Oct 2015 12:28:09 -0200, g kuczera  wrote:


For now I tried the last approach, (InjectContainer), but it throws
Caused by: java.lang.NullPointerException
at
org.apache.tapestry5.internal.transform.InjectContainerWorker$1$1.get(InjectContainerWorker.java:80)
It looks like it's not the proper way in my case. Trying other ways.
PS: Just wandering, if the container worker gets null, then it probably
means, that there is no container at all (for my current page, in which I
put the annotation).


You got it right. :) This will only work on components, not in pages,  
because pages don't have a container (parent). It would work from the  
Layout component to access the page on which it's used, for example.


Have you tried the Environment?

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Re: Passing parent layout's object to nested page

2015-10-23 Thread g kuczera
For now I tried the last approach, (InjectContainer), but it throws
Caused by: java.lang.NullPointerException
at
org.apache.tapestry5.internal.transform.InjectContainerWorker$1$1.get(InjectContainerWorker.java:80)

It looks like it's not the proper way in my case. Trying other ways.
PS: Just wandering, if the container worker gets null, then it probably
means, that there is no container at all (for my current page, in which I
put the annotation).


2015-10-22 15:40 GMT+02:00 Thiago H de Paula Figueiredo 
:

> On Thu, 22 Oct 2015 06:48:34 -0200, g kuczera  wrote:
>
> Hi Guys,
>>
>
> Hi!
>
> I have a custom layout named LayoutM (java class and tml). It is used by my
>> page - Activities - like that:
>>
>> >bodyClass="dashboard"
>>xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd";
>>xmlns:p="tapestry:parameter">
>> 
>> 
>>
>> And it implements some kind of interface (class LayoutM implements
>> CustomInterface).
>> Is there a way to pass LayoutM java class object,+
>>  to Activities page?
>>
>
> Yes. The recommended way of passing information (objects) around is
> through parameters. When this isn't possible, such as in your case, you can
> use the Environment service. Examples in
> http://tapestry.apache.org/environmental-services.html
> https://tawus.wordpress.com/2011/04/25/tapestry-magic-6-environment/
>
> Is something like that correct (if I put it below "a lot of stuff" line)?
>>
>>   
>>
>
> No, this isn't correct in two different ways: there's no way to reference
> this in the prop binding (the default one) and, in addition, you shouldn't
> use ${} expansions in parameters. It's always either useless or a bug.
>
> What I can see right now is the "this" being an instance of Activities
>> class. How can I get the parent layout's object?
>>
>
> @InjectContainer
> private Object parentObject; // actually, the field can be of any type you
> want.
>
> But you should try to avoid this, because it couples too much the
> component and its parent. Use the Environment instead.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Component parameter becoming null

2015-10-23 Thread Thiago H de Paula Figueiredo
On Fri, 23 Oct 2015 07:01:51 -0200, Casey Link   
wrote:



Ah yea, I screwed up the example in my email, but yes, it's declared
like so:

@Parameter(required = true)
List fooList;

Mind you it works for the "normal" static cases, and the case where it's
passed as a property (#1 and #2), but not inside a .


By any chance does your code change the value of the fooList field? The  
prop binding is bidirectional so, if you change it's value, it changes the  
property which was bound to that parameter too.




Casey Link

Outskirts Labs { https://outskirtslabs.com }
Technology for Changemakers

On 10/23/2015 10:36 AM, Nathan Quirynen wrote:

Just checking to be sure, but are you sure you didn't forget the
@Parameter on the fooList property in your component?

Nathan

On 23/10/15 10:14, Casey Link wrote:

This is a strange one.

I have a Foo component that wraps a progressive display (not sure if
that part is relevant). One of the parameters to this component is a
list of strings, "t:fooList":

@Property
List fooList;

In the page I'm trying to include it in, it works as expected if I set
fooList with:

1. t:fooList="list:literal:aFoo"
2. t:fooList="prop:someFooList"

But if I wrap my Foo component in a  and try to set the fooList
that way, I get errors:


 


where those properties are:
public List> listofFooLists(){...}

@Property
List aFooList;

The specific error is an NPE in the Foo component when it tries to
access it's fooList field.

I'm not sure if being a progressiveDisplay component has anything to do
with it, but somewhere along the way the fooList is being nulled. By
printing out ${aFooList} besides mt  I can see that what is
being passed to the component is indeed, not null.

I'd appreciate any advice, as this is quite a stumper for me.

Cheers,
Casey









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




--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



[T5.4-beta-35] No more td css class from t:datagrid

2015-10-23 Thread TNO

Hi,

with T5.3, using a t:dataGrid, for each td, there is a css class from 
property name :


13 oct. 2014

but whith T5.4-beta-35, no more css class but a data-grid-property 
attribute !


13 oct. 2014


Why the td css class from t:dataGrid was removed ?

Best regards, Thomas

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



Re: Component parameter becoming null

2015-10-23 Thread Casey Link
Ah yea, I screwed up the example in my email, but yes, it's declared
like so:

@Parameter(required = true)
List fooList;

Mind you it works for the "normal" static cases, and the case where it's
passed as a property (#1 and #2), but not inside a .

Casey Link

Outskirts Labs { https://outskirtslabs.com }
Technology for Changemakers

On 10/23/2015 10:36 AM, Nathan Quirynen wrote:
> Just checking to be sure, but are you sure you didn't forget the
> @Parameter on the fooList property in your component?
>
> Nathan
>
> On 23/10/15 10:14, Casey Link wrote:
>> This is a strange one.
>>
>> I have a Foo component that wraps a progressive display (not sure if
>> that part is relevant). One of the parameters to this component is a
>> list of strings, "t:fooList":
>>
>> @Property
>> List fooList;
>>
>> In the page I'm trying to include it in, it works as expected if I set
>> fooList with:
>>
>> 1. t:fooList="list:literal:aFoo"
>> 2. t:fooList="prop:someFooList"
>>
>> But if I wrap my Foo component in a  and try to set the fooList
>> that way, I get errors:
>>
>> 
>>  
>> 
>>
>> where those properties are:
>> public List> listofFooLists(){...}
>>
>> @Property
>> List aFooList;
>>
>> The specific error is an NPE in the Foo component when it tries to
>> access it's fooList field.
>>
>> I'm not sure if being a progressiveDisplay component has anything to do
>> with it, but somewhere along the way the fooList is being nulled. By
>> printing out ${aFooList} besides mt  I can see that what is
>> being passed to the component is indeed, not null.
>>
>> I'd appreciate any advice, as this is quite a stumper for me.
>>
>> Cheers,
>> Casey
>>
>>
> 
>
>


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



Re: Component parameter becoming null

2015-10-23 Thread Nathan Quirynen
Just checking to be sure, but are you sure you didn't forget the 
@Parameter on the fooList property in your component?


Nathan

On 23/10/15 10:14, Casey Link wrote:

This is a strange one.

I have a Foo component that wraps a progressive display (not sure if
that part is relevant). One of the parameters to this component is a
list of strings, "t:fooList":

@Property
List fooList;

In the page I'm trying to include it in, it works as expected if I set
fooList with:

1. t:fooList="list:literal:aFoo"
2. t:fooList="prop:someFooList"

But if I wrap my Foo component in a  and try to set the fooList
that way, I get errors:


 


where those properties are:
public List> listofFooLists(){...}

@Property
List aFooList;

The specific error is an NPE in the Foo component when it tries to
access it's fooList field.

I'm not sure if being a progressiveDisplay component has anything to do
with it, but somewhere along the way the fooList is being nulled. By
printing out ${aFooList} besides mt  I can see that what is
being passed to the component is indeed, not null.

I'd appreciate any advice, as this is quite a stumper for me.

Cheers,
Casey







Component parameter becoming null

2015-10-23 Thread Casey Link
This is a strange one.

I have a Foo component that wraps a progressive display (not sure if
that part is relevant). One of the parameters to this component is a
list of strings, "t:fooList":

@Property
List fooList;

In the page I'm trying to include it in, it works as expected if I set
fooList with:

1. t:fooList="list:literal:aFoo"
2. t:fooList="prop:someFooList"

But if I wrap my Foo component in a  and try to set the fooList
that way, I get errors:





where those properties are:
public List> listofFooLists(){...}

@Property
List aFooList;

The specific error is an NPE in the Foo component when it tries to
access it's fooList field.

I'm not sure if being a progressiveDisplay component has anything to do
with it, but somewhere along the way the fooList is being nulled. By
printing out ${aFooList} besides mt  I can see that what is
being passed to the component is indeed, not null.

I'd appreciate any advice, as this is quite a stumper for me.

Cheers,
Casey