You cannot use approach #2. Two separate web apps cannot call each other
directly.
This is like having two processes on separate machines in separate JVMs.
This is not entirely true. As Josh said there is a classloader which is
common to all webapps running in a container. Take a look at the
Firstly, I would urge you not to use ant. It's easy to end up with spaghetti
code that does not conform to any standard. Even though I hate maven, it's
1000 times better than ant. I suggest you build with gradle.
If you *must* use ant. Then I suggest that you at least conform to the maven
You could extract your shared services into a separate war and expose them as
web-services.
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Sharing-the-Registry-instance-between-web-applications-deployed-in-the-same-container-tp5718686p5718721.html
Sent from the Tapestry
JDBC supports paging which is is available in both hibernate and JPA.
Tapestry provides GridDataSource implementations for both Hibernate and JPA
that support paging.
http://tapestry.apache.org/tapestry5/apidocs/src-html/org/apache/tapestry5/hibernate/HibernateGridDataSource.html
Basically, the prepare() method is used to fetch the rows between startIndex
and endIndex in a single batch and cache them. This cache might be a list
with indexes ranging from 0 to (endIndex - startIndex)
getRowValue(int index) is then used to retrieve a single entry from the
batch. This might
In maven, the nearest definition wins.
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
So if you declare a version in your pom.xml, it will override the version
declared in any of your dependencies (ie tapestry).
--
View this message in context:
I've written a simple gallery component which displays a list of items in a
grid with prev and next links to go through pages. You pass it a block
to display each item.
Code:
https://github.com/uklance/tapestry-stitch/blob/master/src/main/java/org/lazan/t5/stitch/components/Gallery.java
As Thiago has said, the Grid component actually accepts a parameter of type
GridDataSource so does not require the entire list in memory at once.
Tapestry provides a coercion from List to GridDataSource so you can also
pass a List to the Grid.
I think the most elegant way of handling this would be to handle a new
component event result type called ExternalPost. Then you could return an
ExternalPost instance from your onActivate() method.
public class ExternalPost {
private URL url;
private String contentType;
private
Do you want to do the POST from the client's browser or from the server? I
think you want to do it from the client's browser.
The server can only send a redirect to the client. A redirect causes a GET
on the client. Another option is to send some javascript to the client so
that it does a POST.
A simple (but slightly hacky) solution is to add a convenience getter to
Employee
public class Employee {
private int id;
private String employeeName;
private Department department;
public String getDepartmentName() {
return department == null ? null :
The tapestry-hibernate module provides ValueEncoders for all hibernate
entities. If you want to override the ValueEncoders provided by
tapestry-hibernate, you should use override() instead of add().
eg:
configuration.override(Librarian.class, librarianFactory);
Hmm... looks like a bug. PlasticClassImpl uses this.fields in
getUnclaimedFields() but never adds to this.fields in introduceField().
public PlasticField introduceField(String className, String
suggestedName)
{
check();
assert PlasticInternalUtils.isNonBlank(className);
This is expected behavior. MarkupWriter.getElement() returns the current XML
element on the stack that has not been closed (ie markupWriter.end() has not
been called for the element). Since all TML templates are well formed XML
and hence end() every element thus popping it off of the stack.
What
You could put all your pages under the shop package and tapestry will do
what you want out of the box.
eg
com.mypackage.pages.shop.Page1
com.mypackage.pages.shop.Page2
If you want more control, you can decorate the ComponentEventLinkEncoder to
do whatever you want.
Note that itext is only free for open source
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Images-from-DB-to-PDF-File-tp5718438p5718446.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
In order to use optimistic locking, hibernate recommends that you use an
integer version annotated with @Version on your entity.
@Entity
public class Person implements Serializable {
@Column
private String name;
@Version
@Column
private Integer version;
// getters and
Should have been t:hidden t:value=person.version /
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Tapestry-Hibernate-optimistic-locking-tp5718413p5718416.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
I've written a component which allows the power of tapestry components to
extend to PDFs by integrating with apache FOP.
Apache FOP:
http://xmlgraphics.apache.org/fop/
PDF Demo:
Another option is environmentals
http://tapestry.apache.org/environmental-services.html
Typically, a parent component will push() and environmental onto the (thread
local) stack and a child component will peek() for the environmental and
update it in some way.
--
View this message in context:
I've used this jquery UI plugin http://fgelinas.com/code/timepicker in a
non-tapestry project and my users love it.
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/date-and-time-picker-tp5718388p5718392.html
Sent from the Tapestry - User mailing list archive at
You will either decorate or override the MessagesSource service. Take a look
at the MessagesSourceImpl source code for inspiration.
http://tapestry.apache.org/ioc-cookbook-overriding-ioc-services.html
http://tapestry.apache.org/tapestry-ioc-decorators.html
If you provide a small snippet of code that's failing and an exception stack
trace you are more likely to get help with this.
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Error-references-component-id-ABC-which-does-not-exist-tp5718353p5718354.html
Sent from the
Images, css and js etc are known in tapestry as assets. You can reference
assets by classpath: or context:.
http://tapestry.apache.org/assets.html
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Referencing-files-from-a-jar-tp5718355p5718357.html
Sent from the Tapestry
Declare your shared content in a t:block id=foo.../t:block
Then use t:delegate to=foo / when you want to include the foo block in
your logic.
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/tml-if-statements-unique-id-components-tp5718312p5718314.html
Sent from the
You can also avoid the if component all together using this pattern:
http://tapestry.apache.org/switching-cases.html
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/tml-if-statements-unique-id-components-tp5718312p5718315.html
Sent from the Tapestry - User mailing list
Since the UnclaimedFieldWorker is configured after:* it will be applied
after all other ComponentClassTransformWorker2's. This means that your new
field will be ThreadLocalized and won't be a singleton.
--
View this message in context:
Use declare a field in your mixin with the @BindParameter annotation and
tapestry will mirror the parameter from the component to your mixin. Any
updates you make to the field will update the underlying field.
Note that updates to @BindParameter fields will only work for prop:
bindings.
You will either decorate or override ComponentMessagesSource
http://tapestry.apache.org/tapestry-ioc-decorators.html
http://tapestry.apache.org/ioc-cookbook-overriding-ioc-services.html
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/messages/ComponentMessagesSource.html
Using tags in your templates is a hack. Use JavaScriptSupport in a page
request or AjaxResponseRenderer in an ajax request for that.
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/ajax/AjaxResponseRenderer.html
I'm taking an educated guess here and guessing that you're trying to
implement your file upload progress bar mentioned here
http://tapestry.1045711.n5.nabble.com/Adding-a-progress-listener-to-UploadedFile-td5718197.html
To implement this you will do two things:
1. Upload a file
2. Send regular
Tynamo has a resteasy module, I've never used it myself but it looks
promising
http://tynamo.org/tapestry-resteasy%20guide
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/SinglePage-app-design-thoughts-tp5718264p5718274.html
Sent from the Tapestry - User mailing list
Can you clear your browsers cache and try again?
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Jquery-Tooltip-on-production-mode-tp5718174p5718223.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
Hi Tapestry Users,
I've just written a component that integrates the power of tapestry
component templates with apache FOP to generate PDFs. This opens up the
possibilities of creating reusable PDF component libraries such as a PDFGrid
etc.
Usage:
I'm looking for a home for this component so
Can you send another screenshot now that YUI is not compressing the
javascript?
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Jquery-Tooltip-on-production-mode-tp5718174p5718200.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
I haven't used the gmap in tapestry-jquery but I have used the gmap component
from exanpe without any trouble at all.
Demo:
http://exanpe-t5-lib.appspot.com/components/googlemap/example2
Source:
https://github.com/exanpe/exanpe-t5-lib
Demo Source:
https://github.com/exanpe/exanpe-t5-demo
--
You will need to override (or perhaps decorate) the MultipartDecoder. Most
likely, you will extend MultipartDecoderImpl and extend the following method
to add your progress listener:
Note that the MultipartDecoder has per-thread scope
http://tapestry.apache.org/ioc-cookbook-overriding-ioc-services.html
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Adding-a-progress-listener-to-UploadedFile-tp5718197p5718205.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
Type mvn dependency:tree at the command line to show your dependency
hierarchy
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Jquery-Tooltip-on-production-mode-tp5718174p5718210.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
Yui isn't on your build path
Have you done a clean deploy or a dirty deploy?
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Jquery-Tooltip-on-production-mode-tp5718174p5718216.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
In tapestry 5.2+ you have the option of annotations or naming conventions.
Prior to 5.2 you can only use naming conventions.
See methods starting with contribute here
http://tapestry.apache.org/tapestry-ioc-configuration.html
--
View this message in context:
Looks very similar to this:
http://tapestry.1045711.n5.nabble.com/Problem-in-Production-mode-td5718120.html
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Jquery-Tooltip-on-production-mode-tp5718174p5718183.html
Sent from the Tapestry - User mailing list archive at
I seem to be explaining this concept a bit lately... perhaps the tapestry
docs need to include an explanation.
Tapestry pages are singletons. Tapestry does a bit of byte code magic on
your pages and components to transform them so that any request specific
state is stored in a thread local map.
In addition to Thiago's suggestion, I often set a default for the block:
@Parameter(value=block:defaultAdditionalStuff, defaultPrefix =
BindingConstants.LITERAL)
@Property
private Block additionalStuff;
t:form
...
t:delegate to=additionalStuff/
...
/t:form
t:block
@PageAttached and @PageDetached are deprecated and are leftovers from page
pooling. The page pool has been disabled by default since version 5.2 in
favour of page singletons which maintain mutable state in thread local maps.
--
View this message in context:
This page says the page pool is disabled as of tapestry 5.2
http://tapestry.apache.org/page-life-cycle.html
Two of the links you provided have a deprecated warning:
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/PageAttached.html
How can I add new properties
This question is pretty vague, most likely you will use a
MappedConfigurationK,V which allows you to contribute to a service which
takes a MapK,V in it's constructor.
Should I simply use System.setProperties
Most likely not
Also one other question what is the
What version of tapestry are you using?
My guess is that it's either the GZIP filter or YUI compressor that are
causing this problem. I'd start by turning them off one at a time to find
the culprit.
Disable YUI compressor in pom.xml
Disable GZIP here:
Will try that again (nabble ate my XML)
What version of tapestry are you using?
My guess is that it's either the GZIP filter or YUI compressor that are
causing this problem. I'd start by turning them off one at a time to find
the culprit.
Disable YUI compressor in pom.xml
Disable GZIP here:
I know the tapestry team have been having troubles with yuicompressor, I'm
just not familiar to them myself. Please chime in anyone who knows more
about this.
Are you saying that rhino was already on your classpath? Is it a dependency
in your project or is it part of jetty? Run mvn
Actually, it's even easier... you don't need to worry about the
environmental.
1. Extend ValidationTrackerImpl and override the recordError() methods to
save the error fields
2. Pass your tracker to the form
t:form tracker=myTracker ...
3. Profit
--
View this message in context:
ValidationTrackerImpl is final, so I cannot extend this class. But I found
ValidationTrackerWrapper class, maybe I should extend this?
Sounds good to me
Do I set it as a persisted property?
It depends on which tapestry version you are using. Later versions of
tapestry will NOT need flash
Ok, so the problem is that you want to generate an eventlink that passes two
parameters. One parameter (context) is known when you call
componentResources.createEventLink(), the other is a clientside value (the
value of the checkbox).
Option 1:
Generate an event URL via
Thanks for the update... My approach will be to explicitly load jQuery myself
in noConflict() mode which I can then remove once tapestry includes jQuery
itself.
Cheers,
Lance.
--
View this message in context:
t:datefield icon=path/to/myicon.gif ... /
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/DateField-Customization-tp5718034p5718042.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
Note, if you'd like to override the default date editor in the BeanEditForm
you will need to contribute an EditBlockContribution to the
BeanBlockOverrideSource service. This will require you to create a private
page with a block containing a DateField. The page can be made private by
annotating it
Hi all,
I'm keen to give the js-rewrite branch [1] a whirl and enjoy the
twitter-bootstrap and jquery goodness without the need for 3rd party
component libraries. I'll only be using it for a toy project but was wanting
to get a feel for the current state of the branch.
A simple answer such as:
Although I'm sure it can be done... it sounds like a lot of effort for not
much gain. Why don't you want update the full zone?
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Form-server-side-validation-in-zone-tp5718026p5718027.html
Sent from the Tapestry - User mailing
This could be done with a mixin to the checkbox which fires an event passing
the boolean value of the checkbox and some context identifying the row.
Something like this:
t:grid source=items row=item
p:checkBoxCell
t:checkbox value=item.flag t:mixins=checkboxZoneUpdater
ValidationTracker is an environmental so you could wrap the existing
ValidationTracker and push() the wrapper onto the environment and keep track
of the fields this way.
I wonder if you could have a hidden zone in the UI which gets updated when
the form is submitted. You then run some javascript
IMG.t-calendar-trigger {
position: relative;
left: -25px;
top: 2px;
}
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/DateField-Customization-tp5718034p5718035.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
Live class and template reloading will only work in development mode. Are you
running in production mode?
http://tapestry.apache.org/configuration.html#Configuration-tapestry.productionmode
If running in development mode, tapestry will tell you in the logs on
startup.
--
View this message in
I'm guessing that you render the recalculate zone by submitting another
form... correct?
If so, you could include the values from the first calculate as input
type=hidden / in the second form.
--
View this message in context:
In JSTL, there is a choose tag [1] which I think is a more elegant way of
handling the else condition. Perhaps tapestry could benefit from a similar
component?
t:choose
t:when test=fooFoo/t:when
t:when test=barBar/t:when
t:elseBaz/t:else
/t:choose
[1]
Tapestry considers prop: bindings to a method invocation as read-only. Can
you give an example of your data? The easiest solution is to wrap your maps
in a model with getters and setters? If you can't do that, you might want to
consider a custom binding or decorating / overriding the
Chenillekit provides an ognl: binding, I'm not sure but this might support
setters on Maps?
http://chenillekit.codehaus.org/chenillekit-tapestry/ognlbinding.html
Here are some example custom bindings prefixes:
http://wiki.apache.org/tapestry/Tapestry5HowTos#Binding_Prefixes
--
View this
I meant a prop binding to a custom method invocation (ie not a getter)
eg:
prop:foo will have a read and write binding
prop:someMethod('foo') will have a read-only binding
--
View this message in context:
I always avoid @Persist as it makes your webapp far more scalable. In this
example, you can pass policyId as an event context to all of the ajax events
on your page.
eg:
t:eventlink event=myEvent context=policyId zone=myZone
void onMyEvent(int policyId) {
policy =
Chris is right, if you include an onPassivate() with your policy/policyId
there is no need to pass it in the ajax event as it tapestry will implicitly
populate the value for you.
You might also want to consider the @PageActivationContext annotation which
takes care of onActivate() and
If the documentation [1] is complete then tapestry does not include coercers
for java.uttil.Date by default. You might need to coerce to long instead.
[1] http://tapestry.apache.org/typecoercer-service.html
--
View this message in context:
I'm not trying to steal your thunder. My design/CSS skills are pretty rubbish
so chances are it won't look pretty. There have been a few questions on this
list lately regarding a gallery component and I wanted to provide a sample
showing that it was possible to do it without the need for @Persist.
Well, I'm sure you're a smart guy and can figure out how to get the tbody.
The mixin will fire after the grid component has rendered. The grid renders
a table inside a div so you will need to do something like:
ListNode topChildren = writer.getElement().getChildren();
Element div = (Element)
I've just written a GridDecorator mixin that allows you to decorate rows or
cells in a grid. The code can be found here:
https://github.com/uklance/tapestry-stitch/blob/master/src/main/java/org/lazan/t5/stitch/mixins/GridDecorator.java
A demo can be found here with examples for RowDecorator and
I was able to solve my problem by developing a GridDecorator mixin which
applies RowDecorators and CellDecorators.
Code Here:
https://github.com/uklance/tapestry-stitch/blob/master/src/main/java/org/lazan/t5/stitch/mixins/GridDecorator.java
I notice that you are attempting to pass itemsPerPage, tableColumns and
cursor as component parameters but your are not marking them with the
@Parameter annotation.
I think you want to define them as:
@Parameter(literal:25)
private int itemsPerPage;
@Property(literal:4)
private
As for your problem with debugging. Tapestry transforms your component
classes such that they no longer read/write to member variables in your
class. Instead, getters and setters are generated that are backed by a
thread local.
When running in development mode, tapestry helps out the developer by
I've been working on a demo gallery component. The gallery uses a table to
display a grid of items with links for next and prev. The GalleryDataSource
ensures that only a page of data is loaded into memory at a time. The
gallery accepts a block parameter to display each item. I've included a demo
Tapestry does NOT accept JSONObject as a return value from a component event.
If you want to make a JSONObject available in your javascript, you should
use AjaxResponseRenderer.
http://tawus.wordpress.com/2011/10/01/tapestry-5-3-new-features-part-2/
--
View this message in context:
it seems easier to install both mixins with a component transformer and
then just have a parameter on the grid control the row
I disagree, mixins are a well understood concept. Asking a user of my
library to add a mixin to a grid and then pass parameters to that mixin is
well documented. Using
The grid component contains a nested rows component of type GridRows. Is
there a way that I can attach a mixin to the nested GridRows instance? I
realise that this can be done globally via a ComponentTransformWorker2 but
I'd like to apply an instance mixin.
FYI, here's the code that initialises
Ok, so rolling with your suggestion...
Let's assume that I use a CTW2 to attach a GridRowsMixin to every GridRows
component. And now, I attach a GridMixin to the Grid. Is there any way that
the GridRowsMixin can lookup the GridMixin? To rephrase my question, can a
mixin on a child component
I think I've got a solution:
1. GridMixin calls ComponentResources.storeRenderVariable(name, value) to
make config available to GridRowsMixin
2. GridRowsMixin calls
ComponentResources.getContainerResources().getRenderVariable(name)
3. ComponentResources.getComponentModel().getMixinClassNames() is
So, create an IOC service:
public interface Job implements Runnable {
// implementors of this must be careful with synchronization
public void updateJobConfig(JobConfig config);
}
public class JobServiceImpl implements JobService {
@Inject
private PeriodicExecutor executor;
Why not the Environment for passing parameters?
Since all nested components will be able to see the environmental, you might
get unexpected behavior for a grid inside a grid.
--
View this message in context:
I've overwritten both the Grid class and the GridRows class to make it
happen
Sounds like this might be a problem that needs addressing then... perhaps
there should be a mechanism in tapestry to add mixins to subcomponents?
eg:
t:grid source=... mixins=gridMixin submixins=prop:subMixins .../
Lance, you might be interested in
https://issues.apache.org/jira/browse/TAP5-1606.
Interesting, I think the @EmbeddedMixin functionality is cleaner than what I
suggested. I do agree with HLS' comment on the issue that it breaks the
black box philosophy of components. But given the alternatives,
A stack works fine when every grid is guaranteed to put a value on the stack.
Since the mixin is optional, the environmental is also optional. So a nested
Grid might see an environmental from a parent Grid when the value should
have been null.
--
View this message in context:
t:grid source=... t:include=prop:myIncludes t:exclude=prop:myExcludes
/
public String getMyIncludes() {
// return a comma separated string or null
}
public String getMyExcludes() {
// return a comma separated string or null
}
--
View this message in context:
To me, it sounds like you can achieve most of this with javascript. Attach a
listener to the change event on the checkbox which toggles the visibility
of the field. On the serverside, you will check he value of the boolean flag
to determine if the field is initially hidden or visible.
In jquery,
http://tapestry.apache.org/component-parameters.html
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Tapestry-t-include-grid-column-at-runtime-tp5717685p5717694.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
Take a look at the diagram at the bottom of this page:
http://tapestry.apache.org/request-processing.html
You can contribute a PageRenderRequestFilter to the PageRenderRequestHandler
in your AppModule.
--
View this message in context:
You could also use a ComponentClassTransformWorker2 to attach a custom mixin
to every Page class.
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/transform/ComponentClassTransformWorker2.html
--
View this message in context:
Have you considered an environmental?
http://tapestry.apache.org/environmental-services.html
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Elegant-Handling-of-Multiple-Zones-in-Deep-Hierarchies-of-Components-tp5717698p5717700.html
Sent from the Tapestry - User mailing
You can attach a mixin to any component and hook onto the component's render
phases. By default, the mixin lifecycle phases will fire before it's
containing component which can be switched by adding the @MixinAfter
annotation.
http://tapestry.apache.org/component-rendering.html
You are using $.get() to get an eventlink URL and you are doing nothing with
the response. The default tapestry implementation (prototype) has a
ZoneManager.processReply() which is used to process an event response.
It looks like you are using tapestry-jquery so you will need to find the
This is not really a tapestry question.
Here's the standard maven project layout
http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
Any files under src/main/resources will be available on the classpath (eg
Classloader.getResrouceAsStream(...))
Any
I think Lance was onto the best ideas. The easiest would be to create a
Tapestry service for creating your Cayenne objects
That's not what I said, infact I said that a factory was a bad since there
are multiple sources for these objects.
I was suggesting a service:
public class FooServiceImpl
where do I have to place the mixin? I placed it into /components.
Mixins must live in basepackage.mixins
(http://tapestry.apache.org/component-mixins.html)
RowType is the object that is displayed in the grid? Eg
onRowClick(UserProfile user)?
Correct, it is the collection type backing the grid
When tapestry starts, it lists the registered components and mixins... Is the
mixin listed in the logs?
Do you have other custom components that are working?
Does the mixin code live inside the webapp?
Or is the mixin part of a component library?
Tapestry is interpreting the event as a property on your page. Change the
default binding prefix for the property to LITERAL:
@Parameter(required=true, defaultPrefix=BindingConstants.LITERAL)
private String event;
--
View this message in context:
901 - 1000 of 1574 matches
Mail list logo