Re: Table Grid

2020-09-05 Thread Andreas Ernst

Am 05.09.20 um 09:12 schrieb Andreas Ernst:



Am 05.09.20 um 08:59 schrieb Andreas Ernst:

Hi,

it seems that the Table Grid crashes with more that 300 000 rows.

Testet with 5.5.0 and 5.6.0.

I used Payara Server 5.201 and 5.2020.4. The server died sometimes 
with error message like


[ERROR] TapestryModule.RequestExceptionHandler Processing of request 
failed with uncaught exception: java.lang.OutOfMemoryError: Java heap 
space

java.lang.OutOfMemoryError: Java heap space


Setting -Xmx2048m on Payara solved the issue, sorry for the noise...

--
ae | Andreas Ernst | IT Spektrum
Postfach 5, 65612 Beselich
Schupbacher Str. 32, 65614 Beselich, Germany
Tel: +49-6484-91002 Fax: +49-6484-91003
a...@ae-online.de | www.ae-online.de
www.tachyon-online.de

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



Re: Table Grid

2020-09-05 Thread Andreas Ernst




Am 05.09.20 um 08:59 schrieb Andreas Ernst:

Hi,

it seems that the Table Grid crashes with more that 300 000 rows.

Testet with 5.5.0 and 5.6.0.

I used Payara Server 5.201 and 5.2020.4. The server died sometimes with 
error message like


[ERROR] TapestryModule.RequestExceptionHandler Processing of request 
failed with uncaught exception: java.lang.OutOfMemoryError: Java heap space

java.lang.OutOfMemoryError: Java heap space


Maybe it not a Tapestry issue:

[ERROR] TapestryModule.RequestExceptionHandler Processing of request 
failed with uncaught exception: java.lang.OutOfMemoryError: Java heap space

java.lang.OutOfMemoryError: Java heap space
at java.util.HashMap.resize(HashMap.java:704)
at java.util.HashMap.putVal(HashMap.java:663)
at java.util.HashMap.put(HashMap.java:612)
at 
org.eclipse.persistence.internal.identitymaps.UnitOfWorkIdentityMap.putCacheKeyIfAbsent(UnitOfWorkIdentityMap.java:146)
at 
org.eclipse.persistence.internal.identitymaps.UnitOfWorkIdentityMap.acquireLock(UnitOfWorkIdentityMap.java:72)
at 
org.eclipse.persistence.internal.identitymaps.IdentityMapManager.acquireLock(IdentityMapManager.java:184)
at 
org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneFromRow(ObjectBuilder.java:2150)
at 
org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork(ObjectBuilder.java:858)
at 
org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:745)
at 
org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:699)
at 
org.eclipse.persistence.queries.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:861)
at 
org.eclipse.persistence.queries.ReadAllQuery.registerResultInUnitOfWork(ReadAllQuery.java:987)
at 
org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:598)
at 
org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1232)
at 
org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:911)
at 
org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1191)
at 
org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:485)
at 
org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1279)
at 
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2983)
at 
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1898)
at 
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1880)
at 
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1845)
at 
org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:262)
at 
org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:482)
at 
de.aeits.extranet.pages.HeizungListe.getHeizungen(HeizungListe.java:35)

at $InternalPropertyConduit_9f12289a8c1a.get(Unknown Source)
at 
org.apache.tapestry5.internal.bindings.PropBinding.get(PropBinding.java:63)
at 
org.apache.tapestry5.internal.transform.ParameterWorker$3$1.readFromBinding(ParameterWorker.java:263)
at 
org.apache.tapestry5.internal.transform.ParameterWorker$3$1.get(ParameterWorker.java:381)
at 
org.apache.tapestry5.corelib.components.Grid.conduit_get_source(Grid.java)
at 
org.apache.tapestry5.corelib.components.Grid.setupDataSource(Grid.java:553)
at 
org.apache.tapestry5.corelib.components.Grid.setupRender(Grid.java:513)


I will investigate.

--
ae | Andreas Ernst | IT Spektrum
Postfach 5, 65612 Beselich
Schupbacher Str. 32, 65614 Beselich, Germany
Tel: +49-6484-91002 Fax: +49-6484-91003
a...@ae-online.de | www.ae-online.de
www.tachyon-online.de

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



Table Grid

2020-09-05 Thread Andreas Ernst

Hi,

it seems that the Table Grid crashes with more that 300 000 rows.

Testet with 5.5.0 and 5.6.0.

I used Payara Server 5.201 and 5.2020.4. The server died sometimes with 
error message like


[ERROR] TapestryModule.RequestExceptionHandler Processing of request 
failed with uncaught exception: java.lang.OutOfMemoryError: Java heap space

java.lang.OutOfMemoryError: Java heap space

Should i open a ticket or is this a limit of Grid?

Thx
Andy
--
ae | Andreas Ernst | IT Spektrum
Postfach 5, 65612 Beselich
Schupbacher Str. 32, 65614 Beselich, Germany
Tel: +49-6484-91002 Fax: +49-6484-91003
a...@ae-online.de | www.ae-online.de
www.tachyon-online.de

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



Re: Filter on every table column

2016-04-28 Thread Morgan Hautman
Hi,

The problem was apparently a conflict between two jquery instances.
Starting from Tapestry 5.4 , Tapestry includes jQuery by default. Remove my
own defined jQuery instance fixed the problem.

Regards,
Morgan

2016-04-28 2:32 GMT+02:00 Jay Ginete :

> Hi Morgan,
>
> I'm guessing you didn't import the CSS and JS for the datatable.
>
> You can either import the datatable CSS and JS in your layout component OR
> import it into the page class.
>
> https://gist.github.com/killertilapia/b2509b6721d14e2abc5dd8cc1eda571d
>
>
>
> On 27/04/2016 8:30 PM, Morgan Hautman wrote:
>
>> Hi Jay,
>>
>> I'm able to show the table but there is no css or javascript.
>>
>> Do you know where I can find all the ressources?
>>
>> Or maybe I'm doing it wrong..
>>
>> https://gist.github.com/mhautman/d144d9bf107a27efe83fe97ca188a460
>>
>> Regards,
>> Morgan
>>
>> 2016-04-27 8:48 GMT+02:00 Morgan Hautman :
>>
>> Hi Jay,
>>>
>>> No :( Thank you very much, this i what I need!
>>>
>>> Regards,
>>> Morgan
>>>
>>> 2016-04-27 8:29 GMT+02:00 Jay Ginete :
>>>
>>> Have you discovered Tapestry5-jquery? It has a data table component that
>>>> does that you need.
>>>>
>>>> http://tapestry5-jquery.com/components/docsdatatables
>>>>
>>>>
>>>>
>>>> On 27/04/2016 2:25 PM, Morgan Hautman wrote:
>>>>
>>>> Hi,
>>>>>
>>>>> I would like to have a textfield who acts as a filter for every
>>>>> table/grid
>>>>> column.
>>>>> Is this possible in Tapestry?
>>>>>
>>>>> Regards,
>>>>> Morgan
>>>>>
>>>>>
>>>>> -
>>>> 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: Filter on every table column

2016-04-27 Thread Jay Ginete

Hi Morgan,

I'm guessing you didn't import the CSS and JS for the datatable.

You can either import the datatable CSS and JS in your layout component 
OR import it into the page class.


https://gist.github.com/killertilapia/b2509b6721d14e2abc5dd8cc1eda571d


On 27/04/2016 8:30 PM, Morgan Hautman wrote:

Hi Jay,

I'm able to show the table but there is no css or javascript.

Do you know where I can find all the ressources?

Or maybe I'm doing it wrong..

https://gist.github.com/mhautman/d144d9bf107a27efe83fe97ca188a460

Regards,
Morgan

2016-04-27 8:48 GMT+02:00 Morgan Hautman :


Hi Jay,

No :( Thank you very much, this i what I need!

Regards,
Morgan

2016-04-27 8:29 GMT+02:00 Jay Ginete :


Have you discovered Tapestry5-jquery? It has a data table component that
does that you need.

http://tapestry5-jquery.com/components/docsdatatables



On 27/04/2016 2:25 PM, Morgan Hautman wrote:


Hi,

I would like to have a textfield who acts as a filter for every
table/grid
column.
Is this possible in Tapestry?

Regards,
Morgan



-
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: Filter on every table column

2016-04-27 Thread Morgan Hautman
Hi Jay,

I'm able to show the table but there is no css or javascript.

Do you know where I can find all the ressources?

Or maybe I'm doing it wrong..

https://gist.github.com/mhautman/d144d9bf107a27efe83fe97ca188a460

Regards,
Morgan

2016-04-27 8:48 GMT+02:00 Morgan Hautman :

> Hi Jay,
>
> No :( Thank you very much, this i what I need!
>
> Regards,
> Morgan
>
> 2016-04-27 8:29 GMT+02:00 Jay Ginete :
>
>> Have you discovered Tapestry5-jquery? It has a data table component that
>> does that you need.
>>
>> http://tapestry5-jquery.com/components/docsdatatables
>>
>>
>>
>> On 27/04/2016 2:25 PM, Morgan Hautman wrote:
>>
>>> Hi,
>>>
>>> I would like to have a textfield who acts as a filter for every
>>> table/grid
>>> column.
>>> Is this possible in Tapestry?
>>>
>>> Regards,
>>> Morgan
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>


Re: Filter on every table column

2016-04-26 Thread Morgan Hautman
Hi Jay,

No :( Thank you very much, this i what I need!

Regards,
Morgan

2016-04-27 8:29 GMT+02:00 Jay Ginete :

> Have you discovered Tapestry5-jquery? It has a data table component that
> does that you need.
>
> http://tapestry5-jquery.com/components/docsdatatables
>
>
>
> On 27/04/2016 2:25 PM, Morgan Hautman wrote:
>
>> Hi,
>>
>> I would like to have a textfield who acts as a filter for every table/grid
>> column.
>> Is this possible in Tapestry?
>>
>> Regards,
>> Morgan
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Filter on every table column

2016-04-26 Thread Jay Ginete
Have you discovered Tapestry5-jquery? It has a data table component that 
does that you need.


http://tapestry5-jquery.com/components/docsdatatables


On 27/04/2016 2:25 PM, Morgan Hautman wrote:

Hi,

I would like to have a textfield who acts as a filter for every table/grid
column.
Is this possible in Tapestry?

Regards,
Morgan




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



Filter on every table column

2016-04-26 Thread Morgan Hautman
Hi,

I would like to have a textfield who acts as a filter for every table/grid
column.
Is this possible in Tapestry?

Regards,
Morgan


Re: Event link gets changed after outer zone/table refresh

2014-03-11 Thread Thiago H de Paula Figueiredo

On Tue, 11 Mar 2014 16:27:32 -0300, Swapna  wrote:


Thank you for the suggestions. I have made the changes.
But it didn't solve my issue, as my problem is , everything works fine  
initially, but once the table gets refreshed (with the filters) , the  
event link doesn't work, the method never gets called.

That because the event link id gets changed.


The link id does not interfere in the EventLink working at all.

--
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: Event link gets changed after outer zone/table refresh

2014-03-11 Thread Swapna
Your suggestions did  solve the issue of event link getting fired. I had some 
other code which was stopping it to fire.
Thank you. 
 

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



Re: Event link gets changed after outer zone/table refresh

2014-03-11 Thread Swapna
Thank you for the suggestions. I have made the changes.
But it didn't solve my issue, as my problem is , everything works fine 
initially, but once the table gets refreshed (with the filters) , the event 
link doesn't work, the method never gets called.
That because the event link id gets changed.

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



Re: Event link gets changed after outer zone/table refresh

2014-03-11 Thread Thiago H de Paula Figueiredo
Answering in the users mailing list, as it's the right place for this  
discussion.


On Tue, 11 Mar 2014 10:09:59 -0300, Swapna  wrote:

I have an eventLink inside the table, the event link id gets changed  
once the table zone is refreshed. once zone refreshed, event handler  
doesn't get called.


You can provide an id yourself to avoid problems, but I don't think that's  
related to the problem.



  For what I have seen, is the event link id getting changed.

Any help is appreciated.


 
t:context="${currentIndex}" >


Never, never, never ever use ${} expansions to bind parameters. It's wrong  
or useless in 100% of the times. It should have been  
t:context="currentIndex".



public Object onBalExpand(String currentIndex) {
return balZone;
}


Never return a zone instance directly: return zone.getBody(). That's  
probably the source of your problem.


--
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: NullPointer when refreshing a page with a table inside a zone

2013-09-13 Thread Thiago H de Paula Figueiredo
On Fri, 13 Sep 2013 04:57:15 -0300, ANDRE Christophe  
 wrote:



Thanks for all your answers.

I tried your solution Thiago like this:

BeanModel getModel() {
return
beanModelSource.createDisplayModel(myObject.class,resources.getMessages());
}


This method should be public.

--
Thiago H. de Paula Figueiredo

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



RE: NullPointer when refreshing a page with a table inside a zone

2013-09-13 Thread ANDRE Christophe
Thanks for all your answers.

I tried your solution Thiago like this: 

BeanModel getModel() {
return
beanModelSource.createDisplayModel(myObject.class,resources.getMessages());
}

And by removing:

@Property
private BeanModel< MyObject > model;

But then I get: ...pages.Index does not contain a property (or public field) 
named 'model'

The solution I found was to define my model two times:

@BeginRender
public void begin() {
model = beanModelSource.createDisplayModel(myObject.class, 
resources.getMessages());
}

And in

@OnEvent(value="success", component = " myForm ")
public void processForm() throws Exception {
myObjects = ...
   model = 
beanModelSource.createDisplayModel(myObject.class, resources.getMessages());
...
ajaxResponseRenderer.addRender("myZone ", myZone.getBody());
}

I guess it's not really clean to define it two times...

I m using Tapestry version 5.3.3

Thx

Christophe


-Message d'origine-
De : Thiago H de Paula Figueiredo [mailto:thiag...@gmail.com] 
Envoyé : jeudi 12 septembre 2013 20:48
À : Tapestry users
Objet : Re: NullPointer when refreshing a page with a table inside a zone

On Thu, 12 Sep 2013 15:16:41 -0300, ANDRE Christophe 
 wrote:

> Hi,

Hi!

Your code is missing that part that provides the value for myObjects and what 
Tapestry version you're using. In addition, you seem to be only setting the 
model field when rendering the whole Grid. Why don't you remove the model field 
and replace it with this:

BeanModel getModel() {
return
beanModelSource.createDisplayModel(myObject.class,resources.getMessages());
}

This will make sure the model passed to Grid is never null.

--
Thiago H. de Paula Figueiredo

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


Ce message et toutes les pieces jointes (ci apres le message) sont etablis a l 
intention exclusive de leurs destinataires. 
Si vous recevez ce message par erreur, merci de le detruire et d en avertir 
immediatement l expediteur par e mail. 
Toute utilisation de ce message non conforme a sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf autorisation 
expresse de l expediteur.
Les communications sur Internet n etant pas securisees, DOCAPOST BPO informe qu 
elle ne peut accepter aucune responsabilite quant au contenu de ce message.

Re: NullPointer when refreshing a page with a table inside a zone

2013-09-12 Thread Thiago H de Paula Figueiredo
On Thu, 12 Sep 2013 15:16:41 -0300, ANDRE Christophe  
 wrote:



Hi,


Hi!

Your code is missing that part that provides the value for myObjects and  
what Tapestry version you're using. In addition, you seem to be only  
setting the model field when rendering the whole Grid. Why don't you  
remove the model field and replace it with this:


BeanModel getModel() {
	return  
beanModelSource.createDisplayModel(myObject.class,resources.getMessages());

}

This will make sure the model passed to Grid is never null.

--
Thiago H. de Paula Figueiredo

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



Re: NullPointer when refreshing a page with a table inside a zone

2013-09-12 Thread Boris Horvat
You seem to have a few extra spaces, not sure if that is your problem but
still

t:zone=" myZone "
ajaxResponseRenderer.addRender("myZone ", myZone.getBody());
@OnEvent(value="success", component = " myForm ")




On Thu, Sep 12, 2013 at 8:16 PM, ANDRE Christophe <
christophe.and...@docapost-bpo.com> wrote:

> Hi,
>
> I have the following zone with table inside :
>
> 
>  t:model="model" t:rowIndex="indexRow">
> 
>...
> 
> 
>  There is nothing
> 
> 
> 
>
> And the following form :
>
> 
>  t:value="myValue" t:id="valueInput" type="text" name="valueInput"
> style="display:none"/>
>  t:id="submitValueId" id=" submitValueId " value="Submit"
> style="display:none"/>
> 
>
> After updating the zone using ajax like this:
>
> @Property
> private BeanModel model;
>
> @Inject
> private BeanModelSource beanModelSource;
>
> @OnEvent(value="success", component = " myForm ")
> public void processForm() throws Exception {
>model =
> beanModelSource.createDisplayModel(myObject.class, resources.getMessages());
> ...
> ajaxResponseRenderer.addRender("myZone ", myZone.getBody());
> }
>
>
> My zone get updated and the table become visible.
> But I get a Null pointer if I refresh the page or when a redirection is
> done on this page:
> Caused by: java.lang.NullPointerException
> at
> org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java:112)
> at
> org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java)
> at
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.invokeComponent(ComponentPageElementImpl.java:174)
> at
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:133)
>
> What am I doing wrong?
> (Also I have the feeling the page is not fully reloaded when the page is
> refreshed!?)
>
> Thx
>
>
> Christophe
>
> Ce message et toutes les pieces jointes (ci apres le message) sont etablis
> a l intention exclusive de leurs destinataires.
> Si vous recevez ce message par erreur, merci de le detruire et d en
> avertir immediatement l expediteur par e mail.
> Toute utilisation de ce message non conforme a sa destination, toute
> diffusion ou toute publication, totale ou partielle, est interdite, sauf
> autorisation expresse de l expediteur.
> Les communications sur Internet n etant pas securisees, DOCAPOST BPO
> informe qu elle ne peut accepter aucune responsabilite quant au contenu de
> ce message.
>



-- 
Sincerely
*Boris Horvat*


NullPointer when refreshing a page with a table inside a zone

2013-09-12 Thread ANDRE Christophe
Hi,

I have the following zone with table inside :




   ...


 There is nothing




And the following form :






After updating the zone using ajax like this:

@Property
private BeanModel model;

@Inject
private BeanModelSource beanModelSource;

@OnEvent(value="success", component = " myForm ")
public void processForm() throws Exception {
   model = 
beanModelSource.createDisplayModel(myObject.class, resources.getMessages());
...
ajaxResponseRenderer.addRender("myZone ", myZone.getBody());
}


My zone get updated and the table become visible.
But I get a Null pointer if I refresh the page or when a redirection is done on 
this page:
Caused by: java.lang.NullPointerException
at 
org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java:112)
at 
org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java)
at 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.invokeComponent(ComponentPageElementImpl.java:174)
at 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:133)

