Re: [RELEASE] Tapestry 5.3.3

2012-04-25 Thread Chris Mylonas
Thank you tapestry team.

Javadocs were the first thing i got today, played around with the luxury of 
having them on my machine - been busy ever since.  Look forward to referring to 
them.
Cheers

On 26/04/2012, at 4:53 AM, Howard Lewis Ship wrote:

> The Tapestry Team is very proud to announce the availability of Apache
> Tapestry 5.3.3.
> 
> Tapestry is primarily available for download via Maven, from the Maven
> central repository:
> 
> 
>  org.apache.tapestry
>  tapestry-core
>  5.3.3
> 
> 
> You can also download the binary, source, or JavaDoc archives.
> 
> Tapestry 5.3.3 is the latest maintenance release from the stable 5.3
> release branch. Full details are in the release notes, but here's a
> few highlights:
> 
> Fixed a significant problem with field access in component subclasses
> * A number of minor annoyances fixed
> * A pre-compiled binaries ZIP archive is now available, in addition to
> sources and JavaDoc ZIP archives
> 
> As usual for each Tapestry 5 release we've made great efforts to
> ensure an easy upgrade path; but be sure to read the upgrade notes
> carefully as some interfaces and methods that were deprecated in
> earlier major releases may have been removed: you should recompile and
> retest your application after upgrading your dependency. If you still
> have problems, use the Tapestry user mailing list to get support.
> 
> Downloads: http://tapestry.apache.org/download.html
> Release notes: http://tapestry.apache.org/release-notes-533.html
> 
> -- 
> 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
> 
> -
> 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: Pagelink above grid picks up context from last pagelink in grid

2012-04-25 Thread netdawg
Thanks, all, for college of knowledge ;-).  Much appreciated.  

1.  I am not beaneditorform (or beaneditor) in EditPerson.tml, therefore the
@Persist annotation is needed in Person.java for the form to accept the
submit.  

http://tapestry.apache.org/hibernate-user-guide.html

Just added onPrepareForRender to create a new Person when in Create mode.  

Bottom line, I really see no other workarounds to simply doing the
following: 

Create
new

This create a error in logs, trying to pull up the record with zero id, but
the application chugs along fine.  Using null or $N0 for context breaks the
list page.  Only zero works.  

The application is working fine now...doing all the CRUD.  I would like to
extend it to CRUDS-QBE...search and QBE as well...that is what I am working
on now.  Will follow the suggestions here.  

Thanks, again.  





--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Pagelink-above-grid-picks-up-context-from-last-pagelink-in-grid-tp5660049p572.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: Linking my app with MYSQL

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

On Wed, 25 Apr 2012 20:44:42 -0300, DegeneRatoR  wrote:

I have set up hibernate and now control flow over data base processing (  
i.e. it shows articles ), however what is not doing is I can't log in,  
even

though in my opinion everything is fine? What am I doing wrong?


You're asking for help giving almost no information nor code. It's almost  
impossible to help with so sparse information.


--
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: Linking my app with MYSQL

2012-04-25 Thread Chris Mylonas
nabble ate half your post, some of it was relevant

###
I have set up hibernate and now control flow over data base processing ( i.e. 
it shows articles ), however what is not doing is I can't log in, even though 
in my opinion everything is fine? What am I doing wrong? When I press Sumbit 
nothing happens, but I have clearly stated in code to process something, which 
is odd to me, as it worked previously while using 5.0.18. 
###

what version did you upgrade to.
did you read the release notes for any changes for stuff you use.
are there any stack traces etc.


On 26/04/2012, at 9:44 AM, DegeneRatoR wrote:

> I have set up hibernate and now control flow over data base processing ( i.e.
> it shows articles ), however what is not doing is I can't log in, even
> though in my opinion everything is fine? What am I doing wrong?
> 
> Please help.
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Linking-my-app-with-MYSQL-tp5666272p5666272.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



Linking my app with MYSQL

2012-04-25 Thread DegeneRatoR
I have set up hibernate and now control flow over data base processing ( i.e.
it shows articles ), however what is not doing is I can't log in, even
though in my opinion everything is fine? What am I doing wrong?

Please help.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Linking-my-app-with-MYSQL-tp5666272p5666272.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: Composite components like in JSF2?

2012-04-25 Thread Howard Lewis Ship
Nope, they apply at different times.

The p: namespace is used when Tapestry parses the template.  Later,
when it is loading the page and assembling the components, it can tie
a named parameter block in a page (or container) template to a
parameter of a component within the template.

Interestingly, it may be a bug that @SupportsInformalParameters is
needed when the parameter block is being plugged into a formal
parameter (a declared parameter, via @Parameter on a component field).
 That should only be necessary for components such as
BeanEditor/BeanEditForm and Grid, where the parameters that will be
passed into the component are figured out dynamically, based on naming
conventions (matching properties of a specific object to block
parameters).


On Wed, Apr 25, 2012 at 3:52 PM, Chris Mylonas  wrote:
>> Your component needs to have the @SupportsInformalParameters annotation so 
>>  elements are recognized as block parameters.
>
>
> Just a quickie,
>
> Is this an alternative method than declaring the "p" at the top of the tml 
> file - namespace?
> -
> 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

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



Re: Composite components like in JSF2?

2012-04-25 Thread Chris Mylonas
> Your component needs to have the @SupportsInformalParameters annotation so 
>  elements are recognized as block parameters.


Just a quickie,

Is this an alternative method than declaring the "p" at the top of the tml file 
- namespace?
-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Composite components like in JSF2?

2012-04-25 Thread membersound
Wow amazing, now it works as expected. tyvm!

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Composite-components-like-in-JSF2-tp5665396p5666010.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: Extract navigation to own menu component - links stop working

2012-04-25 Thread membersound
Oh yes you're right, my fault.
Nevertheless the problem persists...

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Extract-navigation-to-own-menu-component-links-stop-working-tp5665580p5666000.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: Extract navigation to own menu component - links stop working

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

On Wed, 25 Apr 2012 15:08:47 -0300, membersound  wrote:


