Re: Renders 2 rows using the Grid component

2013-03-19 Thread Lance Java
You could also do this with a GridDecorator / GridRowDecorator 
http://tapestry-stitch.uklance.cloudbees.net/griddecoratordemo



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Renders-2-rows-using-the-Grid-component-tp5720560p5720566.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: Keep component's state between requests

2013-03-19 Thread Lance Java
You can bind your component parameter to an activation context on your page. 

You can also use @Persist(PersistanceConstants.CLIENT) which will use a
request parameter with a component specific name. 



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Keep-component-s-state-between-requests-tp5720563p5720565.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: Renders 2 rows using the Grid component

2013-03-19 Thread Dongmei Cao
Thanks for the trickery! I can definitely use it.

-Original Message-
From: Norman Franke 
Reply-To: Tapestry users 
Date: Tuesday, March 19, 2013 1:59 PM
To: Tapestry users 
Subject: Re: Renders 2 rows using the Grid component

>You can do it, but it's a bit of a hack. I've taken two approaches:
>
>1. Have an extra column that's hidden where we add some special trickery
>or
>2. Define the last column with some extra trickery.
>
>Here is what I do for the trickery:
>
>${row.lastColumnValue}
>${row.bonusColumn1}
>${row.bonusColumn2}
>
>
>This is from an example with 8 columns and a second row with two columns.
>
>Norman Franke
>Answering Service for Directors, Inc.
>www.myasd.com
>
>
>
>On Mar 19, 2013, at 4:54 PM, Dongmei Cao wrote:
>
>> Hi,
>> 
>> Is this possible? I'm using the Grid component. But I need to render 2
>>rows per object from the source. For example, I have a list of
>>Employees. I would like to render one row to include the firstname,
>>lastname and email, then the second row with other details, such as,
>>address, phone number, etc. When the grid first loaded, only the first
>>row will be displayed and the second row will be hidden. When the user
>>clicks on an Expand button in the first row, the second row will also be
>>displayed. Can this be done by the Grid component? Or I need to use a
>>different component?
>> 
>> Thanks in advance for any suggestions!
>> 
>> - D
>


smime.p7s
Description: S/MIME cryptographic signature


RE: Component Problem

2013-03-19 Thread Tony Nelson
The real problem I'm having is an encapsulation problem.

My component needs to have several html elements that work together, but where 
they exist on the page is driven by the page template, not the component 
template.  So in my component template I define 2 blocks

...
..

Then in the page template I'm trying to:




If I try reversing the lines, putting the delegate before my component, I get 
"Template .. does not contain a block with identifier "blocka"" .

When I put my component first (as above), I *think* what's happening, is that 
afterRender() is trying to access the clientId of a hidden component before the 
block has actually been rendered.  It won't get rendered until the actual page 
is fully evaluated.  Does that make sense?

As a test I renamed afterRender() in the component so it would not execute.  
The next error I get is

Template for component report/FullTimeHire does not contain a block with the 
identifier 'clientBlock'

I guess the simple question is, does it even make sense to define a block a in 
a component and reference in the page template?  Has anyone done that?  Has 
anyone seen an example of it?

Thanks
Tony