What am I doing wrong?
(Also I have the feeling the page is not fully reloaded when the page is 
refreshed!?)

Thx


Christophe

Ce message et toutes les pieces jointes (ci apres le message) sont etablis a l 
intention exclusive de leurs destinataires.
Si vous recevez ce message par erreur, merci de le detruire et d en avertir 
immediatement l expediteur par e mail.
Toute utilisation de ce message non conforme a sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf autorisation 
expresse de l expediteur.
Les communications sur Internet n etant pas securisees, DOCAPOST BPO informe qu 
elle ne peut accepter aucune responsabilite quant au contenu de ce message.


Re: Looking for a "grouped table" component

2013-09-07 Thread Tobonaut
Hi Lance,
thanks! I'll have a look!

Regards,


On Sep 7, 2013, at 8:41 AM, Lance Java  wrote:

> It's not exactly what you're looking for but it's worth a mention. Perhaps
> my GridCollapse mixin can give some inspiration.
> 
> http://tapestry-stitch.uklance.cloudbees.net/gridcollapsedemo
> On 6 Sep 2013 18:52, "Tobonaut"  wrote:
> 
>> Good evening folks,
>> 
>> I've been looking for a table component which includes grouping. Like a
>> treetable with dynamic grouping, filtering, etc.
>> 
>> I crawled the mailing list and google to find a solution but it was not
>> successful.
>> 
>> May you know how I can solve my problem.
>> 
>> I hope the following image helps to clarify my problem. I want to achieve
>> the following control with Tapestry "stuff":
>> https://dl.dropboxusercontent.com/u/4104316/Share/example.png
>> 
>> Thanks a lot.
>> 
>> Regards,
>> - Tob
>> 
>> 
>> -
>> 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: Looking for a "grouped table" component

2013-09-06 Thread Lance Java
It's not exactly what you're looking for but it's worth a mention. Perhaps
my GridCollapse mixin can give some inspiration.

http://tapestry-stitch.uklance.cloudbees.net/gridcollapsedemo
 On 6 Sep 2013 18:52, "Tobonaut"  wrote:

> Good evening folks,
>
> I've been looking for a table component which includes grouping. Like a
> treetable with dynamic grouping, filtering, etc.
>
> I crawled the mailing list and google to find a solution but it was not
> successful.
>
> May you know how I can solve my problem.
>
> I hope the following image helps to clarify my problem. I want to achieve
> the following control with Tapestry "stuff":
> https://dl.dropboxusercontent.com/u/4104316/Share/example.png
>
> Thanks a lot.
>
> Regards,
> - Tob
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Looking for a "grouped table" component

2013-09-06 Thread Tobonaut
Good evening folks,

I've been looking for a table component which includes grouping. Like a 
treetable with dynamic grouping, filtering, etc.

I crawled the mailing list and google to find a solution but it was not 
successful.

May you know how I can solve my problem.

I hope the following image helps to clarify my problem. I want to achieve the 
following control with Tapestry "stuff": 
https://dl.dropboxusercontent.com/u/4104316/Share/example.png

Thanks a lot.

Regards,
- Tob


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



Re: AJAX updating table row

2012-11-30 Thread Geoff Callender
In onDeactivate(Long serviceID), get the service! Tapestry is trying to render 
the row so it can send it back in the response - so it needs the service.

Cheers,

Geoff

On 01/12/2012, at 4:01 AM, Pillar wrote:

> Hey! Always more questions!
> 
> I'm following this example:  Ajax EventLinks in a Loop
> <http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/eventlinksinaloop>
>  
> . I've modified some code to fit my use case. I have a table that uses a
> t:loop to iterate through services and show if they are activated. I then
> have eventlinks to activate/deactivate services. My server code writes to a
> database based on the eventlink clicked. Here are parts of the code (dunno
> how to post html):
> 
>
> <(tr) t:type = "Zone" t:id = "rowZone" id = "currentRowZoneId" t:update =
> "show">
> <(td)>${service.name}<(/td)>
> <(a) t:type = "eventlink" t:event = "deactivate" t:context =
> "service.serviceID" t:zone = "^" href = "#">Deactivate<(/a)>
> 
> My java:
> 
>   private List services;
>   
>   @InjectComponent
>   private Zone rowZone;
>   
>   @Inject
>   private Request request;
>   
>   @Inject
>   private AjaxResponseRenderer ajaxResponseRenderer;
>   
>   @Property
>   private Service service;
>   
>   void setupRender() {
>   services = getServices();
>   }
>   
>   public boolean getIsActivated() {
>   User u = getUser();
>   for (UserService us : u.getUserServices()) {
>   if (us.getService().getServiceID() == 
> service.getServiceID())
>   return true;
>   }
>   return false;
>   }
> 
>   public List getServices() {
>   if (services == null) {
>   services = serviceDao.findAll();
>   }
>   return services;
>   }
>   
>   public void onDeactivate(Long serviceID) {
>   UserService us = 
> userServiceDao.findByUserIdAndServiceId(currentUserID,
> serviceID);
>   userServiceDao.delete(us.getUserserviceID());   
>   
>   if (request.isXHR()) {
>   ajaxResponseRenderer.addRender(rowZone);
>   }
>   }
>   
>   public String getCurrentRowZoneId() {
>   return "rowZone_" + service.getServiceID();
>   }
> 
> So when the eventlink is clicked, the onDeactivate() method gets called with
> serviceID as context. This removes the userservice from the db and calls
> addRender() on the rowZone. I immediately get this error:
> 
> Render queue error in Expansion[PropBinding[expansion
> service/ActivationAjax(service.name)]]: Property 'service' (within property
> expression 'service.name', of
> org.synchronica.example.pages.service.ServiceActivationAjax@53e1b8fb) is
> null.
> 
> Since ajax is only making the specific row to update, we aren't looping
> again so how does it know which service (thus NPE)? In the tutorial I posted
> above, it works fine. Any ideas?
> 
> 
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/AJAX-updating-table-row-tp5718433.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> -
> 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: AJAX updating table row

2012-11-30 Thread Paul Stanton
each ajax request is still a new request and therefore properties in 
your page class are lost from the previous render.


unless you mark them as @Persist.

but in your case, your `service` property is set by the loop component. 
this is not going to be "emmulated" by the ajax request processing since 
you are just updating the 'insides' of one iteration of the loop.


you will need to use your context parameters or some other mechanism to 
set your "service" value for each subsequent ajax request.


p.

On 1/12/2012 4:01 AM, Pillar wrote:

Hey! Always more questions!

I'm following this example:  Ajax EventLinks in a Loop
<http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/eventlinksinaloop>
. I've modified some code to fit my use case. I have a table that uses a
t:loop to iterate through services and show if they are activated. I then
have eventlinks to activate/deactivate services. My server code writes to a
database based on the eventlink clicked. Here are parts of the code (dunno
how to post html):


<(tr) t:type = "Zone" t:id = "rowZone" id = "currentRowZoneId" t:update =
"show">
<(td)>${service.name}<(/td)>
<(a) t:type = "eventlink" t:event = "deactivate" t:context =
"service.serviceID" t:zone = "^" href = "#">Deactivate<(/a)>

My java:

private List services;

@InjectComponent
private Zone rowZone;

@Inject
private Request request;

@Inject
private AjaxResponseRenderer ajaxResponseRenderer;

@Property
private Service service;

void setupRender() {
services = getServices();
}

public boolean getIsActivated() {
User u = getUser();
for (UserService us : u.getUserServices()) {
if (us.getService().getServiceID() == 
service.getServiceID())
return true;
}
return false;
}

public List getServices() {
if (services == null) {
services = serviceDao.findAll();
}
return services;
}

public void onDeactivate(Long serviceID) {
UserService us = 
userServiceDao.findByUserIdAndServiceId(currentUserID,
serviceID);
userServiceDao.delete(us.getUserserviceID());   

if (request.isXHR()) {
ajaxResponseRenderer.addRender(rowZone);
}
}

public String getCurrentRowZoneId() {
return "rowZone_" + service.getServiceID();
}

So when the eventlink is clicked, the onDeactivate() method gets called with
serviceID as context. This removes the userservice from the db and calls
addRender() on the rowZone. I immediately get this error:

Render queue error in Expansion[PropBinding[expansion
service/ActivationAjax(service.name)]]: Property 'service' (within property
expression 'service.name', of
org.synchronica.example.pages.service.ServiceActivationAjax@53e1b8fb) is
null.

Since ajax is only making the specific row to update, we aren't looping
again so how does it know which service (thus NPE)? In the tutorial I posted
above, it works fine. Any ideas?



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/AJAX-updating-table-row-tp5718433.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
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



AJAX updating table row

2012-11-30 Thread Pillar
Hey! Always more questions!

I'm following this example:  Ajax EventLinks in a Loop
<http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/eventlinksinaloop>
 
