RE: T4.1.6 Troubles with accessing bindings from async listener method

2010-01-21 Thread Marko Mrkus
I solved it with passing the index of an item in collection as a direct link
parameter which then updates component's parameter. Then the client of this
component (usually page) access the object from collection with updated
index. Thanks!

-Original Message-
From: andre...@gmail.com [mailto:andre...@gmail.com] On Behalf Of Andreas
Andreou
Sent: Wednesday, January 20, 2010 5:51 PM
To: Tapestry users
Subject: Re: T4.1.6 Troubles with accessing bindings from async listener
method

When the direct link is triggered, your listener is called.
I don't think the source parameter will be bound since there's no page
rendering (or rewinding) happening - just the listener method getting
called.

Anyway, you have a few options here:
- Persist the list into the session.
- or, just add the item to the direct link (it needs to be
serializable or you need
to write a custom DataSqueezer for it) using:


For further reading:
- http://tapestry.apache.org/tapestry4.1/quickstart/directlink.html
-
http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/services/
DataSqueezer.html
- http://wiki.apache.org/tapestry/DataSqueezer


On Wed, Jan 20, 2010 at 18:20, Marko Mrkus 
wrote:
> Is it possible that only invariant expression bindings are updated in
> listener methods for form submissions and invoking direct service urls?
>
> -Original Message-
> From: Marko Mrkus [mailto:marko.mr...@bumblehood.com]
> Sent: Wednesday, January 20, 2010 2:55 PM
> To: 'Tapestry users'
> Subject: T4.1.6 Troubles with accessing bindings from async listener
method
>
> Hi, all!
>
>
>
> I have problems with understanding how bindings work in Tapestry when they
> are accessed from async listener.
>
> I'm trying to build a List component which takes parameters source, value
> and selectedValue. It renders source and updates value as For component.
>
> I would like that users can select one row in List component and that some
> components on page are updated and that they use this updated selected
> object value.
>
>
>
> Component specification is:
>
>
>
> 
>
>            
>
>            
>
>            
>
>            
>
>
>
>            
>
>            
>
>            
>
> 
>
>
>
> 
>
>            
>
>             value="ognl:components.get('iterator').index" />
>
>  
>
>
>
> 
>
>
>
> Java class:
>
>
>
> package org.tapestry.example;
>
>
>
> public abstract class ListComponent extends BaseComponents{
>
>
>
>            public void changeSelectedObject(IRequestCycle cycle) {
>
>                        int indexOfRow =
> (Integer)cycle.getListenerParameters[0];
>
>                        Object value = this.getSource().get(indexOfRow);
> <- THIS LINE THROWS IndexOutOfBoundsException since
> this.getSource() returns empty list.
>
>
>
>                        this.setSelectedValue(value);
>
>
>
>                        for (String compId : this.getUpdateComponents) {
>
>
> cycle.getResponseBuilder().updateComponent(compId);
>
> }
>
> }
>
>
>
> public abstract void getSource(); // Biding accessor for Source parameter
>
> public abstract void getUpdateComponents(); //Biding accessor for Update
> Components parameter
>
> public abstract void setSelectedValue(Object objValue);
>
> }
>
>
>
> I wonder why I'm getting empty list in listener method. Parameter source
was
> bound with list with 2 items in it and I got there empty list.
>
>
>
> Any help is appreciated.
>
>
>
> Regards,
>
> Marko
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



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

-
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: T4.1.6 Troubles with accessing bindings from async listener method

2010-01-20 Thread Marko Mrkus
Is it possible that only invariant expression bindings are updated in
listener methods for form submissions and invoking direct service urls?

-Original Message-
From: Marko Mrkus [mailto:marko.mr...@bumblehood.com] 
Sent: Wednesday, January 20, 2010 2:55 PM
To: 'Tapestry users'
Subject: T4.1.6 Troubles with accessing bindings from async listener method

Hi, all!

 

I have problems with understanding how bindings work in Tapestry when they
are accessed from async listener.

I'm trying to build a List component which takes parameters source, value
and selectedValue. It renders source and updates value as For component.

I would like that users can select one row in List component and that some
components on page are updated and that they use this updated selected
object value.

 

Component specification is:

 











 









 







 

 



 

Java class:

 

package org.tapestry.example;

 

public abstract class ListComponent extends BaseComponents{



public void changeSelectedObject(IRequestCycle cycle) {

int indexOfRow =
(Integer)cycle.getListenerParameters[0];

Object value = this.getSource().get(indexOfRow);
<- THIS LINE THROWS IndexOutOfBoundsException since
this.getSource() returns empty list.

 

this.setSelectedValue(value);

 

for (String compId : this.getUpdateComponents) {

 
cycle.getResponseBuilder().updateComponent(compId);

}

}

 

public abstract void getSource(); // Biding accessor for Source parameter

public abstract void getUpdateComponents(); //Biding accessor for Update
Components parameter

public abstract void setSelectedValue(Object objValue);

}

 

I wonder why I'm getting empty list in listener method. Parameter source was
bound with list with 2 items in it and I got there empty list. 

 

Any help is appreciated.

 