> -Original Message-
> From: Howard Lewis Ship [mailto:hls...@gmail.com]
> Sent: Tuesday, March 19, 2013 4:48 PM
> To: Tapestry users
> Subject: Re: Component Problem
>
> Taking a peek:
>
> public String getClientId()
> {
> if (clientId == null)
> {
> clientId = jsSupport.allocateClientId(resources);
> hiddenInputElement.forceAttributes("id", clientId);  // 
> Hidden.java,
> line 152
> }
>
> return clientId;
> }
>
> An NPE there makes it look like the Hidden element has not yet rendered.
>
> It would be interesting to capture the MarkupWriter and see what markup
> has been written at the point your afterRender() method is invoked.
> Possibly, you are returned the wrong Block from clientBlock, so the Hidden
> component is never rendered.
>
>
> On Tue, Mar 19, 2013 at 9:40 AM, Tony Nelson 
> wrote:
>
> > I built a page with some pieces that I want to extract to a component.
> > The pieces are parts of a form.  I'm not sure I'm taking the proper 
> > approach.
> > My current idea is to use delegates and blocks.  My component template is:
> >
> >  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd";
> >  xmlns:p="tapestry:parameter">
> >
> >
> > 
> > 
> > 
> >  > value="includeInactiveClients" />
> > 
> >
> > 
> > 
> > 
> >  > value="includeInactiveDivisions" />
> > 
> >
> > 
> >
> >
> > Then in the actual page, I want to use it like this:
> >
> > 
> > 
> > Client:
> > 
> > 
> > 
> > 
> > 
> >
> >
> > And a similar block to divisionBlock.
> >
> > Right now I'm getting a null pointer exception from Hidden.java when I
> > try to get it's client id.  Specifically:
> >
> > @Import(library = { "ClientDivisionAutoComplete.js" })
> > public void afterRender() {
> >
> > JSONObject specs = new JSONObject(
> > "clientId", "#" + clientIdField.getClientId(),
> > "clientName", "#" + clientNameField.getClientId(),
> > "includeInactiveClients", "#" +
> > includeInactiveClientsField.getClientId(),
> > "clientNameAutoCompleteUrl",
> >
> componentResources.createEventLink("clientNameAutoComplete").toURI()
> ,
> > "divisionId", "#" + divisionId.getClientId(),
> > "divisionName", "#" + divisionNameField.getClientId(),
> > "includeInactiveDivisions", "#" +
> > includeInactiveDivisionsField.getClientId(),
> > "divisionNameAutoCompleteUrl",
> >
> componentResources.createEventLink("divisionNameAutoComplete").toURI
> ()
> > );
> >
> >
> > javaScriptSupport.addInitializerCall("clientDivisionAutoComplete",
> > specs);
> > }
> >
> >
> > The exception I'm getting is:
> >
> > Caused by: java.lang.NullPointerException
> > at
> >
> org.apache.tapestry5.corelib.components.Hidden.getClientId(Hidden.java:1
> 52)
> > at
> >
> com.starpoint.instihire.web.components.ClientDivisionAutoComplete.advise
> d$afterRender_12ecdf1ecc23b3d1(ClientDivisionAutoComplete.java:128)
> > at
> >
> com.starpoint.instihire.web.components.ClientDivisionAutoComplete$Invo
> >
> cation_afterRender_12ecdf1ecc23b3d0.proceedToAdvisedMethod(Unknow
> n
> > Source)
> >
> >
> > Is my approach wrong?  This all works when I put it together in a
> > single page, but I'm not having much luck extracting it to a component.
> >
> > Thanks for your help in advance
> > Tony Nelson
> > Starpoint Solutions
> >
> >
> >
> >
> > Since 1982, Starpoint Solutions has been a trusted source of human
> > capital and solutions. We are committed to our clients, employees,
> > environment, community 

Re: Renders 2 rows using the Grid component

2013-03-19 Thread Norman Franke
You can do it, but it's a bit of a hack. I've taken two approaches:

1. Have an extra column that's hidden where we add some special trickery or
2. Define the last column with some extra trickery.

Here is what I do for the trickery:

${row.lastColumnValue}
${row.bonusColumn1}
${row.bonusColumn2}


This is from an example with 8 columns and a second row with two columns.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com



On Mar 19, 2013, at 4:54 PM, Dongmei Cao wrote:

> Hi,
> 
> Is this possible? I'm using the Grid component. But I need to render 2 rows 
> per object from the source. For example, I have a list of Employees. I would 
> like to render one row to include the firstname, lastname and email, then the 
> second row with other details, such as, address, phone number, etc. When the 
> grid first loaded, only the first row will be displayed and the second row 
> will be hidden. When the user clicks on an Expand button in the first row, 
> the second row will also be displayed. Can this be done by the Grid 
> component? Or I need to use a different component? 
> 
> Thanks in advance for any suggestions!
> 
> - D



Renders 2 rows using the Grid component

2013-03-19 Thread Dongmei Cao
Hi,

Is this possible? I'm using the Grid component. But I need to render 2 rows
per object from the source. For example, I have a list of Employees. I would
like to render one row to include the firstname, lastname and email, then
the second row with other details, such as, address, phone number, etc. When
the grid first loaded, only the first row will be displayed and the second
row will be hidden. When the user clicks on an Expand button in the first
row, the second row will also be displayed. Can this be done by the Grid
component? Or I need to use a different component?