. I've modified some code to fit my use case. I have a table that uses a
t:loop to iterate through services and show if they are activated. I then
have eventlinks to activate/deactivate services. My server code writes to a
database based on the eventlink clicked. Here are parts of the code (dunno
how to post html):

   
<(tr) t:type = "Zone" t:id = "rowZone" id = "currentRowZoneId" t:update =
"show">
<(td)>${service.name}<(/td)>
<(a) t:type = "eventlink" t:event = "deactivate" t:context =
"service.serviceID" t:zone = "^" href = "#">Deactivate<(/a)>

My java:

private List services;

@InjectComponent
private Zone rowZone;

@Inject
private Request request;

@Inject
private AjaxResponseRenderer ajaxResponseRenderer;

@Property
private Service service;

void setupRender() {
services = getServices();
}

public boolean getIsActivated() {
User u = getUser();
for (UserService us : u.getUserServices()) {
if (us.getService().getServiceID() == 
service.getServiceID())
return true;
}
return false;
}

public List getServices() {
if (services == null) {
services = serviceDao.findAll();
}
return services;
}

public void onDeactivate(Long serviceID) {
UserService us = 
userServiceDao.findByUserIdAndServiceId(currentUserID,
serviceID);
userServiceDao.delete(us.getUserserviceID());   

if (request.isXHR()) {
ajaxResponseRenderer.addRender(rowZone);
}
}

public String getCurrentRowZoneId() {
return "rowZone_" + service.getServiceID();
}

So when the eventlink is clicked, the onDeactivate() method gets called with
serviceID as context. This removes the userservice from the db and calls
addRender() on the rowZone. I immediately get this error:

Render queue error in Expansion[PropBinding[expansion
service/ActivationAjax(service.name)]]: Property 'service' (within property
expression 'service.name', of
org.synchronica.example.pages.service.ServiceActivationAjax@53e1b8fb) is
null.

Since ajax is only making the specific row to update, we aren't looping
again so how does it know which service (thus NPE)? In the tutorial I posted
above, it works fine. Any ideas?



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/AJAX-updating-table-row-tp5718433.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Render whole table grid row as a link?

2012-11-11 Thread Lance Java
I've just written a GridDecorator mixin that allows you to decorate rows or
cells in a grid. The code can be found here:
https://github.com/uklance/tapestry-stitch/blob/master/src/main/java/org/lazan/t5/stitch/mixins/GridDecorator.java

A demo can be found here with examples for RowDecorator and CellDecorator:
https://github.com/uklance/tapestry-stitch-demo/blob/master/src/main/java/org/lazan/t5/stitch/demo/pages/GridDecoratorDemo.java
https://github.com/uklance/tapestry-stitch-demo/blob/master/src/main/resources/org/lazan/t5/stitch/demo/pages/GridDecoratorDemo.tml

Cheers,
Lance.






--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Render-whole-table-grid-row-as-a-link-tp5717388p5717913.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Render whole table grid row as a link?

2012-11-11 Thread Lance Java
Well, I'm sure you're a smart guy and can figure out how to get the tbody.
The mixin will fire after the grid component has rendered. The grid renders
a table inside a div so you will need to do something like:

List topChildren =  writer.getElement().getChildren(); 
Element div = (Element) topChildren.get(topChildren.size() - 1); 
Element tbody = div.find("table/tbody"); 



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Render-whole-table-grid-row-as-a-link-tp5717388p5717909.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Shorten CSS selector styles for table grid?

2012-11-09 Thread Pavel Vodenski
You can use a richer language like LESS or SASS to write e. g.:

.a {
 color: red;
 .b {
font-weight: bold;
  }

 .c {
  height: 1px;
 }
}

instead of

.a {
 c: r;
}

.a .b {
 f-w: b;
}

.a .c {
 h: 1px;
}


Cheers,
- P

On Fri, Nov 9, 2012 at 5:43 AM, membersound  wrote:

> OK I thought it where a T5 question as T somehow forces us to use those
> selector statements by the way the framework is build. So I thought I'd get
> answers on this more quickly here...
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Shorten-CSS-selector-styles-for-table-grid-tp5717859p5717861.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Render whole table grid row as a link?

2012-11-09 Thread membersound
va:95)
 
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)
 
org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:119)
 
$RequestHandler_966117cd8f52.service(Unknown Source) 
$RequestHandler_966117cd8f44.service(Unknown Source) 
org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:253)
 
org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53) 
$HttpServletRequestHandler_966117cd8f46.service(Unknown Source) 
org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44)
 
$HttpServletRequestHandler_966117cd8f46.service(Unknown Source) 
org.got5.tapestry5.jquery.services.AjaxUploadServletRequestFilter.service(AjaxUploadServletRequestFilter.java:26)
 
$HttpServletRequestHandler_966117cd8f46.service(Unknown Source) 
org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
 
$HttpServletRequestFilter_966117cd8f42.service(Unknown Source) 
$HttpServletRequestHandler_966117cd8f46.service(Unknown Source) 
org.apache.tapestry5.services.TapestryModule$1.service(TapestryModule.java:852) 
$HttpServletRequestHandler_966117cd8f46.service(Unknown Source) 
$HttpServletRequestHandler_966117cd8f3f.service(Unknown Source) 
org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:171) 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
 
org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45) 
org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45) 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
 
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) 
java.lang.Thread.run(Thread.java:722) 




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Render-whole-table-grid-row-as-a-link-tp5717388p5717893.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Shorten CSS selector styles for table grid?

2012-11-09 Thread membersound
OK I thought it where a T5 question as T somehow forces us to use those
selector statements by the way the framework is build. So I thought I'd get
answers on this more quickly here...



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Shorten-CSS-selector-styles-for-table-grid-tp5717859p5717861.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Shorten CSS selector styles for table grid?

2012-11-09 Thread Thiago H de Paula Figueiredo
This is a pure CSS question, so it's off-topic here. This is actually a  
mailing list, not a forum (Nabble is just a forum interface for the  
mailing list, and a good one), so we, subscribers of the Tapestry users  
mailing list, we want to receive in our e-mail inboxes messages that are  
about Tapestry in some way of another, and this question isn't about  
Tapestry at all. It's about CSS selectors and nothing else.


I know you're getting tired of reading me asking people to avoid off-topic  
questions, but they keep coming and I don't want to see people  
unsubscribing to this list because of that.


--
Thiago H. de Paula Figueiredo

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



Shorten CSS selector styles for table grid?

2012-11-09 Thread membersound
I want to style serveral grid columns differently. How can I shorten these
expressions?
I always need the prefix "table.t-data-grid thead tr th.", followed by the
specific property. Can't I just specify that prefix and after list all
property classes that shoud be matched?
Or do I always have to write the full selector statement like:

table.t-data-grid thead tr th.depot, table.t-data-grid thead tr th.amount
... {

}

Thanks



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Shorten-CSS-selector-styles-for-table-grid-tp5717859.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Render whole table grid row as a link?

2012-11-01 Thread Lance Java
Well the code I gave you was untested you could do a bit of debugging
yourself ;)

List topChildren =  writer.getElement().getChildren();
Element div = (Element) topChildren.get(topChildren.size() - 1);
Element tbody = div.find("tbody");




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Render-whole-table-grid-row-as-a-link-tp5717388p5717521.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Render whole table grid row as a link?

2012-11-01 Thread membersound
)
at $RequestHandler_12e596b699ea7.service(Unknown Source)
at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:105)
at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:95)
at
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)
at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:119)
at $RequestHandler_12e596b699ea7.service(Unknown Source)
at $RequestHandler_12e596b699e9b.service(Unknown Source)
at
org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:253)
at
org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)
at $HttpServletRequestHandler_12e596b699e9d.service(Unknown Source)
at
org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
at $HttpServletRequestFilter_12e596b699e99.service(Unknown Source)
at $HttpServletRequestHandler_12e596b699e9d.service(Unknown Source)
at
org.apache.tapestry5.services.TapestryModule$1.service(TapestryModule.java:852)
at $HttpServletRequestHandler_12e596b699e9d.service(Unknown Source)
at $HttpServletRequestHandler_12e596b699e98.service(Unknown Source)
at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:171)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException
at mixins.RowEvent.afterRender(RowEvent.java:36)
at mixins.RowEvent.afterRender(RowEvent.java)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AfterRenderPhase.invokeComponent(ComponentPageElementImpl.java:375)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:143)
... 87 more




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Render-whole-table-grid-row-as-a-link-tp5717388p5717519.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Render whole table grid row as a link?

2012-11-01 Thread Lance Java
Tapestry is interpreting the event as a property on your page. Change the
default binding prefix for the property to LITERAL:

@Parameter(required=true, defaultPrefix=BindingConstants.LITERAL) 
private String event; 



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Render-whole-table-grid-row-as-a-link-tp5717388p5717515.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Render whole table grid row as a link?