Hi,


Hi!



I'm just trying to clean up my layout.tml, and trying to separate several
contents in custom components.
In this case I want to put the whole menu in a menu.tml, and it shows up
already, BUT the navigation is not executed.
The app simply does nothing when clicking a  link, whereas when the  
pageLink

is directly included in the layout.tml it works as expected.

What am I messing??


Are you sure the t namespace is correct? Shouldn't it be  
http://tapestry.apache.org/schema/tapestry_5_3.xsd?


--
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: Need Help With Event URL Rewriting

2012-04-25 Thread Mike Dunbar
Thought I'd share what finally worked with this. In the end, it turned out to 
be pretty simple. We just:
-  Implemented ComponentEventLinkEncoder.createComponentEventLink, wherein we 
a) Return a Link with the URL of our choice and b) Stash away the associated 
ComponentEventRequestParameters object in a application-scoped map, keyed off 
both the current user and the ComponentEventRequestParameters object generated 
by Tapestry. The link also has a query param for the map key (int hash code 
value).
- Implemented Dispatcher.dispatch, wherein we check each request for the above 
query param. If not there, just return false to delegate request processing. If 
found, we use it to lookup the ComponentEventRequestParameters from the map and 
call componentRequestHandler.handleComponentEvent(componentEventReqParams).
Not saying it is the only (or best) way to do it, but working nicely so far. 
Thanks for all the other tips!

Mike


From: Mike Dunbar
Sent: Monday, April 09, 2012 11:51 AM
To: 'users@tapestry.apache.org'
Subject: Need Help With Event URL Rewriting