Thanks in advance for any suggestions!

- D




smime.p7s
Description: S/MIME cryptographic signature


Re: Component Problem

2013-03-19 Thread Howard Lewis Ship
Taking a peek:

public String getClientId()
{
if (clientId == null)
{
clientId = jsSupport.allocateClientId(resources);
hiddenInputElement.forceAttributes("id", clientId);  //
Hidden.java, line 152
}

return clientId;
}

An NPE there makes it look like the Hidden element has not yet rendered.

It would be interesting to capture the MarkupWriter and see what markup has
been written at the point your afterRender() method is invoked.  Possibly,
you are returned the wrong Block from clientBlock, so the Hidden component
is never rendered.


On Tue, Mar 19, 2013 at 9:40 AM, Tony Nelson  wrote:

> I built a page with some pieces that I want to extract to a component. The
> pieces are parts of a form.  I'm not sure I'm taking the proper approach.
> My current idea is to use delegates and blocks.  My component template is:
>
> http://tapestry.apache.org/schema/tapestry_5_3.xsd";
>  xmlns:p="tapestry:parameter">
>
>
> 
> 
> 
>  value="includeInactiveClients" />
> 
>
> 
> 
> 
>  value="includeInactiveDivisions" />
> 
>
> 
>
>
> Then in the actual page, I want to use it like this:
>
> 
> 
> Client:
> 
> 
> 
> 
> 
>
>
> And a similar block to divisionBlock.
>
> Right now I'm getting a null pointer exception from Hidden.java when I try
> to get it's client id.  Specifically:
>
> @Import(library = { "ClientDivisionAutoComplete.js" })
> public void afterRender() {
>
> JSONObject specs = new JSONObject(
> "clientId", "#" + clientIdField.getClientId(),
> "clientName", "#" + clientNameField.getClientId(),
> "includeInactiveClients", "#" +
> includeInactiveClientsField.getClientId(),
> "clientNameAutoCompleteUrl",
> componentResources.createEventLink("clientNameAutoComplete").toURI(),
> "divisionId", "#" + divisionId.getClientId(),
> "divisionName", "#" + divisionNameField.getClientId(),
> "includeInactiveDivisions", "#" +
> includeInactiveDivisionsField.getClientId(),
> "divisionNameAutoCompleteUrl",
> componentResources.createEventLink("divisionNameAutoComplete").toURI()
> );
>
> javaScriptSupport.addInitializerCall("clientDivisionAutoComplete",
> specs);
> }
>
>
> The exception I'm getting is:
>
> Caused by: java.lang.NullPointerException
> at
> org.apache.tapestry5.corelib.components.Hidden.getClientId(Hidden.java:152)
> at
> com.starpoint.instihire.web.components.ClientDivisionAutoComplete.advised$afterRender_12ecdf1ecc23b3d1(ClientDivisionAutoComplete.java:128)
> at
> com.starpoint.instihire.web.components.ClientDivisionAutoComplete$Invocation_afterRender_12ecdf1ecc23b3d0.proceedToAdvisedMethod(Unknown
> Source)
>
>
> Is my approach wrong?  This all works when I put it together in a single
> page, but I'm not having much luck extracting it to a component.
>
> Thanks for your help in advance
> Tony Nelson
> Starpoint Solutions
>
>
>
>
> Since 1982, Starpoint Solutions has been a trusted source of human capital
> and solutions. We are committed to our clients, employees, environment,
> community and social concerns.  We foster an inclusive culture based on
> trust, respect, honesty and solid performance. Learn more about Starpoint
> and our social responsibility at
> http://www.starpoint.com/social_responsibility
>
> This email message from Starpoint Solutions LLC is for the sole use of
>  the intended recipient(s) and may contain confidential and privileged
>  information.  Any unauthorized review, use, disclosure or distribution is
> prohibited.  If you are not the intended recipient, please contact the
> sender by reply email and destroy all copies of the original message.
>  Opinions, conclusions and other information in this message that do not
> relate to the official business of Starpoint Solutions shall be understood
> as neither given nor endorsed by it.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com


Re: Maven Archetype

2013-03-19 Thread Everton Agner
Wel... you're right. I've tried to do it manually and it succeeded
​
​
​.