2012-11-01 Thread Lance Java
When tapestry starts, it lists the registered components and mixins... Is the
mixin listed in the logs?
Do you have other custom components that are working?
Does the mixin code live inside the webapp?
Or is the mixin part of a component library?
(http://tapestry.apache.org/component-libraries.html)
Have you given tapestry the info it needs to be able to find the mixin (ie
the basepackage)



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Render-whole-table-grid-row-as-a-link-tp5717388p5717514.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Render whole table grid row as a link?

2012-11-01 Thread membersound
OK i placed it in the mixins package, and /now/ Tapestry complains about
missing rowEvent class :(



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Render-whole-table-grid-row-as-a-link-tp5717388p5717513.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Render whole table grid row as a link?

2012-11-01 Thread Lance Java
> where do I have to place the mixin? I placed it into /components.
Mixins must live in basepackage.mixins
(http://tapestry.apache.org/component-mixins.html)

> RowType is the object that is displayed in the grid? Eg
> onRowClick(UserProfile user)?
Correct, it is the collection type backing the grid

> I implemented it that way, but rowclicks are not recognized at all.
I'm assuming you are at the stage where tapestry is complaining about a
missing mixin named "rowEvent"?



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Render-whole-table-grid-row-as-a-link-tp5717388p5717510.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Render whole table grid row as a link?

2012-11-01 Thread membersound
Could you provide more input on that?
This looks great, but cannot get it working.

-where do I have to place the mixin? I placed it into /components.
-RowType is the object that is displayed in the grid? Eg
onRowClick(UserProfile user)?

I implemented it that way, but rowclicks are not recognized at all.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Render-whole-table-grid-row-as-a-link-tp5717388p5717506.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Only update specific table zone on delete of object?

2012-10-30 Thread Lance Java
If you explicitly set the (clientside) id, tapestry will not auto-generate
one.
eg 



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Only-update-specific-table-zone-on-delete-of-object-tp5717407p5717423.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Only update specific table zone on delete of object?

2012-10-30 Thread membersound
I'm not getting this error anymore, though I don't know what is different
now.
Anyhow, the zone update is not working.

Now I'm getting a red tapestry notification which points me to inner zones
like:
> Could not find zone element 'showRoom' to update on click of element
> 'eventlink_4_13ab23fef82'.





DEL#



..



So it seems that a zone update by an eventlink for an outer zone messes up
inner zones. How could I avoid this?



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Only-update-specific-table-zone-on-delete-of-object-tp5717407p5717422.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Only update specific table zone on delete of object?

2012-10-30 Thread Thiago H de Paula Figueiredo

Hi!

On Tue, 30 Oct 2012 07:28:14 -0200, membersound  wrote:


Result:
org.apache.tapestry5.runtime.ComponentEventException
Render queue error in SetupRender[UserPage:grid.columns]: Bean editor  
model for User already contains a property model for property 'action'.


Full stack trace and code that creates the BeanModel please.

--
Thiago H. de Paula Figueiredo

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



Only update specific table zone on delete of object?

2012-10-30 Thread membersound
I want to delete an object within a table grid, and after that only update
the table itself, but not the rest of the page.

UserPage.tml:
 Heading 


DEL






UserPage (excerpt):

@InjectComponent
Zone outer;

onDelete(long id) {
dao.delete(id);
return outer.getBody();
}


Result:
org.apache.tapestry5.runtime.ComponentEventException
Render queue error in SetupRender[UserPage:grid.columns]: Bean editor model
for User already contains a property model for property 'action'.




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Only-update-specific-table-zone-on-delete-of-object-tp5717407.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Render whole table grid row as a link?

2012-10-29 Thread Lance Java
Something like this:

@MixinAfter
public class RowEvent {
@InjectContainer
private Grid grid;

@Inject
private JavaScriptSupport jss;

@Inject
private ComponentResources componentResrouces;

@Parameter(required=true)
private String event;

public void afterRender(MarkupWriter writer) {
GridDataSource dataSource = grid.getDataSource();
Element tbody = writer.getElement().find("tbody");
List children = tbody.getChildren();
for (int i = 0; i < children.size(); ++i) {
Element tr = (Element) children.get(i);
String rowId = jss.allocateClientId("row");

// give each row an id
tr.attribute("id", rowId); 

// this will be passed as a parameter to the serverside 
event
Object rowContext = dataSource.getRowValue(i);

// this event will bubble up to the containing page / 
component
Link eventLink = 
componentResrouces.createEventLink(event, rowContext);

// observe the 'click' event and fire the eventlink
jss.addScript("Event.observe('%s', 'click', function() {
window.location.href = '%s' })", rowId, eventLink);
}
}
}

Usage:


public void onRowClicked(RowType rowContext) {
   // do stuff
}



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Render-whole-table-grid-row-as-a-link-tp5717388p5717399.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Render whole table grid row as a link?

2012-10-29 Thread Lance Java
This might be best handled by a mixin to the grid. The mixin would:
1. Add an id to each row in the html table markup
2. Generate an event URL for each row using
ComponentResources.createEventLink();
3. Attach an observer to each row (using the row id) which listens to the
"click" event and fires the event URL.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Render-whole-table-grid-row-as-a-link-tp5717388p5717393.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Render whole table grid row as a link?

2012-10-29 Thread membersound
Hi,

is it possible to just make a whole row of a table grid clickable?
I know how to apply a t:pagelink to the text of a specific entry. But for
this the link is only executed if I click on the text directly. How can I
just click somewhere on that row?

Or is this ever possible?
Thanks



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Render-whole-table-grid-row-as-a-link-tp5717388.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Table with custom columns?

2012-10-27 Thread Jay Ginete
t:table component? You probably mean a Grid component 
(http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Grid.html)


And to add a custom row is like this:



${totalqty}



In your page class there should be a method called getTotalqty().


@Property
private List products;

@Property
private Product product;

private double totalqty;

public double getTotalqty(){
return product.price * product.quantity;
}

On 10/27/2012 4:53 PM, membersound wrote:

Hi,

how can I add custom columns to a t:table component? I mean data that is not
a variable in the class that is displayed. Like parameters that are to be
calculated based on data found in the object to display.

Like:
A product has a price and a quantity variable. How could I display an
additional column like price*quantity?

Thanks



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Table-with-custom-columns-tp5717326.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
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



Table with custom columns?

2012-10-27 Thread membersound
Hi,

how can I add custom columns to a t:table component? I mean data that is not
a variable in the class that is displayed. Like parameters that are to be
calculated based on data found in the object to display.

Like:
A product has a price and a quantity variable. How could I display an
additional column like price*quantity?

Thanks



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Table-with-custom-columns-tp5717326.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: cannot output table tags in outputraw compnnent

2012-09-29 Thread Thiago H de Paula Figueiredo
On Sat, 29 Sep 2012 02:00:17 -0300, Ken in Nashua   
wrote:




Folks,

If the output and outputraw components cannot contain a left angel  
bracket <


or other angle brackets

ex.

Then I am left with doing this...



But if yeilds the following exception

java.lang.RuntimeExceptionError parsing property expression '':  
Unable to parse input at character position 1.

Does anyone know how to output table tags in my template ?


Tapestry 5 templates must be valid XML documents and XML doesn't allow the  
< and > characters in attribute values. Properly escape them and it will  
work. By the way, I have no idea why you're using OutputRaw to output  
static content.


--
Thiago H. de Paula Figueiredo

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



RE: cannot output table tags in outputraw compnnent

2012-09-29 Thread Ken in Nashua

Thanks Guys for the help... both your solutions I know will work as I woke up 
this morning thinking of same.

Yeah you cant just do straight markup in the tml... it destabilises the IF 
component

org.xml.sax.SAXParseExceptionThe element type "t:If" must be terminated by the 
matching end-tag "".
have nice weekend

kcola...@live.com

  

Re: cannot output table tags in outputraw compnnent

2012-09-29 Thread mailingl...@j-b-s.de
I do not understand what you are trying to achieve
> 
in a template is identically to  right? There is no need to wrap html 
elements inside outputraw within a template. Use output raw to stream html from 
your page class, for example assume you have a preformated product description 
Incl bold, underline, whatever as a string object than:

In java page
public String getProductDescription() {
   return "headertext text text...";
}

In your tml:


Jens

Von meinem iPad gesendet

Am 29.09.2012 um 07:00 schrieb Ken in Nashua :

> 
> Folks,
> 
> If the output and outputraw components cannot contain a left angel bracket <
> 
> or other angle brackets
> 
> ex. 
> 
> Then I am left with doing this...
> 
>  
> 
> But if yeilds the following exception
> 
> java.lang.RuntimeExceptionError parsing property expression '': 
> Unable to parse input at character position 1.
> Does anyone know how to output table tags in my template ?
> 
> Thanks
> 
> kcola...@live.com
> 
> 
> 

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



Re: cannot output table tags in outputraw compnnent

2012-09-29 Thread Shing Hing Man
The following works.


In .tml:
  

  ${myTag}


In .java : 
public String getMyTag(){
        return "";
    }



Alternatively, you could put your tag in the .properties file :
${message:myTag}

.properties:
myTag=



Shing 


- Original Message -
From: Ken in Nashua 
To: users@tapestry.apache.org
Cc: 
Sent: Saturday, September 29, 2012 6:00 AM
Subject: cannot output table tags in outputraw compnnent


Folks,

If the output and outputraw components cannot contain a left angel bracket <

or other angle brackets

ex.     

Then I am left with doing this...

 

But if yeilds the following exception

java.lang.RuntimeExceptionError parsing property expression '': Unable 
to parse input at character position 1.
Does anyone know how to output table tags in my template ?

Thanks

kcola...@live.com

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



cannot output table tags in outputraw compnnent

2012-09-28 Thread Ken in Nashua

Folks,

If the output and outputraw components cannot contain a left angel bracket <

or other angle brackets

ex. 

Then I am left with doing this...

 

But if yeilds the following exception

java.lang.RuntimeExceptionError parsing property expression '': Unable 
to parse input at character position 1.
Does anyone know how to output table tags in my template ?

Thanks

kcola...@live.com
 

  

Re: How to avoid ul turning into table?

2012-08-13 Thread TG
Thanks, works like a charm!



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-avoid-ul-turning-into-table-tp5715372p5715377.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: How to avoid ul turning into table?

2012-08-13 Thread Thiago H de Paula Figueiredo

On Mon, 13 Aug 2012 21:05:47 -0300, TG  wrote:


I am trying to create a iui list using tapestry. I used -



${SR.id}
 http://${hostName}/go/${SR.service} 


But this is still renders as a table. How do I "turned off" the table
rendering? And just let the output be a unordered list?


Please post the generated HTML. As Pavel noted, the Loop component doesn't  
have an include component. Are you sure you aren't using Grid instead of  
Loop?


[written before I noticed the template snippet above didn't use Grid]
Grid will always render as a table. After all, its name is 'Grid' and  
grids are two-dimensional things, while lists are one-dimensional. As  
Pavel suggested, you can use a Loop instead and render whatever you want.


--
Thiago H. de Paula Figueiredo

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



Re: How to avoid ul turning into table?

2012-08-13 Thread Pavel Vodenski
You should use
http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Loop.htmlwhich
works similar to Grid but does not imply rows or cells. Your source
and value parameters are still correct, and you no longer need the include
parameter.

- P

On Mon, Aug 13, 2012 at 5:05 PM, TG  wrote:

> I am trying to create a iui list using tapestry. I used -
>
> 
>  t:value="SR"
> include="id,service">
>  context="SR.id">${SR.id}
>  http://${hostName}/go/${SR.service}  t:value="SR.service" />
>     
> 
>
>
> But this is still renders as a table. How do I "turned off" the table
> rendering? And just let the output be a unordered list?
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/How-to-avoid-ul-turning-into-table-tp5715372.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


How to avoid ul turning into table?

2012-08-13 Thread TG
I am trying to create a iui list using tapestry. I used -



${SR.id}
 http://${hostName}/go/${SR.service}  




But this is still renders as a table. How do I "turned off" the table
rendering? And just let the output be a unordered list?



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-avoid-ul-turning-into-table-tp5715372.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Possible to build a Table from multiple sources?

2012-05-04 Thread Thiago H. de Paula Figueiredo

On Fri, 04 May 2012 12:48:43 -0300, Az Madu  wrote:


java.lang.reflect.InvocationTargetExceptiontargetExceptionorg.apache.tapestry5.ioc.internal.OperationException:
Unable to create new accessor method public int getPosition() on class
com.sony.otg.c3demoapp.pages.DoStuff as the method is already  
implemented.

I read somewhere that Tapestry will create get/set methods that are not
present but since I have provided them why do I get this error?


It looks like you marked the field position with @Property. If you're  
going to write the getter and/or setter yourself for a given field, don't  
use @Property on it.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Possible to build a Table from multiple sources?

2012-05-04 Thread Az Madu
With all distractions I have right now I haven't had a lot of time to
finish my table, but I got back to it and followed advise from you guys and
a similar example to my own which seems very straight forward.

I'm following the 'Grid row highlighter
demo<http://lombok.demon.co.uk/tapestry5Demo/test/mixins/gridrowhighlighterdemo>'
by  Shing Hing Man to construct my table with a few ommissions (don't need
cell highlighting for example),  however,  on creating my beanmodel (which
has only getMethods and setMethods and the respective instance members when
I try to execute/run my project I get the following exceptions:

java.lang.RuntimeException
Exception assembling root component of page LeaderboardPage: Unable to
instantiate instance of transformed class
com.sony.otg.c3demoapp.pages.DoStuffPage:
java.lang.reflect.InvocationTargetException

which is caused by:

java.lang.reflect.InvocationTargetExceptiontargetExceptionorg.apache.tapestry5.ioc.internal.OperationException:
Unable to create new accessor method public int getPosition() on class
com.sony.otg.c3demoapp.pages.DoStuff as the method is already implemented.
I read somewhere that Tapestry will create get/set methods that are not
present but since I have provided them why do I get this error?  Commenting
them out is not an option because in my class Decode (which parses my Json
input) I call setMethodName (and getMethodName) for each of the items I
retrieve from the Json object.  I would also have to omit the getMethods as
well and this would leave my beanmodel pretty empty and I don't see what
I'm doing wrong.

If I compare this example with the 'Grid' example on jumpstart then I see
that the @Entity annotation is being used along with 'implements
Serializeable'.  The 'Grid row demo' doesn't use either of these and so I'm
a bit confused as to which is the 'correct' way to go.

So my questions are:

1 - Why does Tapestry complain if I implement getMethodName/setMethodName ?
2 - Should I Serialize my class and annotate it with @Entity?
3 - Both of the two examples create a table/grid when the page loads
using pageLoaded()
or setupRender() calls, but I only want a table generated onClick from a
link I have on the page.  Is it good practice to do this using an Event
Link that will then render my table on the same page?

Again, thanks for any responses/support from the Tapestry Users.

Regards

Az


On Thu, Apr 26, 2012 at 11:52 AM, Az Madu  wrote:

> Thanks Lance/Thiago for your suggestions, I'm looking into doing that now.
>
> Regards
>
> Az
>
>
> On Thu, Apr 26, 2012 at 11:26 AM, Lance Java wrote:
>
>> If I understand correctly, you read your data into multiple lists. To read
>> a single record, you use the same index in each list... Correct?
>>
>> This sort of model often leads to a maintenance nightmare.
>>
>> Create a bean which represents a single row in the grid and read your data
>> into a single list.  You'll thank me in the future ;)
>>
>
>


Re: Possible to build a Table from multiple sources?

2012-04-26 Thread Az Madu
Thanks Lance/Thiago for your suggestions, I'm looking into doing that now.

Regards

Az

On Thu, Apr 26, 2012 at 11:26 AM, Lance Java wrote:

> If I understand correctly, you read your data into multiple lists. To read
> a single record, you use the same index in each list... Correct?
>
> This sort of model often leads to a maintenance nightmare.
>
> Create a bean which represents a single row in the grid and read your data
> into a single list.  You'll thank me in the future ;)
>


Re: Possible to build a Table from multiple sources?

2012-04-26 Thread Lance Java
If I understand correctly, you read your data into multiple lists. To read
a single record, you use the same index in each list... Correct?

This sort of model often leads to a maintenance nightmare.

Create a bean which represents a single row in the grid and read your data
into a single list.  You'll thank me in the future ;)


Re: Possible to build a Table from multiple sources?

2012-04-26 Thread Az Madu
I want simply to display data in tabular format with 3 or more headers,
currently I'm just experimenting with the three in my tml file (Position,
UUID, Result) and I may want to add an Id column (assigned or auto) as the
first column, similar to the Loop example on
http://jumpstart.doublenegative.com.au (it's currently reporting a 503 so I
can't give you the exact link).




On Wed, Apr 25, 2012 at 6:00 PM, ICE Ernesto Arteaga Zavala <
arterza...@gmail.com> wrote:

> How do you really want to display your info?
>
> Provide an example...
>
>
>
> 2012/4/25 Az Madu 
>
> > Hi guys,
> >
> > I'm trying to construct a table (Tapestry 5) unsuccessfully so far, and
> > have been scouring the forums (Nabble) and elswhere for examples on
> > building a table.  So far it appears that it's only possible using a
> single
> > source (is that the only way?) either for a Loop, or Grid as demonstrated
> > on Jumpstart (I'm not using EJB).
> >
> > The data I want to display has come from a Json object which I've
> > decoded/parsed and have used Jackson Tree structure to read the data and
> it
> > contains elements that I've read into Lists of either String, Integer and
> > Long as follows:
> >
> >
> > package com.blah.blah.blah.services;
> >
> > @Entity
> > public class Decode implements Serializable{
> >
> > private DefaultHttpClient httpClient = new DefaultHttpClient();
> > private final static ObjectMapper mapper = new ObjectMapper();
> >
> > @Column
> > private List position;
> > @Column
> > private List uuid;
> >
> >
> > public void setPosition(List positionList) {
> > this.position = positionList;
> > }
> > public List getPosition() {
> > return position;
> > }
> >
> > public List getUuid(){
> >return uuid;
> > }
> > public void setUuid(List uuid){
> > this.uuid = uuid;
> > }
> >
> > public URL parseJson(String url){
> > ...
> > ...Http stuff here
> > ...
> > try{
> > ...
> > ...I/O stuff here
> > ...
> >   JsonNode root = fileNode.get("items");
> >
> >   Iterator i = root.iterator();
> >   while (i.hasNext()) {
> >JsonNode element = i.next();
> >// get the elements
> >int position = element.get("position").asInt();
> >String uuid = element.get("entrant").get("id").asText();
> >...
> >
> >List positionList = new ArrayList();
> >positionList.add(position);
> >setPosition(positionList);
> >
> >List uuidList = new ArrayList();
> >uuidList.add(uuid);
> >setUuid(uuidList);
> >
> >
> >   System.out.println("position: " + position + ", uuid" +
> > uuid);
> >   }
> >}
> > }
> >
> > I have the relevant get/set methods for the above and I have a class page
> > that I use to call this 'service' by way of an eventclick:
> >
> > package com.blah.blah.blah.pages
> >
> > public class Dostuff{
> >
> > private final String staticPage = "http://localhost:10065/blah/~.page";
> >
> > @Property
> > Decode decode = new Decode();
> >
> > @SuppressWarnings("unused")
> > @Property
> > private List position;
> >
> > @SuppressWarnings("unused")
> > @Property
> > private List uuid;
> >
> >
> >/**
> > * @return
> > * @throws MalformedURLException
> > */
> >URL onReturnURLViewPage() throws MalformedURLException {
> >return decode.parseJson(staticPage);
> >}
> > }
> >
> >
> > Dostuff.tml
> >  >  xmlns="http://www.w3.org/1999/xhtml";
> >  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
> >  xmlns:p="tapestry:parameter">
> >
> > Welcome to Test ${userName}
> > 
> >[
> > href="#">View
> > Page
> >]
> > 
> >  
> >
> >
> >Position
> >UUID
> >Result
> >
> >
> >
> >
>

Re: Possible to build a Table from multiple sources?

2012-04-25 Thread Thiago H. de Paula Figueiredo

On Wed, 25 Apr 2012 13:36:04 -0300, Az Madu  wrote:


Hi guys,


Hi!


I'm trying to construct a table (Tapestry 5) unsuccessfully so far, and
have been scouring the forums (Nabble) and elswhere for examples on
building a table.  So far it appears that it's only possible using a  
single source (is that the only way?) either for a Loop, or Grid as  
demonstrated

on Jumpstart (I'm not using EJB).


Have you thought about merging all this data in your page class?

Or implementing BeanModel yourself and passing it to Grid? There are some  
examples in the mailing list archives.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Possible to build a Table from multiple sources?

2012-04-25 Thread ICE Ernesto Arteaga Zavala
How do you really want to display your info?

Provide an example...



2012/4/25 Az Madu 

> Hi guys,
>
> I'm trying to construct a table (Tapestry 5) unsuccessfully so far, and
> have been scouring the forums (Nabble) and elswhere for examples on
> building a table.  So far it appears that it's only possible using a single
> source (is that the only way?) either for a Loop, or Grid as demonstrated
> on Jumpstart (I'm not using EJB).
>
> The data I want to display has come from a Json object which I've
> decoded/parsed and have used Jackson Tree structure to read the data and it
> contains elements that I've read into Lists of either String, Integer and
> Long as follows:
>
>
> package com.blah.blah.blah.services;
>
> @Entity
> public class Decode implements Serializable{
>
> private DefaultHttpClient httpClient = new DefaultHttpClient();
> private final static ObjectMapper mapper = new ObjectMapper();
>
> @Column
> private List position;
> @Column
> private List uuid;
>
>
> public void setPosition(List positionList) {
> this.position = positionList;
> }
> public List getPosition() {
> return position;
> }
>
> public List getUuid(){
>return uuid;
> }
> public void setUuid(List uuid){
> this.uuid = uuid;
> }
>
> public URL parseJson(String url){
> ...
> ...Http stuff here
> ...
> try{
> ...
> ...I/O stuff here
> ...
>   JsonNode root = fileNode.get("items");
>
>   Iterator i = root.iterator();
>   while (i.hasNext()) {
>JsonNode element = i.next();
>// get the elements
>int position = element.get("position").asInt();
>String uuid = element.get("entrant").get("id").asText();
>...
>
>List positionList = new ArrayList();
>positionList.add(position);
>setPosition(positionList);
>
>List uuidList = new ArrayList();
>uuidList.add(uuid);
>setUuid(uuidList);
>
>
>   System.out.println("position: " + position + ", uuid" +
> uuid);
>   }
>}
> }
>
> I have the relevant get/set methods for the above and I have a class page
> that I use to call this 'service' by way of an eventclick:
>
> package com.blah.blah.blah.pages
>
> public class Dostuff{
>
> private final String staticPage = "http://localhost:10065/blah/~.page";
>
> @Property
> Decode decode = new Decode();
>
> @SuppressWarnings("unused")
> @Property
> private List position;
>
> @SuppressWarnings("unused")
> @Property
> private List uuid;
>
>
>/**
> * @return
> * @throws MalformedURLException
> */
>URL onReturnURLViewPage() throws MalformedURLException {
>return decode.parseJson(staticPage);
>}
> }
>
>
> Dostuff.tml
>   xmlns="http://www.w3.org/1999/xhtml";
>  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
>  xmlns:p="tapestry:parameter">
>
> Welcome to Test ${userName}
> 
>[
>View
> Page
>]
> 
>  
>
>
>Position
>UUID
>Result
>
>
>
>
>position
>
>
>${uuid}
>
>
> 
>
> Following the examples on 'jumpstart' is really helpful but I've hit a
> brick wall with this since I'm not using EJB (why such a complicated
> example) and also my data from a json object is retireved as either String,
> Integer or Long and so on and therefore I end up with multiple List
> objects which all can be sources.
>
>
> Can I use these all as I've done because if I try to retireve all my data
> as List objects (I have tried this) then I'll get other problems
> such as Coercion Exceptions or othere errors that I don't know what they
> mean (I should have posted them here but it would make this post horrible
> to read) but as it stands right now the System.out prints exactly what I
> expect but I get no table being rendered.  I only have one head so please
> can someone stop me from bashing it in any more than I have done?
>
> Oh and just to clarify (if not already clear) my Json object can and will
> possibly contain hundreds of records from which I will need to parse and
> extract the same data types (String, Long, Integer etc) over and over and
> although they can be read as Strings that's not what their type is.
>
> Thanks in advance for any assistance/replies
>
> Regards
>
> Az
>


Possible to build a Table from multiple sources?

2012-04-25 Thread Az Madu
Hi guys,

I'm trying to construct a table (Tapestry 5) unsuccessfully so far, and
have been scouring the forums (Nabble) and elswhere for examples on
building a table.  So far it appears that it's only possible using a single
source (is that the only way?) either for a Loop, or Grid as demonstrated
on Jumpstart (I'm not using EJB).

The data I want to display has come from a Json object which I've
decoded/parsed and have used Jackson Tree structure to read the data and it
contains elements that I've read into Lists of either String, Integer and
Long as follows:


package com.blah.blah.blah.services;

@Entity
public class Decode implements Serializable{

private DefaultHttpClient httpClient = new DefaultHttpClient();
private final static ObjectMapper mapper = new ObjectMapper();

@Column
private List position;
@Column
private List uuid;


public void setPosition(List positionList) {
 this.position = positionList;
}
public List getPosition() {
 return position;
}

public List getUuid(){
return uuid;
}
public void setUuid(List uuid){
 this.uuid = uuid;
}

public URL parseJson(String url){
...
...Http stuff here
...
try{
...
...I/O stuff here
...
   JsonNode root = fileNode.get("items");

   Iterator i = root.iterator();
   while (i.hasNext()) {
JsonNode element = i.next();
// get the elements
int position = element.get("position").asInt();
String uuid = element.get("entrant").get("id").asText();
...

List positionList = new ArrayList();
positionList.add(position);
setPosition(positionList);

List uuidList = new ArrayList();
uuidList.add(uuid);
setUuid(uuidList);


   System.out.println("position: " + position + ", uuid" +
uuid);
   }
}
}

I have the relevant get/set methods for the above and I have a class page
that I use to call this 'service' by way of an eventclick:

package com.blah.blah.blah.pages

public class Dostuff{

private final String staticPage = "http://localhost:10065/blah/~.page";

@Property
Decode decode = new Decode();

@SuppressWarnings("unused")
@Property
private List position;

@SuppressWarnings("unused")
@Property
private List uuid;


/**
 * @return
 * @throws MalformedURLException
 */
URL onReturnURLViewPage() throws MalformedURLException {
return decode.parseJson(staticPage);
}
}


Dostuff.tml
http://www.w3.org/1999/xhtml";
  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
  xmlns:p="tapestry:parameter">

Welcome to Test ${userName}

[
View
Page
]

  


Position
UUID
Result




position


${uuid}


 

Following the examples on 'jumpstart' is really helpful but I've hit a
brick wall with this since I'm not using EJB (why such a complicated
example) and also my data from a json object is retireved as either String,
Integer or Long and so on and therefore I end up with multiple List
objects which all can be sources.


Can I use these all as I've done because if I try to retireve all my data
as List objects (I have tried this) then I'll get other problems
such as Coercion Exceptions or othere errors that I don't know what they
mean (I should have posted them here but it would make this post horrible
to read) but as it stands right now the System.out prints exactly what I
expect but I get no table being rendered.  I only have one head so please
can someone stop me from bashing it in any more than I have done?

Oh and just to clarify (if not already clear) my Json object can and will
possibly contain hundreds of records from which I will need to parse and
extract the same data types (String, Long, Integer etc) over and over and
although they can be read as Strings that's not what their type is.

Thanks in advance for any assistance/replies

Regards

Az


Re: how to get the index in tapestry loop and change background color of a table

2012-02-21 Thread karthi
I was just started to work in that way, but you saved my time!!

Thank you so much it works as expected

And your explanation is really very simple for beginners!!

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/how-to-get-the-index-in-tapestry-loop-and-change-background-color-of-a-table-tp5504289p5504375.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: how to get the index in tapestry loop and change background color of a table

2012-02-21 Thread Paul Stanton

1. use the 'index' attribute of loop:



2. add the indexProp to your page class

@Property private int indexProp;

3. use a property symbol for the appropriate style attribute (i'm 
assuming the )




4. implement the logic in your page class

public String getAlternateColour()
{
return indexProp % 2 == 0 ? "#CDCECC" : "#FF";
}

5. enjoy.

On 22/02/2012 5:31 PM, karthi wrote:

Hi,

I have used loop in my code to layout a table like structure and everything
works fine in that loop in UI (shows three rows with background color and
datas), However I have one doubt in that for all the three rows it shows the
same background color #CDCECC but I want to change the color like below

if (index%2 == 0) {
   style="background-color: #CDCECC"
} else {
   style="background-color: #FF"
}






${newsItem.imgUrl}




/ ${newsItem.pubDate} /


${newsItem.detailLink} ${newsItem.title}


${newsItem.description}


layout/images/next_new.gif





Please any one help me to achieve this??

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/how-to-get-the-index-in-tapestry-loop-and-change-background-color-of-a-table-tp5504289p5504289.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
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



how to get the index in tapestry loop and change background color of a table

2012-02-21 Thread karthi
Hi,
 
I have used loop in my code to layout a table like structure and everything
works fine in that loop in UI (shows three rows with background color and
datas), However I have one doubt in that for all the three rows it shows the
same background color #CDCECC but I want to change the color like below 

if (index%2 == 0) {
  style="background-color: #CDCECC"
} else {
  style="background-color: #FF"
}






${newsItem.imgUrl} 




/ ${newsItem.pubDate} /


${newsItem.detailLink} ${newsItem.title} 


${newsItem.description}


layout/images/next_new.gif 





Please any one help me to achieve this??

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/how-to-get-the-index-in-tapestry-loop-and-change-background-color-of-a-table-tp5504289p5504289.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: table

2011-09-28 Thread Thiago H. de Paula Figueiredo

On Wed, 28 Sep 2011 11:41:25 -0300, csckid  wrote:

The cell I have added using t:add doesn't show the sort button, on the  
thead. How can I show the sort button?


When you use the add parameter, Grid doesn't know what the associated  
value is for the columns you're adding. One way is providing a BeanModel  
to the model parameter and adding columns through  
beanModel.add("truck.id"), for example. Another way is to change your  
TruckWoodPrice to have, for example, a getTruckId() { return  
truck.getid(); } method.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



table

2011-09-28 Thread csckid
The cell I have added using t:add doesn't show the sort button, on the thead.
How can I show the sort button? Please also let me know, whether this is the
right way to create table in tapestry?


  There are no records to display; 


${truckWoodPrice.truck.id}


 ${truckWoodPrice.truck.cft}


 ${truckWoodPrice.woodType} @ ${truckWoodPrice.price}

 

public class TruckWoodPrice extends Persistent{
private Truck truck;
DateTime dateTime = new DateTime();
private WoodType woodType;
private Double price;
private Integer truckYear= dateTime.getYear();
//getters and setters
}

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/table-tp4849434p4849434.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Printing Grid table thead on empty source

2011-05-23 Thread Thiago H. de Paula Figueiredo
On Mon, 23 May 2011 10:55:47 -0300, Joost Schouten (ml)  
 wrote:



  Hi,


Hi!

It seems not to be possible to just print the Grid thead when the grid  
source is empty. Is this correct?


I guess so.

And if so, can we not just introduce it as an option in the empty  
parameter as eg. block:thead


I'd prefer an option to render the table headers instead of the empty  
block.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Printing Grid table thead on empty source

2011-05-23 Thread Joost Schouten (ml)

 Hi,

It seems not to be possible to just print the Grid thead when the grid 
source is empty. Is this correct? And if so, can we not just introduce 
it as an option in the empty parameter as eg. block:thead


Cheers,
Joost

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



Re: t5: create a record from another table, what is best practice?

2011-04-16 Thread Taha Hafeez
public class MakeProfile {

   @Inject
   private Session session;

   @Property
   private String email;

   @Property
   private String name;

@Property
   @Persist(PersistenceConstants.FLASH)
private Application app;

   void onActivate(String code_ref) {
  if(app == null){
 app = (Applicantion) session().createQuery("from Applicantion where
 code = ?").setString(0, code_ref).uniqueResult();
  }
   }

   void onPrepareForRender(){
  email = app.getEmail();
  name = app.getName();
   }

   @CommitAfter
   Object onSuccess() {
   Profile p = new Profile();
   p.setEmail(email);
   p.setName(name);
   session.save(p);
   }

}

regards
Taha


On Sat, Apr 16, 2011 at 2:31 PM, Angelo C.  wrote:

> Hi,
>
> Thanks, but how to pass a string to prepareForRender?
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/t5-create-a-record-from-another-table-what-is-best-practice-tp4307107p4307173.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: t5: create a record from another table, what is best practice?

2011-04-16 Thread Angelo C.
Hi,

Thanks, but how to pass a string to prepareForRender?

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/t5-create-a-record-from-another-table-what-is-best-practice-tp4307107p4307173.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: t5: create a record from another table, what is best practice?

2011-04-16 Thread Taha Hafeez
Hi

onActivate() is called each time a page is loaded. So if you have a form on
a page, onActivate() will be called on both at the time of rendering and
submit/action phase

So if you have to initialize any variables before showing them in a form do
it in prepareForRender event of the form and if you want to do some thing
after submiting the form do it in prepareForSubmit event of the form. If you
want to do something common in both phases do it in prepare event of the
form.

Please refer to
http://tapestry.apache.org/tapestry5.2-dev/tapestry-core/ref/org/apache/tapestry5/corelib/components/Form.html

regards
taha


On Sat, Apr 16, 2011 at 1:24 PM, Angelo C.  wrote:

> Hi,
>   I have a form with email and name fields, and when the page is activated,
> it will retrieve an existing application, then initialize email and name,
> when submit is clicked,
>   a Profile record is created in onSuccess and persisted, the following
> code seems not working, what is a right practice in this use case?
> Thanks,
>
>
> public class MakeProfile {
>
>@Inject
>private Session session;
>
>@Property
>private String email;
>@Property
>private String name;
>
>private Application app;
>
>void onActivate(String code_ref) {
>app = (Applicantion) session().createQuery("from Applicantion where
> code = ?").setString(0, code_ref).uniqueResult();
>if (app != null) {
>email = app.getEmail();
>name = app.getName();
>  }
>}
>
>@CommitAfter
>Object onSuccess() {
>Profile p = new Profile();
>p.setEmail(email);
>p.setName(name);
>session.save(p);
>}
>
> }
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/t5-create-a-record-from-another-table-what-is-best-practice-tp4307107p4307107.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


t5: create a record from another table, what is best practice?

2011-04-16 Thread Angelo C.
Hi,
   I have a form with email and name fields, and when the page is activated,
it will retrieve an existing application, then initialize email and name,
when submit is clicked, 
   a Profile record is created in onSuccess and persisted, the following
code seems not working, what is a right practice in this use case?  
Thanks,
   

public class MakeProfile {

@Inject
private Session session;

@Property
private String email;
@Property
private String name;

private Application app;
 
void onActivate(String code_ref) {
app = (Applicantion) session().createQuery("from Applicantion where
code = ?").setString(0, code_ref).uniqueResult();
if (app != null) {
email = app.getEmail();
name = app.getName();
  }
}

@CommitAfter
Object onSuccess() {
Profile p = new Profile();
p.setEmail(email);
p.setName(name);
session.save(p);
}

}


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/t5-create-a-record-from-another-table-what-is-best-practice-tp4307107p4307107.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Update table column via Zone(s)

2011-02-24 Thread Dmitriy Vsekhvalnov
Thanks, guys, both approaches works.

I went with Renderable, because wanted to render some other markup, not only
text.

Quick question to Cezary:

 - why are you updating class fileds withing separate RenderCommand? Any
pitfalls?

In my experiments rendering and updating class state is working fine withing
one class, like this:

private RenderCommand cellZoneRenderer(final POS pos, final Contract cnt)
{
return new RenderCommand()
{
public void render(MarkupWriter writer, RenderQueue queue)
{
//update state
contract=cnt;
pointofsale=pos;

//render zone
((RenderCommand) visitsZone.getBody()).render(writer,queue);
}
};
}


On Tue, Feb 22, 2011 at 9:03 PM, Cezary Biernacki wrote:

> Hi Dmitriy,
> I solved similar problem by chaining list of MultiZoneUpdate, each with its
> own RenderCommand, something like that:
>
> @Inject
> private Block myBlock;
> 
>
> MultiZoneUpdate mzu = null;
> for(String id : indexes) {
>mzu = addMZU(mzu, "zone-" + id, prepareRender(id));
> }
>
> 
>private RenderCommand prepareRendering(final String id) {
>return new RenderCommand() {
>@Override
>public void render(MarkupWriter writer, RenderQueue queue) {
>((RenderCommand)myBlock).render(writer, queue);
>queue.push(new RenderCommand() {
>@Override
>public void render(MarkupWriter writer, RenderQueue
> queue) {
>currentId = id;
>}
>});
>}
>};
>}
>
> in .tml, I have:
> 
>   Here rendering based on ${currentId}
> 
>
> 
>   
> 
>
> I can not guarantee that it is the simplest way, but it works for me.
>
> Regards,
> Cezary
>
> On Tue, Feb 22, 2011 at 4:16 PM, Dmitriy Vsekhvalnov <
> dvsekhval...@gmail.com
> > wrote:
>
> > Hi all,
> >
> >  i'm looking for some ideas how to update entire column in html table,
> > without updating overall table.
> >
> > For instance:
> > 
> > 
> >${rowValue.a}
> >${rowValue.b}
> >${rowValue.c}
> >
> >
> >${some rowValue derived text or other
> > components}
> >
> >
> > 
> > 
> >
> > on some event i want to update all zones with t:id="myZone".   The issue
> is
> > that with XHR request t:loop is not executed and rowValue property is not
> > bound.
> >
> > So even if i return properly populated MultiZoneUpdate it is rendered
> > incorrectly, because rowValue is not changed before invocations.
> >
> > Any ideas how i can force t:loop to be executed or force myZone body to
> be
> > rendered (i can re-iterate collection myself in handler method)?
> >
> > Thanks.
> >
>


Re: Update table column via Zone(s)

2011-02-22 Thread Josh Canfield
> Any ideas how i can force t:loop to be executed or force myZone body to be
> rendered (i can re-iterate collection myself in handler method)?

A similar question was asked a couple weeks ago. You can search the
list for it for more details (subject was "Context of a Zone").

If what you are rendering is simple text then you can simply create
your MultiZoneUpdate in a loop. Here's what Mark came up with:

   MultiZoneUpdate update = new MultiZoneUpdate("totalPriceZone",
totalPriceZone);
   for (Item aitem : getItems()) {
  update =  update.add("priceZone-" + aItem.getId(),
getTotalPriceForItem(aItem)); <-- important part
   }
   return update;


On Tue, Feb 22, 2011 at 7:16 AM, Dmitriy Vsekhvalnov
 wrote:
> Hi all,
>
>  i'm looking for some ideas how to update entire column in html table,
> without updating overall table.
>
> For instance:
> 
> 
>                        ${rowValue.a}
>                        ${rowValue.b}
>                        ${rowValue.c}
>                        
>                            
>                                    ${some rowValue derived text or other
> components}
>                            
>                        
> 
> 
>
> on some event i want to update all zones with t:id="myZone".   The issue is
> that with XHR request t:loop is not executed and rowValue property is not
> bound.
>
> So even if i return properly populated MultiZoneUpdate it is rendered
> incorrectly, because rowValue is not changed before invocations.
>
> Any ideas how i can force t:loop to be executed or force myZone body to be
> rendered (i can re-iterate collection myself in handler method)?
>
> Thanks.
>

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



Re: Update table column via Zone(s)

2011-02-22 Thread Cezary Biernacki
Hi Dmitriy,
I solved similar problem by chaining list of MultiZoneUpdate, each with its
own RenderCommand, something like that:

@Inject
private Block myBlock;


MultiZoneUpdate mzu = null;
for(String id : indexes) {
mzu = addMZU(mzu, "zone-" + id, prepareRender(id));
}


private RenderCommand prepareRendering(final String id) {
return new RenderCommand() {
@Override
public void render(MarkupWriter writer, RenderQueue queue) {
((RenderCommand)myBlock).render(writer, queue);
queue.push(new RenderCommand() {
@Override
public void render(MarkupWriter writer, RenderQueue
queue) {
currentId = id;
}
});
}
};
}

in .tml, I have:

   Here rendering based on ${currentId}



   


I can not guarantee that it is the simplest way, but it works for me.

Regards,
Cezary

On Tue, Feb 22, 2011 at 4:16 PM, Dmitriy Vsekhvalnov  wrote:

> Hi all,
>
>  i'm looking for some ideas how to update entire column in html table,
> without updating overall table.
>
> For instance:
> 
> 
>${rowValue.a}
>${rowValue.b}
>${rowValue.c}
>
>
>${some rowValue derived text or other
> components}
>
>
> 
> 
>
> on some event i want to update all zones with t:id="myZone".   The issue is
> that with XHR request t:loop is not executed and rowValue property is not
> bound.
>
> So even if i return properly populated MultiZoneUpdate it is rendered
> incorrectly, because rowValue is not changed before invocations.
>
> Any ideas how i can force t:loop to be executed or force myZone body to be
> rendered (i can re-iterate collection myself in handler method)?
>
> Thanks.
>


Update table column via Zone(s)

2011-02-22 Thread Dmitriy Vsekhvalnov
Hi all,

 i'm looking for some ideas how to update entire column in html table,
without updating overall table.

For instance:


${rowValue.a}
${rowValue.b}
${rowValue.c}


${some rowValue derived text or other
components}





on some event i want to update all zones with t:id="myZone".   The issue is
that with XHR request t:loop is not executed and rowValue property is not
bound.

So even if i return properly populated MultiZoneUpdate it is rendered
incorrectly, because rowValue is not changed before invocations.

Any ideas how i can force t:loop to be executed or force myZone body to be
rendered (i can re-iterate collection myself in handler method)?

Thanks.


Re: Alternating table rows

2010-09-14 Thread Dmitry Gusev
For alternating rows you can try CSS :nth-child(N) pseudoclass (google for
details).
<http://reference.sitepoint.com/css/pseudoclass-nthchild>Here's quick
example:


.rowClass:hover, .rowClass:nth-child(even):hover {
background-color: #DCE5FF;
}

.rowClass:nth-child(even) {
background-color: #E8E8E8;
}


On Tue, Sep 14, 2010 at 18:26, Davor Hrg  wrote:

> here is a neat and reusable trick on tapestry5howtos
>
> http://wiki.apache.org/tapestry/Tapestry5HowToAddBindingPrefixCycle
>
> Davor Hrg
>
> On Tue, Sep 14, 2010 at 10:01 AM, John Doe  wrote:
>
> > Hello,
> >
> > I am new to Tapestry, but I am working on a project that uses it. The
> > version is
> > 5.
> >
> > I am trying to make a HTML table in which even rows have one class, and
> odd
> > rows
> > have another class.
> >
> > So far, I tried the following (I am showing just the code that matters):
> >
> > 
> >
> > 
> >
> > This causes an exception: "Could not convert '(index % 2 == 0) ? 'even' :
> > 'odd''
> > into a component parameter binding: Error parsing property expression
> > '(index %
> > 2 == 0) ? 'even' : 'odd'': Unable to parse input at character position
> 8.".
> >
> > 
> >
> >
> >
> >
> >
> >
> >
> > 
> >
> > This causes an exception: "Block parameters are only allowed directly
> > within
> > component elements.".
> >
> > From this page http://tapestry.apache.org/tapestry5/guide/propexp.html I
> > can't
> > find any examples of conditionals.
> >
> > How can I make the alternating rows?
> >
> >
> >
> >
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Alternating table rows

2010-09-14 Thread Davor Hrg
here is a neat and reusable trick on tapestry5howtos

http://wiki.apache.org/tapestry/Tapestry5HowToAddBindingPrefixCycle

Davor Hrg

On Tue, Sep 14, 2010 at 10:01 AM, John Doe  wrote:

> Hello,
>
> I am new to Tapestry, but I am working on a project that uses it. The
> version is
> 5.
>
> I am trying to make a HTML table in which even rows have one class, and odd
> rows
> have another class.
>
> So far, I tried the following (I am showing just the code that matters):
>
> 
>
> 
>
> This causes an exception: "Could not convert '(index % 2 == 0) ? 'even' :
> 'odd''
> into a component parameter binding: Error parsing property expression
> '(index %
> 2 == 0) ? 'even' : 'odd'': Unable to parse input at character position 8.".
>
> 
>
>
>
>
>
>
>
> 
>
> This causes an exception: "Block parameters are only allowed directly
> within
> component elements.".
>
> From this page http://tapestry.apache.org/tapestry5/guide/propexp.html I
> can't
> find any examples of conditionals.
>
> How can I make the alternating rows?
>
>
>
>


Re: Alternating table rows

2010-09-14 Thread P . Stavrinides
> I think that this negation may have been added recently !?
Well since 5.1.0 on 19 Feb 09 ;) for more details on what's under the hood see: 
http://tapestry.apache.org/tapestry5/guide/propexp.html

This topic has been discussed several times on this list, for example google: 
T5 expression language.  

Cheers,
Peter

- Original Message -
From: "Gunnar Eketrapp" 
To: "Tapestry users" 
Sent: Tuesday, 14 September, 2010 15:12:20 GMT +02:00 Athens, Beirut, 
Bucharest, Istanbul
Subject: Re: Alternating table rows

Yea yea I said can't or couldn't negate ... I think that this negation may
have been added recently !?

Anyway put the logic in java ... and let us all try to forget about .jsp


2010/9/14 Thiago H. de Paula Figueiredo 

> On Tue, 14 Sep 2010 05:38:07 -0300, Gunnar Eketrapp <
> gunnar.eketr...@gmail.com> wrote:
>
>  Hi John! (Still alive ?)
>>
>
> Hi, guys!
>
>
>  I was also frustrated about the simplicity of the template language at the
>> start.
>>
>
> Me too. But then I discovered that templates should have the least logic on
> them, so it's way easier to test and to get the code right. If someone
> really wants to put logic in template, use the OGNL binding from
> ChenilleKit, but please, don't do that.
>
>
>  You can't (or couldn't even) negate a test!
>>
>
> You can negate a test with !:   public boolean
> isLoggedIn() {...}
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo

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



Re: Alternating table rows

2010-09-14 Thread Gunnar Eketrapp
Yea yea I said can't or couldn't negate ... I think that this negation may
have been added recently !?

Anyway put the logic in java ... and let us all try to forget about .jsp


2010/9/14 Thiago H. de Paula Figueiredo 

> On Tue, 14 Sep 2010 05:38:07 -0300, Gunnar Eketrapp <
> gunnar.eketr...@gmail.com> wrote:
>
>  Hi John! (Still alive ?)
>>
>
> Hi, guys!
>
>
>  I was also frustrated about the simplicity of the template language at the
>> start.
>>
>
> Me too. But then I discovered that templates should have the least logic on
> them, so it's way easier to test and to get the code right. If someone
> really wants to put logic in template, use the OGNL binding from
> ChenilleKit, but please, don't do that.
>
>
>  You can't (or couldn't even) negate a test!
>>
>
> You can negate a test with !:   public boolean
> isLoggedIn() {...}
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo


Re: Alternating table rows

2010-09-14 Thread Sven Homburg
i totaly agree with Thiago,
implement logic into design should an absolutly no-go


with regards
Sven Homburg
Founder of the Chenille Kit Project
http://chenillekit.codehaus.org





2010/9/14 Thiago H. de Paula Figueiredo :
> On Tue, 14 Sep 2010 05:38:07 -0300, Gunnar Eketrapp
>  wrote:
>
>> Hi John! (Still alive ?)
>
> Hi, guys!
>
>> I was also frustrated about the simplicity of the template language at the
>> start.
>
> Me too. But then I discovered that templates should have the least logic on
> them, so it's way easier to test and to get the code right. If someone
> really wants to put logic in template, use the OGNL binding from
> ChenilleKit, but please, don't do that.
>
>> You can't (or couldn't even) negate a test!
>
> You can negate a test with !:   public boolean
> isLoggedIn() {...}
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> -
> 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: Alternating table rows

2010-09-14 Thread Thiago H. de Paula Figueiredo
On Tue, 14 Sep 2010 05:38:07 -0300, Gunnar Eketrapp  
 wrote:



Hi John! (Still alive ?)


Hi, guys!

I was also frustrated about the simplicity of the template language at  
the start.


Me too. But then I discovered that templates should have the least logic  
on them, so it's way easier to test and to get the code right. If someone  
really wants to put logic in template, use the OGNL binding from  
ChenilleKit, but please, don't do that.



You can't (or couldn't even) negate a test!


You can negate a test with !:   public  
boolean isLoggedIn() {...}


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Alternating table rows

2010-09-14 Thread Bob Harner
This alternating stripes effect is such a common need that I think it should
be a built-in capability of all of the looping components, as a parameter in
which you pass the names of the CSS classes to alternatively apply. JSF does
this, and it's very handy. I guess you could do this yourself with a custom
loop component that accepts a "classes=odd,even" parameter, but it'd be nice
to not have to.

On Sep 14, 2010 6:00 AM, "Peter Stavrinides" 
wrote:
> Katia has some good advice, I am also a strong advocate for code
separation, which equates to extensibility and maintanability.
>
> Your page class (pure Java) is intended to replace JSP or any expression
language, queries and any other business logic is better when moved into IoC
where it is injectable and reusable. Tapestry purposefully minimizes
expression language usage in pages because:
> - Its hard (or near impossible) to test in templates
> - It clutters the templates (error prone)
> - Its better done in Java where you can debug it (that's reason enough for
me)
> - Its NOT clean code seperation
>
> If you are doing any more than trivial conditional evaluation in templates
then it is not clean markup. Its also good to keep your templates and page
classes as minimalistic as possible so that your UI can become pluggable if
ever required.
>
> Cheers,
> Peter
>
>
> - Original Message -
> From: "Katia Aresti Gonzalez" 
> To: "Tapestry users" 
> Sent: Tuesday, 14 September, 2010 12:35:43 GMT +02:00 Athens, Beirut,
Bucharest, Istanbul
> Subject: Re: Alternating table rows
>
> For java CSS logic reticent people :
>
> Imagine you need more complex css logic depending not only on even/odd
row,
> but on the number of the elements you have in your table too, or even the
> values of these elements, and depending on a pagination component too. How
> will you TML look like ? like an old horrible JSP. Not only that, you
won't
> be able to do everything you did before to manage this kind of logic, as
TML
> are correct XML files.
>
> I think that putting this kind "css logic" in the TML is just a bad idea.
> This is the way to code JSP. JSP-s are not readable, they are a pain, and
> separation between class and code is just not true in real world (In JSP,
we
> usually had to put java code to manage this kind of logic).
> You will repeat yourself all over and over in your application, your code
> won't be readable, neither cleaner, maintainable and you separation
between
> styles and just code won't be better.
>
> Think in "odd" and "even" as identifiers, and let to your TML to add
another
> css class too, just as an example for your case like this :
>
> 
>
> If you have a look to Tapestry Grid component source code, you will see
how,
> for example, the generic CSS name as "t-first" or "t-last" are applied to
> the first and last row. You can add your own css class too to the grid,
this
> class will be rendered, so within t-first and t-last, you will be able to
> overload a different style just for the first or the last row in the Grid.
> MCV pattern just works perfect.
>
>
> 2010/9/14 Gunnar Eketrapp 
>
>> Hi John! (Still alive ?)
>>
>> I was also frustrated about the simplicity of the template language at
the
>> start.
>> You can't (or couldn't even) negate a test!
>>
>> But the philosophy of T5 is to put all logic in java ... and after using
T5
>> succesfully in a big rewrite of an existing site I must say that I agree
>> with this.
>>
>> I added following utility methods in my base class ...
>>
>> //
>> ---
>> // -- Utility methods for all our children --
>> //
>> ---
>>
>> private boolean odd = true;
>>
>> public String getOddOrEvenStep() {
>> odd = !odd;
>> return odd ? "odd" : "even";
>> }
>> public String getOddOrEvenStay() {
>> return odd ? "odd" : "even";
>> }
>>
>>
>> /Gunnar Eketrapp
>>
>> 2010/9/14 John Doe 
>>
>> > Yes, I could do that, but that would mean putting CSS in Java classes
and
>> I
>> > would prefer avoiding that.
>> >
>> > Does Tapestry 5 have any support for conditions like "index % 2 == 0"
in
>> > templates?
>> >
>> >
>> >
>> >
>> > 
>> > From: Stephan Windmüller 
>> > To: users@tapestry.apache.org

Re: Alternating table rows

2010-09-14 Thread Peter Stavrinides
Katia has some good advice, I am also a strong advocate for code separation, 
which equates to extensibility and maintanability.

Your page class (pure Java) is intended to replace JSP or any expression 
language, queries and any other business logic is better when moved into IoC 
where it is injectable and reusable. Tapestry purposefully minimizes expression 
language usage in pages because:
- Its hard (or near impossible) to test in templates
- It clutters the templates (error prone)
- Its better done in Java where you can debug it (that's reason enough for me)
- Its NOT clean code seperation

If you are doing any more than trivial conditional evaluation in templates then 
it is not clean markup. Its also good to keep your templates and page classes 
as minimalistic as possible so that your UI can  become pluggable if ever 
required. 

Cheers,
Peter


- Original Message -
From: "Katia Aresti Gonzalez" 
To: "Tapestry users" 
Sent: Tuesday, 14 September, 2010 12:35:43 GMT +02:00 Athens, Beirut, 
Bucharest, Istanbul
Subject: Re: Alternating table rows

For java CSS logic reticent people :

Imagine you need more complex css logic depending not only on even/odd row,
but on the number of the elements you have in your table too, or even the
values of these elements, and depending on a pagination component too. How
will you TML look like ? like an old horrible JSP. Not only that, you won't
be able to do everything you did before to manage this kind of logic, as TML
are correct XML files.

I think that putting this kind "css logic" in the TML is just a bad idea.
This is the way to code JSP. JSP-s are not readable, they are a pain, and
separation between class and code is just not true in real world (In JSP, we
usually had to put java code to manage this kind of logic).
You will repeat yourself all over and over in your application, your code
won't be readable, neither cleaner, maintainable and you separation between
styles and just code won't be better.

Think in "odd" and "even" as identifiers, and let to your TML to add another
css class too, just as an example for your case like this :



If you have a look to Tapestry Grid component source code, you will see how,
for example, the generic CSS name as "t-first" or "t-last" are applied to
the first and last row. You can add your own css class too to the grid, this
class will be rendered, so within t-first and t-last, you will be able to
overload a different style just for the first or the last row in the Grid.
MCV pattern just works perfect.


2010/9/14 Gunnar Eketrapp 

> Hi John! (Still alive ?)
>
> I was also frustrated about the simplicity of the template language at the
> start.
> You can't (or couldn't even) negate a test!
>
> But the philosophy of T5 is to put all logic in java ... and after using T5
> succesfully in a big rewrite of an existing site I must say that I agree
> with this.
>
> I added following utility methods in my base class ...
>
>//
> ---
>// -- Utility methods for all our children --
>//
> ---
>
>private boolean odd = true;
>
> public String getOddOrEvenStep() {
> odd = !odd;
> return odd ? "odd" : "even";
> }
>  public String getOddOrEvenStay() {
> return odd ? "odd" : "even";
> }
>
>
> /Gunnar Eketrapp
>
> 2010/9/14 John Doe 
>
> > Yes, I could do that, but that would mean putting CSS in Java classes and
> I
> > would prefer avoiding that.
> >
> > Does Tapestry 5 have any support for conditions like "index % 2 == 0" in
> > templates?
> >
> >
> >
> >
> > 
> > From: Stephan Windmüller 
> > To: users@tapestry.apache.org
> > Sent: Tue, September 14, 2010 11:17:03 AM
> > Subject: Re: Alternating table rows
> >
> > On 14.09.2010 10:01, John Doe wrote:
> >
> > > How can I make the alternating rows?
> >
> > Use the following code:
> >
> > private boolean switch;
> >
> > public String getSwitchedClass() {
> >switch = !switch;
> >
> >return switch ? "odd" : "even";
> > }
> >
> > And in the tml:
> >
> > 
> >
> > HTH
> > Stephan
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
> >
> >
>
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>

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



Re: Alternating table rows

2010-09-14 Thread Katia Aresti Gonzalez
For java CSS logic reticent people :

Imagine you need more complex css logic depending not only on even/odd row,
but on the number of the elements you have in your table too, or even the
values of these elements, and depending on a pagination component too. How
will you TML look like ? like an old horrible JSP. Not only that, you won't
be able to do everything you did before to manage this kind of logic, as TML
are correct XML files.

I think that putting this kind "css logic" in the TML is just a bad idea.
This is the way to code JSP. JSP-s are not readable, they are a pain, and
separation between class and code is just not true in real world (In JSP, we
usually had to put java code to manage this kind of logic).
You will repeat yourself all over and over in your application, your code
won't be readable, neither cleaner, maintainable and you separation between
styles and just code won't be better.

Think in "odd" and "even" as identifiers, and let to your TML to add another
css class too, just as an example for your case like this :



If you have a look to Tapestry Grid component source code, you will see how,
for example, the generic CSS name as "t-first" or "t-last" are applied to
the first and last row. You can add your own css class too to the grid, this
class will be rendered, so within t-first and t-last, you will be able to
overload a different style just for the first or the last row in the Grid.
MCV pattern just works perfect.


2010/9/14 Gunnar Eketrapp 

> Hi John! (Still alive ?)
>
> I was also frustrated about the simplicity of the template language at the
> start.
> You can't (or couldn't even) negate a test!
>
> But the philosophy of T5 is to put all logic in java ... and after using T5
> succesfully in a big rewrite of an existing site I must say that I agree
> with this.
>
> I added following utility methods in my base class ...
>
>//
> ---
>// -- Utility methods for all our children --
>//
> ---
>
>private boolean odd = true;
>
> public String getOddOrEvenStep() {
> odd = !odd;
> return odd ? "odd" : "even";
> }
>  public String getOddOrEvenStay() {
> return odd ? "odd" : "even";
> }
>
>
> /Gunnar Eketrapp
>
> 2010/9/14 John Doe 
>
> > Yes, I could do that, but that would mean putting CSS in Java classes and
> I
> > would prefer avoiding that.
> >
> > Does Tapestry 5 have any support for conditions like "index % 2 == 0" in
> > templates?
> >
> >
> >
> >
> > 
> > From: Stephan Windmüller 
> > To: users@tapestry.apache.org
> > Sent: Tue, September 14, 2010 11:17:03 AM
> > Subject: Re: Alternating table rows
> >
> > On 14.09.2010 10:01, John Doe wrote:
> >
> > > How can I make the alternating rows?
> >
> > Use the following code:
> >
> > private boolean switch;
> >
> > public String getSwitchedClass() {
> >switch = !switch;
> >
> >return switch ? "odd" : "even";
> > }
> >
> > And in the tml:
> >
> > 
> >
> > HTH
> > Stephan
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
> >
> >
>
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>


Re: Alternating table rows

2010-09-14 Thread Stephan Windmüller
Am 14.09.2010 10:38, schrieb Gunnar Eketrapp:

> I was also frustrated about the simplicity of the template language at the
> start.
> You can't (or couldn't even) negate a test!

What about 'negate="true"' or the "unless" component?

- Stephan

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



Re: Alternating table rows

2010-09-14 Thread Gunnar Eketrapp
Hi John! (Still alive ?)

I was also frustrated about the simplicity of the template language at the
start.
You can't (or couldn't even) negate a test!