Hi,
We are trying to build an application with RESTful URLs, rather than the 
out-of-box Tapestry URLs. We've been able to do this for our page URLs by using 
Tynamo tapestry-routing (http://tynamo.org/tapestry-routing+guide). We would 
like to do the same thing for the event link URLs contained on our pages. I'm 
experimenting with ComponentEventLinkEncoder and have been able to use 
createComponentEventLink to return an event Link with an arbitrary URL. 
However, when the link is clicked Tapestry does not recognize this as a 
component event request, and hence doesn't call the decodeComponentEventRequest 
method in my ComponentEventLinkEncoder. Could someone please point me in the 
right direction to both:

- Generate an arbitrary URL for an event (this part is working).
- Have tapestry recognize the 'click' of that same arbitrary URL as an event, 
so I can route it to my event handler method (not yet working).

Thanks,
Mike


Re: Composite components like in JSF2?

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

On Wed, 25 Apr 2012 13:39:50 -0300, membersound  wrote:


Hi,


Hi!


how can I build composite components like in JSF2?


I don't know exactly what JSF2 composite components are, but Tapestry  
components are intrinsically composite, as you can use one component in  
the template of another component.


The following doea not work, but I don't know why? It just simple does  
not show up anything!


Here's the code that Nabble ate:

sidebar.tml:



sidebar.java:
@Property
@Parameter(defaultPrefix = BindingConstants.LITERAL)
private Block header;

@Property
@Parameter(defaultPrefix = BindingConstants.LITERAL)
private Block content;

Your component needs to have the @SupportsInformalParameters annotation so  
 elements are recognized as block parameters.


--
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 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: Composite components like in JSF2?

2012-04-25 Thread Robert Zeigler
"The following" didn't show up. Try pasting in code instead of attaching.

Robert

On Apr 25, 2012, at 4/2511:39 AM , membersound wrote:

> Hi,
> 
> how can I build composite components like in JSF2?
> 
> The following doea not work, but I don't know why? It just simple does not
> show up anything!
> 
> 
> 
> ty
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Composite-components-like-in-JSF2-tp5665396p5665396.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: Dynamic forms

2012-04-25 Thread Lance Java
BeanEditForm and BeanEditor both accept a BeanModel parameter. You will
need to implement a custom BeanModel which is likely based on config stored
in a database


[RELEASE] Tapestry 5.3.3

2012-04-25 Thread Howard Lewis Ship
The Tapestry Team is very proud to announce the availability of Apache
Tapestry 5.3.3.

Tapestry is primarily available for download via Maven, from the Maven
central repository:


  org.apache.tapestry
  tapestry-core
  5.3.3


You can also download the binary, source, or JavaDoc archives.

Tapestry 5.3.3 is the latest maintenance release from the stable 5.3
release branch. Full details are in the release notes, but here's a
few highlights:

Fixed a significant problem with field access in component subclasses
* A number of minor annoyances fixed
* A pre-compiled binaries ZIP archive is now available, in addition to
sources and JavaDoc ZIP archives

As usual for each Tapestry 5 release we've made great efforts to
ensure an easy upgrade path; but be sure to read the upgrade notes
carefully as some interfaces and methods that were deprecated in
earlier major releases may have been removed: you should recompile and
retest your application after upgrading your dependency. If you still
have problems, use the Tapestry user mailing list to get support.

Downloads: http://tapestry.apache.org/download.html
Release notes: http://tapestry.apache.org/release-notes-533.html

-- 
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

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



Extract navigation to own menu component - links stop working

2012-04-25 Thread membersound
Hi,

I'm just trying to clean up my layout.tml, and trying to separate several
contents in custom components.
In this case I want to put the whole menu in a menu.tml, and it shows up
already, BUT the navigation is not executed.
The app simply does nothing when clicking a  link, whereas when the pageLink
is directly included in the layout.tml it works as expected.

What am I messing??



this WORKS:



this works NOT, WHY?



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Extract-navigation-to-own-menu-component-links-stop-working-tp5665580p5665580.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: Dynamic forms

2012-04-25 Thread trsvax
http://tapestry.1045711.n5.nabble.com/writer-writeRaw-String-text-td5601234.html#a5601626

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Dynamic-forms-tp5665475p5665566.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: tynamo-resteasy - different errors along the way

2012-04-25 Thread Kalle Korhonen
On Wed, Apr 25, 2012 at 8:54 AM, Chris Mylonas  wrote:
> Stopped app to try and work out what went wrong realised I had a few more 
> things to do.
> 6.  Contributed REST resources as per documentation
>        /**
>         * Contributions to the RESTeasy main Application, insert all your 
> RESTeasy
>         * singletons services here.
>         */
>        @Contribute(javax.ws.rs.core.Application.class)
>        public static void configureRestResources(Configuration 
> singletons,
>                        DomainResource domainResource) {
>                singletons.add(domainResource);
>        }
> New error - Exception constructing service 'ResteasyRequestFilter': Error 
> building service proxy for service 'Application' (at 
> org.tynamo.resteasy.Application(Collection) (at Application.java:14) via 
> org.tynamo.resteasy.ResteasyModule.bind(ServiceBinder) (at 
> ResteasyModule.java:31)): Error invoking service contribution method 
> org.opencsta.reststuff.services.AppModule.configureRestResources(Configuration,
>  DomainResource): No service implements the interface 
> org.opencsta.reststuff.rest.DomainResource.
>

Slow down, read the error message and understand what it is saying.
You are trying to inject your DomainResource but you haven't declared
it as a service. Either build(), bind() or @Autobuild the
domainResource, e.g. public static void
configureRestResources(Configuration singletons, @Autobuild
DomainResource domainResource) to make it work.

Kalle

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



Dynamic forms

2012-04-25 Thread Tim Koop
I'm making a way for the user to create a dynamic form, with their own 
defined fields.


But how can I do this with Tapestry, since it links the form fields with 
Java variables?  I can't create dynamic variables.


Any ideas?  Thanks.

Tim Koop
t...@timkoop.com 
www.timkoop.com 

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



Re: Ajax failure: Status 500 for /mobile/browsegroups.loadingscreen: org.apache.tapestry5.runtime.ComponentEventException Communication with the server failed: org.apache.tapestry5.runtime.ComponentEv

2012-04-25 Thread sommeralex
how can i get the stacktrace? my eclipse console does not show any errors. I
was trying to instantiate my list with an empty list if the list is null,
but the error consists:

package com.airwriting.frontend.pages.mobile;

import java.util.ArrayList;
import java.util.List;


import org.apache.tapestry5.Block;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.Link;
import org.apache.tapestry5.annotations.Environmental;
import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.InjectComponent;
import org.apache.tapestry5.annotations.OnEvent;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.corelib.components.Zone;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.Request;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;
import org.apache.tapestry5.EventConstants;

import com.airwriting.domain.GeoPoint;
import com.airwriting.domain.Group;
import com.airwriting.service.GeometryService;
import com.airwriting.service.data.GroupService;
import com.vividsolutions.jts.geom.Geometry;

@Import(library = {
"context:js/mobilebrowsegroups.js" 
})
public class BrowseGroups {

@Persist
private List groups;

@Property
private Group group;

@Inject
private Block listBlock;


@Inject
private GroupService groupService;
@Inject
private JavaScriptSupport jsSupport;
@Inject
private Request request;
@Inject
private ComponentResources componentResources;

@Property
private boolean isLocationRetrieved;


public void setupRender() {
System.out.println("setupRender");
isLocationRetrieved = false;

}

public void afterRender(){
 Link linkGetGroupsOnLocation =
componentResources.createEventLink("getGroupsOnLocation");
 jsSupport.addScript("init('%s');", 
linkGetGroupsOnLocation.toURI());
}
 

public Object onGetGroupsOnLocation(){

Double lat = Double.parseDouble( request.getParameter("lat") );
Double lng = Double.parseDouble( request.getParameter("lng") );

Geometry location = GeometryService.getPolygon(new 
GeoPoint(lat, lng),
5);
groups = groupService.getGroupsOnLocation(location);
System.out.println(groups.size());
System.out.println("ok");
return this.listBlock;
}

Object onProgressiveDisplayFromLoadingScreen(){
sleep(5000);
System.out.println("si; " + groups.size());
return this.listBlock;

}

public List getGroups(){

if (groups == null){
return new ArrayList();
}

return this.groups;
}


public static void sleep(int milis){
try {
Thread.sleep(milis);

}catch (final Exception e) {

}
}
}



JAVASCRIPT:

var urlGetGroupsOnLocation;



function init(url) {
urlGetGroupsOnLocation = url;
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {

new Ajax.Request(urlGetGroupsOnLocation, {
onSuccess : finish,
parameters : 'lat=' + position.coords.latitude 
+ '&lng=' +
position.coords.longitude
});



}, function(msg) {
alert ("geolocation not supported..")
});
}

}

function finish(){

}


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Ajax-failure-Status-500-for-mobile-browsegroups-loadingscreen-org-apache-tapestry5-runtime-Componentn-tp5663902p5665446.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-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
>


Composite components like in JSF2?

2012-04-25 Thread membersound
Hi,

how can I build composite components like in JSF2?

The following doea not work, but I don't know why? It just simple does not
show up anything!



ty

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Composite-components-like-in-JSF2-tp5665396p5665396.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



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


tynamo-resteasy - different errors along the way

2012-04-25 Thread Chris Mylonas
Hi,

I've gone from zero to consuming (GET) RS and some JAXB in the last 24 hours 
and am trying tynamo-resteasy for the first time.

I've hit an error on start up of my resteasy integration test and I'm wondering 
where I stuffed up critically (the app started the first time), and has since 
gone through two sets of errors.
Fundamentally, does tynamo's PropertyDescriptor link an entity to a 
rest-resource?

Here's the steps I followed.

1.  Created standard tapestry archetype with 5.3.2
2.  Changed from tapestry-core to tapestry-hibernate & hsqldb
3.  Added tynamo-resteasy & resteasy-jackson-provider
4.  Coded my singleton resource in the "rest" directory
5.  Coded my entity in the "entities" director

The app stared at this point, when I went to save my entity (beaneditform), the 
error was that it had detached.

Stopped app to try and work out what went wrong realised I had a few more 
things to do.