I believe it may be some problem on either Eclipse Juno or M2E plugin... Is
anyone else experiencing it?

Thanks


___
Everton Agner Ramos


2013/3/19 Shing Hing Man 

>
>
> mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org
>
> I have just tried the above  from
>
>  http://tapestry.apache.org/getting-started.html
>
>
> It works for me.
>
> Shing
>
>
>
> - Original Message -
> From: Everton Agner 
> To: Tapestry Users 
> Cc:
> Sent: Tuesday, March 19, 2013 4:40 PM
> Subject: Maven Archetype
>
> Hello everyone!
>
> I'm following the instructions from
> http://tapestry.apache.org/getting-started.html and it seems that there's
> something wrong with the Archetype or the Repo...
>
> Maven throws me the following error when it tries to generate the project:
>
>
> Unable to create project from archetype
> [org.apache.tapestry:quickstart:5.3.6 -> http:/]
> The desired archetype does not exist (org.apache.tapestry:quickstart:5.3.6)
>
>
> Could someone point me any known problem about it?
>
> Btw, I'm using Eclipse Juno EE with M2E...
>
>
> Cheers!
>
> ___
> Everton Agner Ramos
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Maven Archetype

2013-03-19 Thread Shing Hing Man


mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org

I have just tried the above  from 

 http://tapestry.apache.org/getting-started.html


It works for me.

Shing 



- Original Message -
From: Everton Agner 
To: Tapestry Users 
Cc: 
Sent: Tuesday, March 19, 2013 4:40 PM
Subject: Maven Archetype

Hello everyone!

I'm following the instructions from
http://tapestry.apache.org/getting-started.html and it seems that there's
something wrong with the Archetype or the Repo...

Maven throws me the following error when it tries to generate the project:


Unable to create project from archetype
[org.apache.tapestry:quickstart:5.3.6 -> http:/]
The desired archetype does not exist (org.apache.tapestry:quickstart:5.3.6)


Could someone point me any known problem about it?

Btw, I'm using Eclipse Juno EE with M2E...


Cheers!

___
Everton Agner Ramos

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



Re: Tapestry 4 Users Guide URL's are broken

2013-03-19 Thread purecharger
Thank you. Any attempt to keep static resources like the user's guide
working is appreciated.


On Tue, Mar 19, 2013 at 10:14 AM, Ulrich Stärk [via Tapestry] <
ml-node+s1045711n5720554...@n5.nabble.com> wrote:

> Fixed. But don't expect it to stay that way. This is legacy documentation
> and might disappear or
> contain broken links. You can always download the sources from the
> archives and build it yourself.
>
> Uli
>
> On 19.03.2013 17:01, purecharger wrote:
>
> > Accessing the Tapestry 4 User's Guide from tapestry.apache.org results
> in
> > 404:
> >
> > http://tapestry.apache.org/tapestry4.1/usersguide/index.html
> >
> > All the left-hand navigation links are broken due to incorrect case on
> the
> > "usersguide" - when linked to "UsersGuide" they work:
> >
> > http://tapestry.apache.org/tapestry4.1/UsersGuide/index.html
> >
> > Can someone fix this?
> >
> >
> >
> > --
> > View this message in context:
> http://tapestry.1045711.n5.nabble.com/Tapestry-4-Users-Guide-URL-s-are-broken-tp5720548.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> > -
> > To unsubscribe, e-mail: [hidden 
> > email]
> > For additional commands, e-mail: [hidden 
> > email]
> >
>
> -
> To unsubscribe, e-mail: [hidden 
> email]
> For additional commands, e-mail: [hidden 
> email]
>
>
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://tapestry.1045711.n5.nabble.com/Tapestry-4-Users-Guide-URL-s-are-broken-tp5720548p5720554.html
>  To unsubscribe from Tapestry 4 Users Guide URL's are broken, click 
> here
> .
> NAML
>




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-4-Users-Guide-URL-s-are-broken-tp5720548p5720556.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: anybody using tapestry-security ?

2013-03-19 Thread Richard Frovarp

On 03/15/2013 11:35 PM, nhhockeyplayer nashua wrote:

One of my issues as I understand this framework is defining access to the 
application.

 configuration.add(factory.createChain("/**").add(factory.authc()).build());