But the philosophy of T5 is to put all logic in java ... and after using T5
succesfully in a big rewrite of an existing site I must say that I agree
with this.

I added following utility methods in my base class ...

//
---
// -- Utility methods for all our children --
//
---

private boolean odd = true;

public String getOddOrEvenStep() {
odd = !odd;
return odd ? "odd" : "even";
}
 public String getOddOrEvenStay() {
return odd ? "odd" : "even";
}


/Gunnar Eketrapp

2010/9/14 John Doe 

> Yes, I could do that, but that would mean putting CSS in Java classes and I
> would prefer avoiding that.
>
> Does Tapestry 5 have any support for conditions like "index % 2 == 0" in
> templates?
>
>
>
>
> 
> From: Stephan Windmüller 
> To: users@tapestry.apache.org
> Sent: Tue, September 14, 2010 11:17:03 AM
> Subject: Re: Alternating table rows
>
> On 14.09.2010 10:01, John Doe wrote:
>
> > How can I make the alternating rows?
>
> Use the following code:
>
> private boolean switch;
>
> public String getSwitchedClass() {
>switch = !switch;
>
>return switch ? "odd" : "even";
> }
>
> And in the tml:
>
> 
>
> HTH
> Stephan
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>
>
>



-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo


RE: Alternating table rows