6.  Contributed REST resources as per documentation
/**
 * Contributions to the RESTeasy main Application, insert all your 
RESTeasy
 * singletons services here.
 */
@Contribute(javax.ws.rs.core.Application.class)
public static void configureRestResources(Configuration 
singletons,
DomainResource domainResource) {
singletons.add(domainResource);
}


New error - Exception constructing service 'ResteasyRequestFilter': Error 
building service proxy for service 'Application' (at 
org.tynamo.resteasy.Application(Collection) (at Application.java:14) via 
org.tynamo.resteasy.ResteasyModule.bind(ServiceBinder) (at 
ResteasyModule.java:31)): Error invoking service contribution method 
org.opencsta.reststuff.services.AppModule.configureRestResources(Configuration, 
DomainResource): No service implements the interface 
org.opencsta.reststuff.rest.DomainResource.


Tried to look for a connection between the entity and the resource singleton.

7.  Realised I hadn't put the @PropertyDescriptor(index = 0)
which comes from org.tynamo.descriptor.annotation.PropertyDescriptor;
onto my getId() method on the entity.


There is no import for my project in eclipse.  Is this because I started the 
project as a tapestry maven project rather than a tynamo project?

Thanks for guidance.




Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Lance Java
Hmm... that's a tricky one... I assumed that RenderInformals always added
informals to the currently rendering element but I can see that this won't
happen if an element has not been added to the MarkupWriter at
beginRender() which happens with the bean edit form. In fact,
RenderInformals won't work as expected on most components which use a
template.

You could write your own mixin to render informal parameters on the last
child of the current element (not tested)

@MixinAfter
@SupportsInformalParameters
public class RenderInformalsOnLastChild {
@Inject
private ComponentResources resources;

void beginRender(MarkupWriter writer)
{
List children = writer.getElement().getChildren();
Element lastChild = (Element) children.get(children.size() - 1);
renderInformals(lastChild);
}

protected void renderInformals(Element element) {
for (String name : resources.getInformalParameterNames()) {
   element.attribute(name, resources.getInformalParameter(name,
String.class));
}
}
}

On Wednesday, 25 April 2012, Felix Scheffer  wrote:
> Thanks! That was fast :-)
>
> I tried using RenderInformals
>
> 
>   class="form-horizontal" >
> 
>
> and the result is:
>
> 
>   
>
>
> now the class attribute is present, but on the wrong tag (should be on the
> form tag).
> Looks like the form tag has not been rendered when
> RenderInformals.beginRender() method is called.
>
> I would expected that BeanEditForm would call
> "resources.renderInformalParameters(writer);" but it doesnt.  Very
> confusing...
>
> I also tried 5.3.2 and it's exactly the same.
>
> Felix Scheffer
>
>
> 2012/4/25 Chris Mylonas 
>
>> was the sarcasm meter on that Lance?
>> :)  - hard to tell at nearly midnight
>>
>> On 25/04/2012, at 11:22 PM, Lance Java wrote:
>>
>> > Try adding the following attribute:
>> > t:mixins="renderInformals"
>> >
>> > If it works, there's a bug ;)
>> >
>> > On Wednesday, 25 April 2012, Felix Scheffer 
>> wrote:
>> >> Hi,
>> >>
>> >> i am using a BeanEditForm and added a class attribute to it, i.e.:
>> >>
>> >> 
>> >>  ...
>> >> 
>> >>
>> >> but the class attribute does not appear in the actual html code:
>> >>
>> >> > >> onsubmit="javascript:return Tapestry.waitForPage(event);" action="..."
>> >> method="post" id="form">
>> >>
>> >> BeanEditForm has the @SupportsInformalParameters annotation, so am i
>> >> missing something or is this a bug?
>> >>
>> >> Tapestry version is 5.3.3
>> >>
>> >> Thanks a lot!
>> >>
>> >> Felix Scheffer
>> >>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>


Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Chris Mylonas
Cool,  good to know for future -  My n00bness is still cool too!
I've added it to the rosetta stone jira 
(https://issues.apache.org/jira/browse/TAP5-1894) for the 
more-than-one-way-to-skin-a-cat approach of getting stuff done in Tapestry.



On 26/04/2012, at 12:28 AM, Felix Scheffer wrote:

> Grid works fine. It's using inheritInformalParameters
> 
> @Component(parameters = "class=tableClass", inheritInformalParameters =
> true)
> private Any table;
> 
> 
> 2012/4/25 Chris Mylonas 
> 
>> GridColoum suffers from the same thing having a look at the code.  There
>> is no sign of resources.renderInformalParameters()
>> Same for Grid.
>> 
>> 
>> hehe what I've learned this week from the list, you'll have to
>> contribute the NoFUD service to the registry with @EagerLoad to get in
>> before the rest of it starts up.  Hopefully yuicompressor won't give you
>> schtick in tomcat 7 for multi zoned AJAX with IE6*
>> 
>> 
>> *please don't mind the embellishment.
>> 
>> On 26/04/2012, at 12:06 AM, Lance Java wrote:
>> 
>>> I'm happy to call a bug a bug but I shall valiantly defend my baby
>>> (tapestry) from FUD
>> 
>> 
>> -
>> 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: Recommended method to reference assets in .css file?

2012-04-25 Thread Lenny Primak
And what an awesome module it is!


On Apr 25, 2012, at 8:01 AM, Cezary Biernacki  wrote:

> On Wed, Apr 25, 2012 at 1:09 AM, yazdog8  wrote:
> 
>> If you're using Less CSS (or maybe sass possibly), you can set some basic
>> variables at the top of your file that can be used as a cache buster in
>> your
>> paths.
>> 
>> http://lesscss.org/#-variables
>> 
> 
> And you can even directly integrate LessCSS with Tapestry using my
> t5conduit library:
> https://github.com/cezary-biernacki/t5conduit
> 
> Best regards,
> Cezary

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



Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Felix Scheffer
Grid works fine. It's using inheritInformalParameters

@Component(parameters = "class=tableClass", inheritInformalParameters =
true)
private Any table;


2012/4/25 Chris Mylonas 

> GridColoum suffers from the same thing having a look at the code.  There
> is no sign of resources.renderInformalParameters()
> Same for Grid.
>
>
> hehe what I've learned this week from the list, you'll have to
> contribute the NoFUD service to the registry with @EagerLoad to get in
> before the rest of it starts up.  Hopefully yuicompressor won't give you
> schtick in tomcat 7 for multi zoned AJAX with IE6*
>
>
> *please don't mind the embellishment.
>
> On 26/04/2012, at 12:06 AM, Lance Java wrote:
>
> > I'm happy to call a bug a bug but I shall valiantly defend my baby
> > (tapestry) from FUD
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Chris Mylonas
GridColoum suffers from the same thing having a look at the code.  There is no 
sign of resources.renderInformalParameters()
Same for Grid.


hehe what I've learned this week from the list, you'll have to contribute 
the NoFUD service to the registry with @EagerLoad to get in before the rest of 
it starts up.  Hopefully yuicompressor won't give you schtick in tomcat 7 for 
multi zoned AJAX with IE6*


*please don't mind the embellishment.

On 26/04/2012, at 12:06 AM, Lance Java wrote:

> I'm happy to call a bug a bug but I shall valiantly defend my baby
> (tapestry) from FUD


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



Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Felix Scheffer
Thanks guys for the quick response. Much appreciated!


2012/4/25 Chris Mylonas 

> https://issues.apache.org/jira/browse/TAP5-1917
>
> Done.
>
>
> re: sarcasm earlier - there seems to be an increase in "is this a bug?"
> tacked onto each problem.  I thought you were just having a little fun on
> the list :)
> So far today, The List 1 : Tapestry-5.3.x 0
>
> Nice one Felix.
>
> Cheers
> Chris
>
> On 25/04/2012, at 11:49 PM, Lance Java wrote:
>
> > It seems that BeanEditor has the same bug. Pls put that in the Jira too
> >
> > Might be an idea to search all components with
> @SupportsInformalParameters
> > that don't call renderInformalParameters to find any others
>
>


Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Felix Scheffer
Thanks! That was fast :-)