the above statement was imposing authentication on everything and actually 
blocking the rendering of assets

I wish I could tear thru it faster.
But it will come when it comes

I dont understand the significance of having to specify these xpaths... if 
thats what they are

/authc/**

why would I want to specify something like that?




You can think of them as subdirectories with I believe Ant style expansions.

What you would expect to do is break the application paths up into 
similar behavior, that you can then apply coarse grain authentication 
and authorization to.


So you might have a pages like

/admin/edituser
/admin/viewstats

etc

So then you might want /admin/** to indicate all pages under that path. 
That's your chain. You then add an authentication method to it. You can 
use something from the factory, or you can create your own.


You'll need to create your own realms to store the authorization 
information, or you can use one of the existing directory based ones.


From there you can use the annotations to do more fine grained 
authorization.


In reality, you should be doing both the path based and annotation based 
security.


Having an understanding of how Shiro works, helps a lot. Yes, there is a 
lot of abstract explanations, but the basics are important to 
understand. Stick with the simple wild card permissions to begin with. 
There is the ability to program your own permissions, or use instance 
level access. Those are easy to do once you get the basics.


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



Re: Tapestry 4 Users Guide URL's are broken

2013-03-19 Thread Ulrich Stärk
Fixed. But don't expect it to stay that way. This is legacy documentation and 
might disappear or
contain broken links. You can always download the sources from the archives and 
build it yourself.

Uli

On 19.03.2013 17:01, purecharger wrote:
> Accessing the Tapestry 4 User's Guide from tapestry.apache.org results in
> 404:
> 
> http://tapestry.apache.org/tapestry4.1/usersguide/index.html
> 
> All the left-hand navigation links are broken due to incorrect case on the
> "usersguide" - when linked to "UsersGuide" they work:
> 
> http://tapestry.apache.org/tapestry4.1/UsersGuide/index.html
> 
> Can someone fix this?
> 
> 
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Tapestry-4-Users-Guide-URL-s-are-broken-tp5720548.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



Tapestry 4 Users Guide URL's are broken

2013-03-19 Thread purecharger
Accessing the Tapestry 4 User's Guide from tapestry.apache.org results in
404:

http://tapestry.apache.org/tapestry4.1/usersguide/index.html

All the left-hand navigation links are broken due to incorrect case on the
"usersguide" - when linked to "UsersGuide" they work:

http://tapestry.apache.org/tapestry4.1/UsersGuide/index.html

Can someone fix this?



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-4-Users-Guide-URL-s-are-broken-tp5720548.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



Maven Archetype

2013-03-19 Thread Everton Agner
Hello everyone!

I'm following the instructions from
http://tapestry.apache.org/getting-started.html and it seems that there's
something wrong with the Archetype or the Repo...

Maven throws me the following error when it tries to generate the project:


Unable to create project from archetype
[org.apache.tapestry:quickstart:5.3.6 -> http:/]
The desired archetype does not exist (org.apache.tapestry:quickstart:5.3.6)


Could someone point me any known problem about it?

Btw, I'm using Eclipse Juno EE with M2E...


Cheers!

___
Everton Agner Ramos


Component Problem

2013-03-19 Thread Tony Nelson
I built a page with some pieces that I want to extract to a component. The 
pieces are parts of a form.  I'm not sure I'm taking the proper approach. My 
current idea is to use delegates and blocks.  My component template is:

http://tapestry.apache.org/schema/tapestry_5_3.xsd";
 xmlns:p="tapestry:parameter">

















Then in the actual page, I want to use it like this:



Client:







And a similar block to divisionBlock.

Right now I'm getting a null pointer exception from Hidden.java when I try to 
get it's client id.  Specifically:

@Import(library = { "ClientDivisionAutoComplete.js" })
public void afterRender() {

JSONObject specs = new JSONObject(
"clientId", "#" + clientIdField.getClientId(),
"clientName", "#" + clientNameField.getClientId(),
"includeInactiveClients", "#" + 
includeInactiveClientsField.getClientId(),
"clientNameAutoCompleteUrl", 
componentResources.createEventLink("clientNameAutoComplete").toURI(),
"divisionId", "#" + divisionId.getClientId(),
"divisionName", "#" + divisionNameField.getClientId(),
"includeInactiveDivisions", "#" + 
includeInactiveDivisionsField.getClientId(),
"divisionNameAutoCompleteUrl", 
componentResources.createEventLink("divisionNameAutoComplete").toURI()
);

javaScriptSupport.addInitializerCall("clientDivisionAutoComplete", 
specs);
}


The exception I'm getting is:

Caused by: java.lang.NullPointerException
at 
org.apache.tapestry5.corelib.components.Hidden.getClientId(Hidden.java:152)
at 
com.starpoint.instihire.web.components.ClientDivisionAutoComplete.advised$afterRender_12ecdf1ecc23b3d1(ClientDivisionAutoComplete.java:128)
at 
com.starpoint.instihire.web.components.ClientDivisionAutoComplete$Invocation_afterRender_12ecdf1ecc23b3d0.proceedToAdvisedMethod(Unknown
 Source)


Is my approach wrong?  This all works when I put it together in a single page, 
but I'm not having much luck extracting it to a component.

Thanks for your help in advance
Tony Nelson
Starpoint Solutions




Since 1982, Starpoint Solutions has been a trusted source of human capital and 
solutions. We are committed to our clients, employees, environment, community 
and social concerns.  We foster an inclusive culture based on trust, respect, 
honesty and solid performance. Learn more about Starpoint and our social 
responsibility at http://www.starpoint.com/social_responsibility

This email message from Starpoint Solutions LLC is for the sole use of  the 
intended recipient(s) and may contain confidential and privileged  information. 
 Any unauthorized review, use, disclosure or distribution is prohibited.  If 
you are not the intended recipient, please contact the sender by reply email 
and destroy all copies of the original message.  Opinions, conclusions and 
other information in this message that do not relate to the official business 
of Starpoint Solutions shall be understood as neither given nor endorsed by it.

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



Re: HashMap as a Grid source - once again

2013-03-19 Thread Lance Java
> Actually, it would partially work: it would returns a working BeanModel
implementation so that you can add properties (PropertyModel instances) to
it. 

Yeah, I figured that out in my demo. I used
beanModelSource.createDisplayModel(Object.class, messages) and a
MapPropertyConduit



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/HashMap-as-a-Grid-source-once-again-tp5720533p5720551.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: HashMap as a Grid source - once again

2013-03-19 Thread Thiago H de Paula Figueiredo
On Tue, 19 Mar 2013 11:45:57 -0300, Lance Java   
wrote:


You don't need to implement a GridDataSource, tapestry will happily  
coerce a

collection to a GridDataSource.

I think the question you should be asking yourself is why do you have a  
list

of HashMaps in the first place? A list of beans is a much clearer API.


And way more organized, structured data . . .

--
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: HashMap as a Grid source - once again

2013-03-19 Thread Thiago H de Paula Figueiredo
On Tue, 19 Mar 2013 11:17:22 -0300, Lance Java   
wrote:



So without the custom model, you can't use a HashMap with the grid

Correct!

But then a logical question is how to set up this model without an  
actual

bean?

BeanModel is an interface, so implement it ;)


There's no need for that.


model = beanModelSource.createDisplayModel(Set.class, null);
Would this work?

No, createDisplayModel assumes that the class is a bean type. It uses the
getters to create a BeanModel.


Actually, it would partially work: it would returns a working BeanModel  
implementation so that you can add properties (PropertyModel instances) to  
it.


--
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: HashMap as a Grid source - once again

2013-03-19 Thread Lance Java
Turns out you don't need to implement a BeanModel or a GridDataSource. I've
added a demo to tapestry-stitch which does exactly what you want. The demo
can be seen here:

http://tapestry-stitch.uklance.cloudbees.net/mapgriddemo

Now, the question remains... do you really want a collection of Maps?



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/HashMap-as-a-Grid-source-once-again-tp5720533p5720547.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: HashMap as a Grid source - once again

2013-03-19 Thread Lance Java
You don't need to implement a GridDataSource, tapestry will happily coerce a
collection to a GridDataSource.

I think the question you should be asking yourself is why do you have a list
of HashMaps in the first place? A list of beans is a much clearer API.




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/HashMap-as-a-Grid-source-once-again-tp5720533p5720545.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: HashMap as a Grid source - once again

2013-03-19 Thread esper
Please tell me you're kidding... To populate my grid with the list of
hashsets I need to:
- implement my own grid data source
- implement my own bean model

but why isn't there an example on how to do this? I would imagine this being
a normal day-to-day case in web development?!



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/HashMap-as-a-Grid-source-once-again-tp5720533p5720543.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: HashMap as a Grid source - once again

2013-03-19 Thread Lance Java
> So without the custom model, you can't use a HashMap with the grid
Correct!

> But then a logical question is how to set up this model without an actual
> bean? 
BeanModel is an interface, so implement it ;)

> model = beanModelSource.createDisplayModel(Set.class, null); 
> Would this work?
No, createDisplayModel assumes that the class is a bean type. It uses the
getters to create a BeanModel.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/HashMap-as-a-Grid-source-once-again-tp5720533p5720542.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



css to grid in .java

2013-03-19 Thread SemVis
Hi all,

i have a grid and beanmodel for it.
Can i add css class in java part getModel() to couple of my columns without
describe it in tml?
if yes, how?

Thanks.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/css-to-grid-in-java-tp5720538.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: HashMap as a Grid source - once again

2013-03-19 Thread esper
Fair enough. So without the custom model, you can't use a HashMap with the
grid.

But then a logical question is how to set up this model without an actual
bean?
model = beanModelSource.createDisplayModel(Set.class, null);
Would this work?



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/HashMap-as-a-Grid-source-once-again-tp5720533p5720541.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: css to grid in .java

2013-03-19 Thread Lance Java
If the "lean" parameter is false, tapestry will add the property name to each
td, allowing you to style columns differently with CSS.

If you want full customisation, check out my GridDecorator here:
http://tapestry-stitch.uklance.cloudbees.net/griddecoratordemo



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/css-to-grid-in-java-tp5720538p5720540.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: HashMap as a Grid source - once again

2013-03-19 Thread Lance Java
No, that won't even compile ;)

If you want to avoid all the fuss of a custom BeanModel, you will need to
use a List instead of a List>.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/HashMap-as-a-Grid-source-once-again-tp5720533p5720539.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: HashMap as a Grid source - once again

2013-03-19 Thread esper
Ok. so let's say that I don't provide a model. Will this make my grid happy?

public Object getRowValue(int index) { 
  // This will provide my grid with the values
  hashMap.get(index).values();
} 

public Class<> getRowType() { 
  // This will act as a model and will feed table header
  hashMap.get(cashedIndex).keySet();
} 



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/HashMap-as-a-Grid-source-once-again-tp5720533p5720537.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: HashMap as a Grid source - once again

2013-03-19 Thread Lance Java
The grid is ultimately driven by it's source (GridDataSource) and it's model
(BeanModel). If a model is not provided, the grid will auto-generate one
from GridDataSource.getRowType().

You will most likely create a custom BeanModel. Or, you could wrap your maps
in a bean with getters and setters.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/HashMap-as-a-Grid-source-once-again-tp5720533p5720536.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: HashMap as a Grid source - once again

2013-03-19 Thread esper
You're right - sorry for that. It's List>



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/HashMap-as-a-Grid-source-once-again-tp5720533p5720535.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: HashMap as a Grid source - once again

2013-03-19 Thread Lance Java
Are you sure you want to generate a grid from a Map and not a
List>?







--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/HashMap-as-a-Grid-source-once-again-tp5720533p5720534.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



HashMap as a Grid source - once again

2013-03-19 Thread esper
Hi all,

There are a lot of ways to present a hashmap in a view page but I'm
interested in my own GridDateSource implementation. There has been some
discussion regarding that on this forum but I could never find an example.

It's easy to just pass the hashmap values back to tapestry grid but how does
tapestry figure out table headers, sorting, paging even since the hash map
is not ordered?

This is just an example of GridDataSource implementation for a CustomSource:
public class CustomSource implements GridDataSource {

private HashMap hashMap;

public CustomSource(HashMap myHashMap) {
this.hashMap = myHashMap;
}

public int getAvailableRows() {
return hashMap.size();
}

public void prepare(int startIndex, int endIndex, List
sortConstraints) {

}

public Object getRowValue(int index) {

}

public Class<> getRowType() {

}
}


Could someone please enlighten me with the details?

Cheers!



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/HashMap-as-a-Grid-source-once-again-tp5720533.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: Read only bindings - How do I set their value from a mixin?

2013-03-19 Thread Lance Java
Since I'm ultimately trying to apply a mixin to a symbol: binding on the
grid, a new binding won't help me. I'm asking for the core code to be
changed for literal: and symbol: bindings.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Read-only-bindings-How-do-I-set-their-value-from-a-mixin-tp5720446p5720532.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: GridDataSource, Nested Grid

2013-03-19 Thread Lance Java
This might be better (not tested):



public GridDataSource getPeople() { 
Person emptyPerson = new Person(null, null, null, .);
GridDataSource delegate = new HibernateGridDataSource(hibernateSession,
Person.class);
return new NeverEmptyGridDataSource(delegate, emptyPerson);
}

public NeverEmptyGridDataSource implements GridDataSource {
   private int availableRows;
   private Object emptyRow;
   private boolean empty = false;
   private GridDataSource delegate;

   public NeverEmptyGridDataSource(GridDataSource delegate, Object emptyRow)
{
  this.delegate = delegate;
  this.emptyRow = emptyRow;
  this.availableRows = delegate.getAvailableRows();
  if (this.availableRows == 0) {
 this.availableRows = 1;
 this.empty = true;
  }
   }

   public void prepare(int startIndex, int endIndex, List
sortConstraints) {
  if (!empty) {
 delegate.prepare(startIndex, endIndex, sortConstraints);
  }
   }

   public Object getRowValue(int index) {
  if (empty) return emptyRow;
  return delegate.getRowValue(index);
   }


   public Class getRowType() {
  if (empty) return emptyRow.getClass();
  return delegate.getRowType();
   }
}



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/GridDataSource-Nested-Grid-tp5720342p5720531.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:

2013-03-19 Thread Ken in Nashua
Solved... patch submitted

see 

http://jira.codehaus.org/browse/TYNAMO-203


  

Re:

2013-03-19 Thread Thiago H de Paula Figueiredo
Try without tapestry-security first (at least without any permission  
checking around Palette), so you know whether the problem is caused by it  
or some problem in Palette itself. In addition, Palette relies on  
JavaScript, so any other JavaScript errors may cause Palette to not work.


--
Thiago H. de Paula Figueiredo

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



users@tapestry.apache.org

2013-03-19 Thread Ken in Nashua
Folks,

I am having difficulty with this widget.

It renders populated with items on the left side.

Upon clicking any items on left side... the border around the left side turns 
red (implying some security issue or items disabled or readonly)... I am 
guessing.

If I select any items on left side the ADD button up top never enables and is 
always greyed out.

The items I am rendering within this palette are enumerations... as follows:

public class Person
{
public static enum Role
{
anonymous(1), administrator(2);
}

private Set roles = new HashSet();

@CollectionOfElements(targetElement = Role.class)
public Set getRoles()
{
return roles;
}

public void setRoles(Set roles)
{
this.roles = roles;
}
...
}

Is there anything in the above class that would cause the palette to behave 
this way ?

I am using tapestry-security... but not sure if security would cause this 
widget to act this way.

Thanks for any tips

Ken
  

Re: GridDataSource, Nested Grid

2013-03-19 Thread Lance Java
No, the GridCollapse mixin expects that each table it collapses has exactly
the same headers. The first time it encounters a grid, it copies it's
headers to the parent grid. For all other grids, it moves the rows to the
parent grid. It's probably easiest if your return a "source" parameter with
1 empty row in it.

eg:



public Collection getPeople() {
Collection people = peopleService.getPeople();
if (people.isEmpty()) {
Person emptyPerson = new Person(null, null, null, .);
return Collections.singleton(emptyPerson);
}
return people;
}

You could probably do this more generically with a mixin. The mixin would
wrap the grid component's GridDataSource with an implementation that never
returns 0 rows.





--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/GridDataSource-Nested-Grid-tp5720342p5720527.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: GridDataSource, Nested Grid

2013-03-19 Thread willbro
sorry i have been busy and did not get time to look into it. what do you mean
with render a grid with single row? do you mean somthing like this?

  


since i nead a source attribute for grid? i am wondering what comes there?

thanks




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/GridDataSource-Nested-Grid-tp5720342p5720526.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