2010-09-14 Thread Stony Zhang
Change code to,

public boolean isEvenColumn () {
return index % 2 == 0;
}













Thanks
Stony


-Original Message-
From: John Doe [mailto:nicu4...@yahoo.com] 
Sent: Tuesday, September 14, 2010 4:28 PM
To: Tapestry users
Subject: Re: Alternating table rows

Yes, I could do that, but that would mean putting CSS in Java classes and I 
would prefer avoiding that.

Does Tapestry 5 have any support for conditions like "index % 2 == 0" in 
templates?





From: Stephan Windmüller 
To: users@tapestry.apache.org
Sent: Tue, September 14, 2010 11:17:03 AM
Subject: Re: Alternating table rows

On 14.09.2010 10:01, John Doe wrote:

> How can I make the alternating rows?

Use the following code:

private boolean switch;

public String getSwitchedClass() {
switch = !switch;

return switch ? "odd" : "even";
}

And in the tml:



HTH
Stephan

-
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: Alternating table rows

2010-09-14 Thread John Doe
Yes, I could do that, but that would mean putting CSS in Java classes and I 
would prefer avoiding that.

Does Tapestry 5 have any support for conditions like "index % 2 == 0" in 
templates?





From: Stephan Windmüller 
To: users@tapestry.apache.org
Sent: Tue, September 14, 2010 11:17:03 AM
Subject: Re: Alternating table rows