I tried using RenderInformals


  


and the result is:


   
   

now the class attribute is present, but on the wrong tag (should be on the
form tag).
Looks like the form tag has not been rendered when
RenderInformals.beginRender() method is called.

I would expected that BeanEditForm would call
"resources.renderInformalParameters(writer);" but it doesnt.  Very
confusing...

I also tried 5.3.2 and it's exactly the same.

Felix Scheffer


2012/4/25 Chris Mylonas 

> was the sarcasm meter on that Lance?
> :)  - hard to tell at nearly midnight
>
> On 25/04/2012, at 11:22 PM, Lance Java wrote:
>
> > Try adding the following attribute:
> > t:mixins="renderInformals"
> >
> > If it works, there's a bug ;)
> >
> > On Wednesday, 25 April 2012, Felix Scheffer 
> wrote:
> >> Hi,
> >>
> >> i am using a BeanEditForm and added a class attribute to it, i.e.:
> >>
> >> 
> >>  ...
> >> 
> >>
> >> but the class attribute does not appear in the actual html code:
> >>
> >>  >> onsubmit="javascript:return Tapestry.waitForPage(event);" action="..."
> >> method="post" id="form">
> >>
> >> BeanEditForm has the @SupportsInformalParameters annotation, so am i
> >> missing something or is this a bug?
> >>
> >> Tapestry version is 5.3.3
> >>
> >> Thanks a lot!
> >>
> >> Felix Scheffer
> >>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Lance Java
I'm happy to call a bug a bug but I shall valiantly defend my baby
(tapestry) from FUD


Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Chris Mylonas
https://issues.apache.org/jira/browse/TAP5-1917

Done.


re: sarcasm earlier - there seems to be an increase in "is this a bug?" tacked 
onto each problem.  I thought you were just having a little fun on the list :)
So far today, The List 1 : Tapestry-5.3.x 0

Nice one Felix.

Cheers
Chris

On 25/04/2012, at 11:49 PM, Lance Java wrote:

> It seems that BeanEditor has the same bug. Pls put that in the Jira too
> 
> Might be an idea to search all components with @SupportsInformalParameters
> that don't call renderInformalParameters to find any others



Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Lance Java
It seems that BeanEditor has the same bug. Pls put that in the Jira too

Might be an idea to search all components with @SupportsInformalParameters
that don't call renderInformalParameters to find any others


Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Thiago H. de Paula Figueiredo
On Wed, 25 Apr 2012 10:37:49 -0300, Chris Mylonas   
wrote:



was the sarcasm meter on that Lance?
:)  - hard to tell at nearly midnight


I'd say that I can't think of any reason BeanEditForm shouldn't render  
attributes which aren't parameters. JIRA please? :)


--
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: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Lance Java
No sarcasm intended

It seems that the beanEditForm needs a one-liner added to it

ComponentResources.renderInformals(writer)

On Wednesday, 25 April 2012, Chris Mylonas  wrote:
> was the sarcasm meter on that Lance?
> :)  - hard to tell at nearly midnight
>
> On 25/04/2012, at 11:22 PM, Lance Java wrote:
>
>> Try adding the following attribute:
>> t:mixins="renderInformals"
>>
>> If it works, there's a bug ;)
>>
>> On Wednesday, 25 April 2012, Felix Scheffer 
wrote:
>>> Hi,
>>>
>>> i am using a BeanEditForm and added a class attribute to it, i.e.:
>>>
>>> 
>>>  ...
>>> 
>>>
>>> but the class attribute does not appear in the actual html code:
>>>
>>> >> onsubmit="javascript:return Tapestry.waitForPage(event);" action="..."
>>> method="post" id="form">
>>>
>>> BeanEditForm has the @SupportsInformalParameters annotation, so am i
>>> missing something or is this a bug?
>>>
>>> Tapestry version is 5.3.3
>>>
>>> Thanks a lot!
>>>
>>> Felix Scheffer
>>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Chris Mylonas
was the sarcasm meter on that Lance?
:)  - hard to tell at nearly midnight