Regards,

Marko



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



T4.1.6 Troubles with accessing bindings from async listener method

2010-01-20 Thread Marko Mrkus
Hi, all!

 

I have problems with understanding how bindings work in Tapestry when they
are accessed from async listener.

I'm trying to build a List component which takes parameters source, value
and selectedValue. It renders source and updates value as For component.

I would like that users can select one row in List component and that some
components on page are updated and that they use this updated selected
object value.

 

Component specification is:

 











 









 







 

 



 

Java class:

 

package org.tapestry.example;

 

public abstract class ListComponent extends BaseComponents{



public void changeSelectedObject(IRequestCycle cycle) {

int indexOfRow =
(Integer)cycle.getListenerParameters[0];

Object value = this.getSource().get(indexOfRow);
<- THIS LINE THROWS IndexOutOfBoundsException since
this.getSource() returns empty list.

 

this.setSelectedValue(value);

 

for (String compId : this.getUpdateComponents) {

 
cycle.getResponseBuilder().updateComponent(compId);

}

}

 

public abstract void getSource(); // Biding accessor for Source parameter

public abstract void getUpdateComponents(); //Biding accessor for Update
Components parameter

public abstract void setSelectedValue(Object objValue);

}

 

I wonder why I'm getting empty list in listener method. Parameter source was
bound with list with 2 items in it and I got there empty list. 

 

Any help is appreciated.

 

Regards,

Marko



[T4.1] Webcomponentexamples source

2009-08-15 Thread Marko Mrkus
Hi!

 

Does anyone has source code for tapestry examples project hosted at
https://tapestrywebcomponentexamples.dev.java.net/ ?

There is a .war package, but no source code in CVS repository.

 

Thanks!



RE: Render body of the component in some other component

2009-08-14 Thread Marko Mrkus
Thanks, I just wanted to make sure that this component is the right tool for
the job!

My job is to build Pagination component which will use filter and pages for
rendering component which is wrapped by Pagination component.

Sample usage could be:




And IteratedComponent must be unaware of PaginationComponent. Template which
InnerComponent could have is:



...

So it's something similar like @For component but with pagination and
filtering :)


-Original Message-
From: andre...@gmail.com [mailto:andre...@gmail.com] On Behalf Of Andreas
Andreou
Sent: Friday, August 14, 2009 3:46 PM
To: Tapestry users
Subject: Re: Render body of the component in some other component

use RenderBody instead of InnerComponent

If for every iteration you want to pass dynamic data from @Component
to the components that exist in the body of @Component, you can use
the requestCycle, i.e.
cycle.setAttribute()
cycle.getAttribute()


On Fri, Aug 14, 2009 at 4:27 PM, Marko Mrkus
wrote:
> Sorry, formatting of the last message was awful... Here's the message
again:
>
> Hi, all!
> Can you tell me is it possible to render body of a component in some other
> component which is wrapped by this first one in Tapestry 4.1?
>
> I have an example:
> Page html:
> 
>            This is top level component's body
> 
>
> Component.jwc:
> 
>             Haeder 
>
>                                        value="ognl:currentProp">
>
>                        
>                        
>                                This is top level component's body
>                        
>                
>
>                 Footer 
> 
> Maybe use of @RenderBody component for @InnerComponent?
> Thanks for your time,
> Marko
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



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

-
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: Render body of the component in some other component

2009-08-14 Thread Marko Mrkus
Sorry, formatting of the last message was awful... Here's the message again:

Hi, all!
Can you tell me is it possible to render body of a component in some other
component which is wrapped by this first one in Tapestry 4.1?

I have an example:
Page html:

This is top level component's body


Component.jwc:

 Haeder 





This is top level component's body



 Footer 

Maybe use of @RenderBody component for @InnerComponent?
Thanks for your time,
Marko


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



Render body of the component in some other component

2009-08-14 Thread Marko Mrkus
Hi, all!

 

Can you tell me is it possible to render body of a component in some other
component which is wrapped by this first one in Tapestry 4.1?

I have an example:

 

Page html:



This is top level component's body



 

Component.jwc:



 Haeder 





 





This is top level component's body



 



 

 Footer 



 

Maybe use of @RenderBody component for @InnerComponent?

 

Thanks for your time,

Marko



Pagination component for Tapestry4

2009-08-13 Thread Marko Mrkus
Hello!

 

I'm working on one project with Tapestry 4 which makes heavy use of
paginated lists. They are at least 10 lists of different items in project.

This paginated lists have coulumns, optional filter and sorting upon some
columns.

 

I though of this in this way:

Application service returns a list of domain objects. Each domain object can
have tapestry component implemented. i.e. :

 

Class CustomerBean {

 String firstName;

 String lastName;

 String phoneNumber;

 //getters, setters, constructor

}

 

CustomerBeanComponent:

Template: 







 

Specification:

 

 

Now PaginationComponent should take the List and iterate over
this list with rendering of it's body component. This is similar behaviour

like For component but I would need pagination, filters and columns in
PaginationComponent.

 

Can you give me some guidelines how to implement this component and do you
think is it possible at all?

 

Thanks!