On 14.09.2010 10:01, John Doe wrote:

> How can I make the alternating rows?

Use the following code:

private boolean switch;

public String getSwitchedClass() {
switch = !switch;

return switch ? "odd" : "even";
}

And in the tml:



HTH
Stephan

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


  

Re: Alternating table rows

2010-09-14 Thread Stephan Windmüller
On 14.09.2010 10:01, John Doe wrote:

> How can I make the alternating rows?

Use the following code:

private boolean switch;

public String getSwitchedClass() {
switch = !switch;

return switch ? "odd" : "even";
}

And in the tml:



HTH
 Stephan

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



Alternating table rows

2010-09-14 Thread John Doe
Hello,

I am new to Tapestry, but I am working on a project that uses it. The version 
is 
5.

I am trying to make a HTML table in which even rows have one class, and odd 
rows 
have another class.

So far, I tried the following (I am showing just the code that matters):





This causes an exception: "Could not convert '(index % 2 == 0) ? 'even' : 
'odd'' 
into a component parameter binding: Error parsing property expression '(index % 
2 == 0) ? 'even' : 'odd'': Unable to parse input at character position 8.".











This causes an exception: "Block parameters are only allowed directly within 
component elements.".

>From this page http://tapestry.apache.org/tapestry5/guide/propexp.html I can't 
find any examples of conditionals.