On 25/04/2012, at 11:22 PM, Lance Java wrote:

> Try adding the following attribute:
> t:mixins="renderInformals"
> 
> If it works, there's a bug ;)
> 
> On Wednesday, 25 April 2012, Felix Scheffer  wrote:
>> Hi,
>> 
>> i am using a BeanEditForm and added a class attribute to it, i.e.:
>> 
>> 
>>  ...
>> 
>> 
>> but the class attribute does not appear in the actual html code:
>> 
>> > onsubmit="javascript:return Tapestry.waitForPage(event);" action="..."
>> method="post" id="form">
>> 
>> BeanEditForm has the @SupportsInformalParameters annotation, so am i
>> missing something or is this a bug?
>> 
>> Tapestry version is 5.3.3
>> 
>> Thanks a lot!
>> 
>> Felix Scheffer
>> 


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



Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Chris Mylonas
fyi,
it doesn't add the class normally.
It works when adding t:mixins="renderInformals"
I'm on 5.3.2


On 25/04/2012, at 11:22 PM, Lance Java wrote:

> Try adding the following attribute:
> t:mixins="renderInformals"
> 
> If it works, there's a bug ;)
> 
> On Wednesday, 25 April 2012, Felix Scheffer  wrote:
>> Hi,
>> 
>> i am using a BeanEditForm and added a class attribute to it, i.e.:
>> 
>> 
>>  ...
>> 
>> 
>> but the class attribute does not appear in the actual html code:
>> 
>> > onsubmit="javascript:return Tapestry.waitForPage(event);" action="..."
>> method="post" id="form">
>> 
>> BeanEditForm has the @SupportsInformalParameters annotation, so am i
>> missing something or is this a bug?
>> 
>> Tapestry version is 5.3.3
>> 
>> Thanks a lot!
>> 
>> Felix Scheffer
>> 


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



Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Lance Java
Try adding the following attribute:
t:mixins="renderInformals"

If it works, there's a bug ;)

On Wednesday, 25 April 2012, Felix Scheffer  wrote:
> Hi,
>
> i am using a BeanEditForm and added a class attribute to it, i.e.:
>
> 
>   ...
> 
>
> but the class attribute does not appear in the actual html code:
>
>  onsubmit="javascript:return Tapestry.waitForPage(event);" action="..."
> method="post" id="form">
>
> BeanEditForm has the @SupportsInformalParameters annotation, so am i
> missing something or is this a bug?
>
> Tapestry version is 5.3.3
>
> Thanks a lot!
>
> Felix Scheffer
>


BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Felix Scheffer
Hi,

i am using a BeanEditForm and added a class attribute to it, i.e.:


   ...


but the class attribute does not appear in the actual html code:



BeanEditForm has the @SupportsInformalParameters annotation, so am i
missing something or is this a bug?

Tapestry version is 5.3.3

Thanks a lot!

Felix Scheffer


Re: Pagelink above grid picks up context from last pagelink in grid

2012-04-25 Thread trsvax
> 2. Never use onActivate with a parameter 

Why not? What about onActivate(EventContext context)? It's always invoked,   
no matter how many activation context values is passed, and you have   
TypeCoercer-backed coercions for free. 


In general I never use onActivate at all. I try and define my page interface
completely with @PageActivationContext and @ActivationRequestParameter. I
also created @Connect which allows me to connect various page fields and I
use that to initialize things. I've found this gives me a very consistent
page interface and allows me to figure out what it is when using Plastic.
This allows me to do things like

@SessionState
@Property
private CartSession cartSession;

@Property
@Connect("cartSession.items")
private List items;

Don't worry CartSession is really stored in AWS DynamoDB not the session.

and

public class RowNew {

@ReplaceBreadCrumb(RowEdit.class)
Object onSuccess() {
return row; 
}

Which modifies my breadcrumb trail and causes the method return to the Edit
page with the correct arguments.

I can also dynamically generate documentation for each page and how to call
it. I can't help it I used ACS openacs.org before Tapestry.

> 6. Always use BeanEditForm 

I never use BeanEditForm, but I do use BeanEditor a lot. :) 

I can see that. I have a few hacks to make BeanEditForm work for me.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Pagelink-above-grid-picks-up-context-from-last-pagelink-in-grid-tp5660049p5664809.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: Pagelink above grid picks up context from last pagelink in grid

2012-04-25 Thread Lance Java
I agree with trsvax that avoiding session use is good. I can see that by
adding appropriate onActivate / onPassivate methods to my ListPersons
example, you could avoid session use.

I had a quick look at the PageActivationContextWorker and from what I can
see, @PageActivationContext is mandatory so will not work for this case
where it might be null. Perhaps a nice addition might be
@PageActivationContext(false) in a similar way to @Environmental.

Since onActivate() is called more often than you might think, I would avoid
using @PageActivationContext for complex objects (ie hibernate entities)
and I think it should only be used for storing the id's. Geoff describes
this more here
http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/onactivateandonpassivate/3


Re: Recommended method to reference assets in .css file?

2012-04-25 Thread badluck13
For practical reasons, 

I hold all css and image files, directly on server. And I reference full
path from application.

Its easier for designer to do changes directly on the server, and to not
handle with any IDE that we use. They mostly use Dreamweaver for editing
css.

Bojan

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Recommended-method-to-reference-assets-in-css-file-tp5663514p5664720.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: Pagelink above grid picks up context from last pagelink in grid

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

On Wed, 25 Apr 2012 02:07:55 -0300, netdawg  wrote:


THIAGO: return person.getId() breaks the Edit Page completely with Render
queue error in BeginRender...


Full stack trace please.

Fully qualifying the Edit link, as below, works fine to get the Edit  
page to render as Create (edit/) ...without filling the last record as  
(edit/5)


Create NEW Person/Advanced
Search


Have you tried Create  
NEW Person/Advanced

 Search


Page re-use seems fraught with session/objects management issues.


I still don't think so. Use the activation context (and passivate) and you  
won't have problems.


In any case, this is all looking like Struts, only a bit  
backwards...Create,

Edit and QBE pages are all identical except for the ACTION of the submit
button.  In Struts, you just send the action to a different METHOD in the
same CRUD class - if it needs something in the Valuestack it will get it  
otherwise it just proceed merrily along.


You can use EventLink instead of PageLink for this kind of scenario.


But due to apparent ambiguity of activate/passivate in Create/Edit,


What ambiguity?


I would be happy to be proved wrong - if there is a working app out there
which does all three Create/Update and QBE...


I usually have one page for creating and updating and another for searches.

--
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: Tapestry and inline Handlebars.js

2012-04-25 Thread trsvax
While I agree with you in spirit here my opinion.

Sending not well formed XML to any web client is a bad idea and if you do it
even by accident you are just asking for hours of grief. Using CDATA to work
around this when needed is a small price to pay. Being able to use existing
parsers is just icing on the cake.

As far as supporting this out of the box I'd say it does a pretty good job
there also. While I had to write a component it's only about 20 lines of
code, easily reusable and hardly a workaround. The success of a framework
should be judged on how easily is supports new features not by what's
supported in the core. 

So others may disagree but I'd say valid XML .tml files is a feature that I
would not be willing to give up and components were designed to solve
exactly the problem you are having and do it quite well.

BTW: thanks for posting this problem so I finally got around to solving
mine.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-and-inline-Handlebars-js-tp5660756p5664686.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: Pagelink above grid picks up context from last pagelink in grid

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

On Wed, 25 Apr 2012 08:47:37 -0300, trsvax  wrote:

I would say this is more of style preference than anything else. It can  
be made to work in many ways.


Agreed. :)

My personal style is to use the URL for state and not the session.  
Generally

I only use the session to store a non changing user object. If you start
there it dictates many of the decisions that follow. I believe this makes
the site more scalable, bookmarkable and reliable (testable).


Agreed. :)

As far as code reuse at first I had some of the same feelings.  
Create/Edit seem like the same and the only real difference is the  
onSuccess() method.


I don't think so. Just use Hibernate's Session.merge() or JPA's  
EntityManager.merge() methods and you have a method that handles both  
updates and inserts. ;)



However Tapestry/Hibernate/Beaneditform is so efficient at this task the
only code is in the onSuccess() method. In fact if you look at my example
the only code (1 line) that does anything is in the onSuccess() method of
the create page so trying to combine the two just makes for more code not
less.


I'm really not following you here. It contradicts what you just said above.

I've found if I follow this simple set of rules everything just fails  
into place.


Fails or falls? :P


1. Never use @Persist


There are some scenarios in which you'll need to use @Persist, but I agree  
that is something to be avoided when there's some other option.



2. Never use onActivate with a parameter


Why not? What about onActivate(EventContext context)? It's always invoked,  
no matter how many activation context values is passed, and you have  
TypeCoercer-backed coercions for free.



5. Never use inheritance for code reuse use Plastic or a service.


There are some scenarios in which using inheritance is a good idea, but I  
agree that is something to be avoided when there's some other option.



6. Always use BeanEditForm


I never use BeanEditForm, but I do use BeanEditor a lot. :)

--
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: Pagelink above grid picks up context from last pagelink in grid

2012-04-25 Thread Thiago H. de Paula Figueiredo
On Wed, 25 Apr 2012 06:10:47 -0300, Lance Java   
wrote:



Please stop saying that there is a bug in tapestry or that tapestry is
forcing bad design on you.

Thiago has pointed out that he often uses a single page for create and  
edit.


This grid issue seems to have nothing to do with that. Of course you  
need a

property to store the current row in a grid. That is the tapestry way.


And it seems that you're reusing the same field for the grid's current row  
*and* the object being edited or created. This is probably the cause of  
your problems. Have two separate fields, one for each scenario (listing or  
editing).


--
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: Recommended method to reference assets in .css file?

2012-04-25 Thread Cezary Biernacki
On Wed, Apr 25, 2012 at 1:09 AM, yazdog8  wrote:

> If you're using Less CSS (or maybe sass possibly), you can set some basic
> variables at the top of your file that can be used as a cache buster in
> your
> paths.
>
> http://lesscss.org/#-variables
>

And you can even directly integrate LessCSS with Tapestry using my
t5conduit library:
https://github.com/cezary-biernacki/t5conduit

Best regards,
Cezary


Re: Pagelink above grid picks up context from last pagelink in grid

2012-04-25 Thread Chris Mylonas

> and remember rules are made to be broken.

LOL

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



Re: Recommended method to reference assets in .css file?

2012-04-25 Thread trsvax
I put all that kind of css in my layout.tml file and I have an environmental
object that lets me add to that from pages/components. Usually there is not
a lot of it and it let's me easily move all the images to a CDN.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Recommended-method-to-reference-assets-in-css-file-tp5663514p5664625.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: Pagelink above grid picks up context from last pagelink in grid

2012-04-25 Thread trsvax
I would say this is more of style preference than anything else. It can be
made to work in many ways. 

My personal style is to use the URL for state and not the session. Generally
I only use the session to store a non changing user object. If you start
there it dictates many of the decisions that follow. I believe this makes
the site more scalable, bookmarkable and reliable (testable).

As far as code reuse at first I had some of the same feelings. Create/Edit
seem like the same and the only real difference is the onSuccess() method.
However Tapestry/Hibernate/Beaneditform is so efficient at this task the
only code is in the onSuccess() method. In fact if you look at my example
the only code (1 line) that does anything is in the onSuccess() method of
the create page so trying to combine the two just makes for more code not
less. I'm pretty amazed you can create/edit any object with a few lines of
declarations and 1 line of code.

As far as search pages go I always use @ActivationRequestParameter to get
the search criteria in the URL. If you want a QBE type function I'd build a
url and call the search page.

I'm sure others have their own styles. Mine is state goes in the URL and
Tapestry supports that workflow just about perfectly. I also prefer
declarations instead of code and again Tapestry delivers. 