How can I make the alternating rows?



  

Re: tapestry 4 table methods call multiple times

2010-09-03 Thread based2

http://tapestry.1045711.n5.nabble.com/Multiple-calls-of-method-OnActivate-td2398530.html#a2398530

http://tapestry.1045711.n5.nabble.com/Please-expand-on-this-td2379575.html#a2379578

http://tapestry.1045711.n5.nabble.com/tapestry-4-contrib-table-call-getModel-multiple-times-td2398212.html#a2398212

== http://wiki.apache.org/tapestry/Tapestry5HowTos
== http://wiki.apache.org/tapestry/Tapestry5OpensourceApps
== http://wiki.apache.org/tapestry/Tapestry5ModuleRegistry
http://people.apache.org/~uli/tapestry-site/frequently-asked-questions.html#FrequentlyAskedQuestions-HowdoIstoremypageclassesinadifferentpackage
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/tapestry-4-table-methods-call-multiple-times-tp2799216p2802715.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



tapestry 4 table methods call multiple times

2010-09-01 Thread asianCoolz
 0  down vote  favorite


i do debug on IBasicTableModel , on method

public IBasicTableModel getModel() {
return new IBasicTableModel() {

public int getRowCount() {
//this is called multiple times

}


   public Iterator getCurrentPageRows(
int nFirst,
int nPageSize,
ITableColumn objSortColumn,
boolean bSortOrder) {
//this is called multiple times

}
}

is it "normal" for tapestr4, do call getRowCount(), getCurrentPageRows().. many
times just to render the page?



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



Tapestry 4 contrib table header issue

2010-05-11 Thread UABajwah

Hello,


I am using tapestry 4 contrib table. I want to align its column header text
to right. i define a css class but tapestry overrides it. i tried
columnsClass attribute but it alings all the headers.

Anyone knows the solution please help.

Thanks,
UABajwah
-- 
View this message in context: 
http://old.nabble.com/Tapestry-4-contrib-table-header-issue-tp28521447p28521447.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: sql update of existing table

2010-02-20 Thread toejoe

Thank You for quick reply. I followed Your advice and added annotation
@CommitAfter. It is working now.


Shing Hing Man wrote:
> 
> 
> After the update, try calling  commit. If you are using 
> 
> HibernateSessionManager from
> http://tapestry.apache.org/tapestry5.1/tapestry-hibernate/
> 
> call HibernateSessionManager.commit().
> 
> Shing 
> 
> 
> Home page : http://www.lombok.demon.co.uk/
> 
> 
> 
> --- On Sun, 21/2/10, toejoe  wrote:
> 
>> From: toejoe 
>> Subject: sql update of existing table
>> To: users@tapestry.apache.org
>> Date: Sunday, 21 February, 2010, 0:44
>> 
>> Hello.
>> 
>> I am using Tapestry 5.0.18 framework with Netbeans 6.8, MS
>> Sqlexpress 2005
>> and using hibernate support for accessing database.
>> 
>> One page is crated for data input. Other one will display
>> data from table.
>> Input is performed using t:beaneditform and display via
>> t:grid. Whatever
>> data I enter, it will be successfuly stored in database.
>> Grid component will
>> display it all. So, this basic part is functioning ok.
>> 
>> Main entity, Class Servis has 3 attributes : servisid,
>> InvNo, Vendor and
>> Status.
>> Servisid is generated value:
>>  �...@id
>>  �...@generatedvalue
>>    private Long servisid; 
>> so it is incremented for every new row and is unique.
>> 
>> To store data after clicking on submit/update in
>> beaneditform, I use the
>> following code:
>>     @CommitAfter
>>     public Object onSuccess(){ 
>>       Servis temp = new Servis();
>>       temp.setInvno(servis.getInvno());
>>       temp.setVendor(servis.getVendor());
>>       temp.setStatus(servis.getStatus());
>>       session.save(temp);
>>       return start;
>>     }
>> 
>> I have customized grid component to display additional
>> column which would be
>> used to change status attribute.
>> Tml file :
>>         > row="servis" add="change">
>>             > name="changeCell">
>>                
>> > context="servis.servisid">Set
>> TRUE
>>            
>> 
>>         
>> 
>> Java class. I use following method to display only rows
>> with status = FALSE
>> 
>>    public List getList() {
>>       Criteria crit =
>> getSession().createCriteria(Servis.class);
>>       crit.add(Restrictions.eq("status",
>> Status.FALSE));
>>       return crit.list();
>>       }
>> 
>> Now, I want to update value of status by clicking on Set
>> TRUE in grid
>> component. I tried with several variants like this:
>> 
>>    Object onActionFromChange(long id) {
>>       SQLQuery query =
>> getSession().createSQLQuery("UPDATE tblServis SET
>> status = 'TRUE' WHERE servisid = "+id);
>>       query.executeUpdate();
>>       return start;
>>       }
>> 
>> It won't update table. I also get no exception. Clicking on
>> Set TRUE will
>> drive me to start page. I tested and I definitely get
>> appropriate id from
>> grid.
>> Can somebody suggest me what should I do to accomplish
>> table update?
>> 
>> Thanks in advance.
>> -- 
>> View this message in context:
>> http://old.nabble.com/sql-update-of-existing-table-tp27667156p27667156.html
>> Sent from the Tapestry - User mailing list archive at
>> Nabble.com.
>> 
>> 
>> -
>> 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
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/sql-update-of-existing-table-tp27667156p27670925.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: sql update of existing table

2010-02-20 Thread Shing Hing Man

After the update, try calling  commit. If you are using 

HibernateSessionManager from 
http://tapestry.apache.org/tapestry5.1/tapestry-hibernate/

call HibernateSessionManager.commit().

Shing 


Home page : http://www.lombok.demon.co.uk/



--- On Sun, 21/2/10, toejoe  wrote:

> From: toejoe 
> Subject: sql update of existing table
> To: users@tapestry.apache.org
> Date: Sunday, 21 February, 2010, 0:44
> 
> Hello.
> 
> I am using Tapestry 5.0.18 framework with Netbeans 6.8, MS
> Sqlexpress 2005
> and using hibernate support for accessing database.
> 
> One page is crated for data input. Other one will display
> data from table.
> Input is performed using t:beaneditform and display via
> t:grid. Whatever
> data I enter, it will be successfuly stored in database.
> Grid component will
> display it all. So, this basic part is functioning ok.
> 
> Main entity, Class Servis has 3 attributes : servisid,
> InvNo, Vendor and
> Status.
> Servisid is generated value:
>  �...@id
>  �...@generatedvalue
>    private Long servisid; 
> so it is incremented for every new row and is unique.
> 
> To store data after clicking on submit/update in
> beaneditform, I use the
> following code:
>     @CommitAfter
>     public Object onSuccess(){ 
>       Servis temp = new Servis();
>       temp.setInvno(servis.getInvno());
>       temp.setVendor(servis.getVendor());
>       temp.setStatus(servis.getStatus());
>       session.save(temp);
>       return start;
>     }
> 
> I have customized grid component to display additional
> column which would be
> used to change status attribute.
> Tml file :
>          row="servis" add="change">
>              name="changeCell">
>                
>  context="servis.servisid">Set
> TRUE
>            
> 
>         
> 
> Java class. I use following method to display only rows
> with status = FALSE
> 
>    public List getList() {
>       Criteria crit =
> getSession().createCriteria(Servis.class);
>       crit.add(Restrictions.eq("status",
> Status.FALSE));
>       return crit.list();
>       }
> 
> Now, I want to update value of status by clicking on Set
> TRUE in grid
> component. I tried with several variants like this:
> 
>    Object onActionFromChange(long id) {
>       SQLQuery query =
> getSession().createSQLQuery("UPDATE tblServis SET
> status = 'TRUE' WHERE servisid = "+id);
>       query.executeUpdate();
>       return start;
>       }
> 
> It won't update table. I also get no exception. Clicking on
> Set TRUE will
> drive me to start page. I tested and I definitely get
> appropriate id from
> grid.
> Can somebody suggest me what should I do to accomplish
> table update?
> 
> Thanks in advance.
> -- 
> View this message in context: 
> http://old.nabble.com/sql-update-of-existing-table-tp27667156p27667156.html
> Sent from the Tapestry - User mailing list archive at
> Nabble.com.
> 
> 
> -
> 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



sql update of existing table

2010-02-20 Thread toejoe

Hello.

I am using Tapestry 5.0.18 framework with Netbeans 6.8, MS Sqlexpress 2005
and using hibernate support for accessing database.

One page is crated for data input. Other one will display data from table.
Input is performed using t:beaneditform and display via t:grid. Whatever
data I enter, it will be successfuly stored in database. Grid component will
display it all. So, this basic part is functioning ok.

Main entity, Class Servis has 3 attributes : servisid, InvNo, Vendor and
Status.
Servisid is generated value:
   @Id
   @GeneratedValue
   private Long servisid; 
so it is incremented for every new row and is unique.

To store data after clicking on submit/update in beaneditform, I use the
following code:
@CommitAfter
public Object onSuccess(){ 
  Servis temp = new Servis();
  temp.setInvno(servis.getInvno());
  temp.setVendor(servis.getVendor());
  temp.setStatus(servis.getStatus());
  session.save(temp);
  return start;
}

I have customized grid component to display additional column which would be
used to change status attribute.
Tml file :


Set
TRUE



Java class. I use following method to display only rows with status = FALSE

   public List getList() {
  Criteria crit = getSession().createCriteria(Servis.class);
  crit.add(Restrictions.eq("status", Status.FALSE));
  return crit.list();
  }

Now, I want to update value of status by clicking on Set TRUE in grid
component. I tried with several variants like this:

   Object onActionFromChange(long id) {
  SQLQuery query = getSession().createSQLQuery("UPDATE tblServis SET
status = 'TRUE' WHERE servisid = "+id);
  query.executeUpdate();
  return start;
  }

It won't update table. I also get no exception. Clicking on Set TRUE will
drive me to start page. I tested and I definitely get appropriate id from
grid.
Can somebody suggest me what should I do to accomplish table update?

Thanks in advance.
-- 
View this message in context: 
http://old.nabble.com/sql-update-of-existing-table-tp27667156p27667156.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



  1   2   3   4   >