I've found if I follow this simple set of rules everything just fails into
place.

1. Never use @Persist
2. Never use onActivate with a parameter
3. Use @PageActivationContext
4. Use @ActivationRequestParamter
5. Never use inheritance for code reuse use Plastic or a service.
6. Always use BeanEditForm

I'm not saying this is the only way but these rules keep me out of trouble
and remember rules are made to be broken.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Pagelink-above-grid-picks-up-context-from-last-pagelink-in-grid-tp5660049p5664614.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: Pagelink above grid picks up context from last pagelink in grid

2012-04-25 Thread Joakim Olsson
Just use another property than person in your page class for storing
the current value in the grid.

Regards,
Joakim


On Wed, Apr 25, 2012 at 10:54 AM, netdawg  wrote:
> I will try this to improve.  But the bad design, as you put it (and I agree),
> is required by the grid
> ...
>            include="code,name,organization,contact"
>          reorder="code,name,organization,contact">
> ...
>
> The row attribute complained that there is no person attribute of class
> Persons...hence the added person as property, which in turn leads to
> unintended consequences noted.
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Pagelink-above-grid-picks-up-context-from-last-pagelink-in-grid-tp5660049p5664249.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 failure: Status 500 for /mobile/browsegroups.loadingscreen: org.apache.tapestry5.runtime.ComponentEventException Communication with the server failed: org.apache.tapestry5.runtime.ComponentEv

2012-04-25 Thread derkoe

sommeralex wrote
> 
> Hello, 
> 
> I want to update my page after some seconds. In this time, the browser is
> trying to retrieve gelocation. The website works, always the first call to
> that sites ends with
> 
> Ajax failure: Status 500 for /mobile/browsegroups.loadingscreen:
> org.apache.tapestry5.runtime.ComponentEventException
> Communication with the server failed:
> org.apache.tapestry5.runtime.ComponentEventException
> 

Seems like you get an Exception in your event handler
onProgressiveDisplayFromLoadingScreen. I guess it's a NullPointerException
in (because groups might not be initialized yet):
  System.out.println("si; " + groups.size()); 

Can you post the stacktrace?


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Ajax-failure-Status-500-for-mobile-browsegroups-loadingscreen-org-apache-tapestry5-runtime-Componentn-tp5663902p5664472.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: Pagelink above grid picks up context from last pagelink in grid

2012-04-25 Thread Lance Java
Please stop saying that there is a bug in tapestry or that tapestry is
forcing bad design on you.

Thiago has pointed out that he often uses a single page for create and edit.

This grid issue seems to have nothing to do with that. Of course you need a
property to store the current row in a grid. That is the tapestry way.


Re: tynamo resteasy and JDO objects

2012-04-25 Thread Alejandro Scandroli
Hi Paulo

You weren't completely mistaken, you can use  @Xml* annotations to
influence the JSON output, but you need to use the jettison provider.
I overlooked this fact when I updated the documentation with the
switch from the jettison to the jackson provider.

Thanks for the heads up.
Alejandro.


On Tue, Apr 24, 2012 at 19:14, Paulo Andrade  wrote:
> Yes I was. Jackson has @Json* annotations for json output.
>
> On Apr 24, 2012, at 10:43 AM, Paulo Andrade wrote:
>
>> Am I mistaken to think that the @Xml* annotations would also influence the 
>> JSON output?
>

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



Re: Pagelink above grid picks up context from last pagelink in grid

2012-04-25 Thread netdawg
I will try this to improve.  But the bad design, as you put it (and I agree),
is required by the grid 
...
 
...

The row attribute complained that there is no person attribute of class
Persons...hence the added person as property, which in turn leads to
unintended consequences noted.   

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Pagelink-above-grid-picks-up-context-from-last-pagelink-in-grid-tp5660049p5664249.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: Pagelink above grid picks up context from last pagelink in grid

2012-04-25 Thread Lance Java
> @Persist(PersistenceConstants.FLASH) makes nullifies Person in Persons
page (listing page), thereby breaking it...

This sounds like bad design if your ListPersons page is referencing an
object persisted by your EditPerson page. It sounds like the flash
persistance should instead be on your ListPersons page and that your
EditPerson page should initialize and return an instance of ListPersons
(instead of returning ListPersons.class). Something like this:

public class ListPersons {
   @Property
   @Persist(PersistenceConstants.FLASH)
   private Person lastEditedPerson;

   @Property
   private List persons;

   public void init(Person lastEditedPerson) {
  this.lastEditedPerson = lastEditedPerson;
   }
   ...
}


public class EditPerson {
   @Property
   private Person person;

   @InjectPage
   private ListPersons listPersons;

   private Long personId;

   @Inject
   private Session session;

   public void onActivate(EventContext context) {
  if (context.getCount() > 0) {
 personId = context.get(Long.class, 0);
  }
   }

   void setupRender() throws Exception {
  if (personId != null) {
 person = session.get(Person.class, personId);
  } else {
 person = new Person();
  }
   }

   @CommitAfter
   Object onSuccess() {
  session.saveOrUpdate(person);
  listPersons.init(person);
  return listPersons;
   }

   public void onPassivate() {
  if (person.getId() != null) {
 return person.getId();
  }
   }
}


Re: AssetsModule.ResourceMinimizer Exception yui compressor

2012-04-25 Thread netdawg
Best I can tell, this issue melted away after I fixed my jQuery dependent
scripts.  Specifically to replace $ with jQuery as advised below: 

http://docs.jquery.com/Using_jQuery_with_Other_Libraries

My application is no longer dependent on yuicompressor-rhino-bugfix.  I also
whacked the yuicompressor dependency from my pom, without suffering the
index out of bounds problem.  Now, I just use yui to compress my script by
command line (instead of pom).  That works fine whether I do it or not.  

Not sure if this will help anyone...but just a possibility...since yui seems
to creating quite a bit of mischief. 


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/AssetsModule-ResourceMinimizer-Exception-yui-compressor-tp5658826p5664180.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