I think the preferred way is to @Inject the Request (or HTTPServletRequest
in rare cases)
Have you added jp to the list of supported locales?
http://tapestry.apache.org/configuration.html#Configuration-tapestry.supportedlocales
Locale.JAPANESE = "ja"
You will need to supply an app_ja.properties.
This will also work for Local.JAPAN (ja_JP)
Cheers,
Lance.
On Wednesday, 11 April 2012, angelochen wrote:
> i did:
>
> configuration.add("tapestry.supported-locales", "en,zh,ru,jp");
>
> a little confusion is, the doc says 'ja
You will need to set the "encoder" attribute on your so that
tapestry can serialize / deserialize the values used to poplulate the form.
http://tapestry.apache.org/5.3.1/apidocs/org/apache/tapestry5/corelib/components/Loop.html
I'd also try to get rid of your mutable static data (Session) in fav
It wouldn't be too hard to write a mixin which looks for the annotation and
adds to the underlying model.
Saying that your locale is "jp" is not really valid, you either specify
your language OR you specify your language/country (eg either "ja" or
"ja_JP) but never just the country as some countries speak multiple
languages.
en_GB and en_US will both default to "en" if a more specific message bundle
c
I always keep a copy of the tapestry source code handy. If I search
"*Module.java" for AssetFactory I find out how tapestry adds a
ContextAssetFactory and a ClasspathAssetFactory.
@Marker(ContextProvider.class)
public AssetFactory buildContextAssetFactory(ApplicationGlobals
globals, AssetP
I know it's not ideal but you could deploy an exploded war.
So, I think that eliminates the problem that howard was mentioning on his
blog.
Can you paste the page / component that is trying to run? I'm trying to
think of where a "jsp" component would be references inside the tapestry
archetype.
I wonder if this has something to do with how tomcat 7 is trying to serve
the root.
Are you able to hit
http://localhost:8080/newapp/about
The tapestry source code does not have a single reference to "jsp". I think
that tomcat might be trying to "help" somehow.
I think you've now hit this https://issues.apache.org/jira/browse/TAP5-1729
Try commenting out the following in your pom.xml
org.apache.tapestry
tapestry-yuicompressor
${tapestry-release-version}
Inspect the HTTP logs, is Tomcat trying to redirect from root to some other
page (index.jsp or something)?
There might be some config in tomcat that you can tweak / remove.
Your ajax event handler method will need to initialize any properties that
are required in the rendering block
Draggables can have a "draggablecontext" attribute. Although I've not used
it I'm sure that you could pass the context required to initialize your
property.
It looks like you will need to remove all entries from the
in $TOMCAT_HOME/conf/web.xml
See "How do I override the default home page loaded by Tomcat?" here
http://wiki.apache.org/tomcat/HowTo
Another option might be to tell tapestry to ignore the welcome file list
public static void contributeIgnoredPathsFilter(Configuration
configuration) {
configuration.add("(index\\.html)|(index\\.htm)|(index\\.jsp)");
}
http://tapestry.apache.org/configuration.html#Configuration-ConfiguringIgno
Please try the following:
public static void contributeIgnoredPathsFilter(Configuration
configuration) {
configuration.add("/index\\.(?:html|htm|jsp)");
}
If it works, we'll close the JIRA and put some tomcat specific
documentation somewhere
Perhaps you can override the tomcat defaults by adding an empty
to your web.xml
Then no tapestry config required?
Redirect will cause an extra request and will change the URL in the
browser. Try forward instead
How about getting rid of index.jsp and adding "index" to your web.xml in
the welcome file list. I'm assuming tomcat will try your config before the
default
Have you tried:
Or with jstl
Create a ValueEncoder for your currentExtension Object
Then use ValueEncoder.toClient(V value) to create a string which will be
used in your draggablecontext.
Then, in your drop event, use ValueEncoder.toValue(String value) on the
context value to deserialise the Object.
Something like this:
${extension.name}
${extension.number}
${droppedExtension.name}
${droppedExtension.number}
Page.java
-
@InjectComponent
private Zone extensionZone;
@Property
private Item extension;
@Property
pri
If you want to know which dropzone received the dragabble, just pass the
zone id in the context along with the extension id.
I can't remember exatly how but I'm sure you can lookup zones by id by
@Inject'ing the ComponentResources
Ignore my prev post about adding the drop zone to the context as this is
not associated with the draggable when the page is drawn.
I think that you need a handle on the ComponentEventRequestParameters so
that you can call getNestedComponentId() which will have the id of the zone
which fired the ev
Well... to say it's not possible is wrong. To say it's hacky is correct ;)
He's using a library which doesn't pass the information and might not want
to wait for a new release of the library
The information is there... Worst case scenario you could @Inject the
request and parse the component id f
If the URL is the same then the zone id is the same. Im guessing that your
droppables are defined in a loop too? (I'm talking t:id not client id)
I think that the droppable mixin needs to accept a droppablecontext in a
similar way to draggablecontext and the serverside event should have both
conte
The J2EE specification states that you should never read or write to the
local file system. Using the local file system raises many issues including
security, portability, transactions, clustering and thread safety. I don't
really agree with including a FileAssetFactory in the Tapestry source as
th
I think that SeleniumTestCase should inject a Session implementation that
fails when setAttribute() is called with a non-Serializable object so that
we can catch this in the future
Hi Chris, the ZoneDroppable mixin is only a few lines of code
https://github.com/got5/tapestry5-jquery/blob/master/src/main/java/org/got5/tapestry5/jquery/mixins/ZoneDroppable.java
You could quite easily create another mixin by copying/tweaking the code or
better yet, clone the repository and send
Now I'm starting to doubt myself, I'm starting to think that the @Parameter
will be null when the ajax method is invoked.
You will need to pass the droppablecontext in the AJAX event URL in a
similar way to how the draggablecontext is passed.
https://github.com/got5/tapestry5-jquery/blob/master/s
A simpler option could be to serialize the data to a temp OutputStream
instead of checking instanceof Serializable.
> So what would you choice be? I know that no database manifacture actually
recommend to store the files into DB. Say that you have huge files, or a
lot of them and your db is on another server, it is a lot of mess.
Caveat: I must admit that i've never needed to deal with large blobs (eg
video) be
That just flags that you don't have enough test coverage then ;)
Running through the object reflectively won't work. In the case of
List the generic type is lost at runtime through type erasure.
Instead of initializing your @EagerLoad service in it's constructor, you
could add an init() method to the service.
Then you call init() inside a @Startup method after you have initialized
any dependencies.
http://tapestry.apache.org/registry-startup.html
Lance.
Hi Geoff, from what I've seen, the tree nodes don't do anything when
selected.
You can set the "label" parameter if you'd like to do something special.
${myTree.node.label}
Mutable static data is the root of all evil ;)
Statics are (almost) impossible to mock and make testing and clustering
very difficult. Is there any way you could refactor your code to use a
singleton service instead of the static?
You could then @EagerLoad the singleton service or initialize it i
Are you sure that you are returning consistent values for hasChildren() and
getChildren(). It sounds like you might be returning true for hasChildren()
but getChildren() is returning an empty list.
Funny you should mention this, I actually had a quick try at doing this
myself but I got a bit stuck... here's what I learned.
1. I was trying to use this technique
http://wiki.apache.org/tapestry/Tapestry5HowToGetAnHTMLStringFromARenderCommandParameterto
specify a FOP parameter to a Page (or Comp
I have thought of a way of doing this which only involves a couple of
internal classes.
1. Create a new event response type (lets call is FopPdf)
public class FopPdf {
private RenderCommand fopRenderCommand;
private String fileName;
}
2. Create a FopPdfComponentEventResultProces
Try clearing your browser's cache
See the jira for TAP5-1777
See the last comment on the issue
Since this is fixed by clearing the browser cache, I'm marking this as
resolved. If anyone feels strongly that Tapestry should have a better
mechanism for preventing old JavaScript from hanging around after an app is
upgraded to a newer Tapestry version (such as h
Can I see the serverside code for your edit page?
I get the feeling that onPassivate() is being called on the edit page and
returning an id persisted in the session.
I think you want flash persistence rather than the longer lived default
session persistence
@Persist(PersistanceConstants.FLASH)
I have not used @PageActivationContext but the javadoc states that it
performs onPassivate() automatically
I think you might be having a name clash with a page name and a CSS file
name in the same folder and tapestry is thinking it's an event URL to the
page instead of a CSS path.
Solution: name the CSS file differently or move it to a different folder
Tapestry has already passed an instance of MessageFormatter to you in the
Validate method.
Use this instead of the Messages directly as the actual message key is
dependent on the field being validated.
Download the tapestry source and take a look at an existing Validator (eg
Required)
There is no silver bullet solution for this and it's a matter of taste.
Tapestry has a number of built in SymbolProviders. You can specify a
combination of system properties, init-params to the tapestry filter,
factory defaults and application defaults
http://tapestry.apache.org/symbols.html
If
Did you try flash persistence as I suggested earlier?
Flash persistence only stores in the session momentarily so that state can
be maintained through a "redirect after post".
> @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 ListP
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. T
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
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 h
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:
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
I'm happy to call a bug a bug but I shall valiantly defend my baby
(tapestry) from FUD
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"
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
I still get the feeling that you are using a single Person property instead
of two. You MUST have two properties of type Person
One will be used by your grid to store each row as it the grid iterates
through. This MUST NOT be tied to onActivate() / onPassivate().
The other will store the Person c
Seems like it should work to me. Try viewing the HTML source for both and
compare the diffs
If I understand correctly, you read your data into multiple lists. To read
a single record, you use the same index in each list... Correct?
This sort of model often leads to a maintenance nightmare.
Create a bean which represents a single row in the grid and read your data
into a single list. Yo
Great work Geoff!! Thanks for all your hard work.
A couple of q's
1. Is it necessary to update the "treeZone" in onLeafSelected()?
2. Both BigInteger and Integer extend Number so you could avoid the HSQLDB
case by casting to Number.
Cheers,
Lance
The current tree implementation requires the session to store the
TreeExpansionModel. As with most of you, I like to avoid using the session
wherever possible to improve scalability and to avoid issues when a user
opens multiple browser windows for the same page. In my mind, the
TreeExpansionModel
Client persistence wont get rid of the multiple window error. It will also
introduce the possibility that the client has cookies disabled so nothing
will work.
I take that back... I always assumed client persistence was based on
cookies. It seems it uses a request parameter... That could work but has
max URL length restrictions
> I thought client persist was via the url not cookies, but as I said I
never really used it
See my previous post, I was wrong
> The issue is the URL gets too long
Agreed, perhaps gzip compression can help there
> and bookmarking is iffy since the id can change.
Hopefully the URL won't be bookmar
I'm not sure how I'd manage it either.
1. It would be nice if you could pass a "persistenceType" parameter of
"session" or "client". Is that possible?
2. Is there a "hook" where you can specify how to serialize / deserialize
an object to the client persistence?
3. Tree accepts an "expansionModel
Let me rephrase your question:
"I have given you absolutely no information, can you please design my
website for me?"
I'm not sure you will get much help that way ;)
The grid is decoupled from hibernate, your implementation of "source" is
tied to hibernate.
tapestry-hibernate provides a service of type org.hibernate.Session and you
have declared an instance of org.hibernate.classic.Session in your page.
1. Validators are designed to cause a single failure each. If you want to
validate multiple things, add multiple validators to a field.
http://tapestry.apache.org/forms-and-validation.html
2. Validators must throw a ValidationException in order to fail, the issue
you are responding to is discussi
You could add this to your app module:
private static class LazyFullTextSession {
private HibernateSessionManager sessionManager;
public LazyFullTextSession(HibernateSessionManager sessionManager)
{
this.sessionManager = sessionManager;
}
publi
I don't think this would work, for instance the grid component persists
String, Integer and Boolean. Also, if there were 2 trees in the app, they
would both need the same persistence
I'd prefer a component parameter. I was assuming this would require
invoking tapestry's underlying persistence API'
Geoff describes it here
http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/onactivateandonpassivate/3
Basically you shouldn't do db lookups in onActivate() and should use
onPrepare() instead.
For this same reason, I think it's a bad idea to use @PageActivationContext
with a hibern
All fields in tapestry have a FieldValidator property
@Parameter(defaultPrefix = BindingConstants.VALIDATE)
private FieldValidator validate;
This will either be an instance of FieldValidatorImpl for a single
validator or CompositeFieldValidator if there is more than one validator on
a fie
I'm a bit of a maven purist and I think that src/main/java is for java
files only and any resource files should go in src/main/resources
If you still want to do this, instead of whitelisting property files, you
should blacklist *.java instead.
Also, you don't need to include **/* in your second
+1
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/How-do-you-feel-about-requiring-JRE-1-6-for-Tapestry-5-4-tp5679713p5679911.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
-
To uns
The example here http://wiki.apache.org/tapestry/Tapestry5Layoutcomponent
http://wiki.apache.org/tapestry/Tapestry5Layoutcomponent shows how to use
the delegate component to have a default "left" block which can be
overridden.
--
View this message in context:
http://tapestry.1045711.n5.nabble.c
I'm not 100% exactly what you're trying to do but it sounds like you should
make components for the bits you want to re-use and then pass a block
parameter to the layout.
Take a look at the RenderCommand class too. This is a way of providing
markup programatically and it may make sense for you to
Given your example... The Simulation and Dashboard pages could implement
PolicyProvider
Then, in your Layout
public class Layout {
@InjectPage
private Page page;
public Policy getPolicy() {
if (page instanceof PolicyProvider) {
return ((PolicyProvider) page).getPolicy();
It might be possible but it's not recommended ;)
Can you just pass a property from the page to the layout?
http://wiki.apache.org/tapestry/Tapestry5Layoutcomponent
I totally agree with Thiago... you are trying to break tapestry's (very
sensible) principles.
Take a look at the link I sent you originally... pass a component parameter
(not a request parameter) from the page to the layout or use the
Environment.
On 2 May 2012 21:06, netdawg wrote:
> OK...I th
Lets assume your application looks like this:
public class QuestionAndAnswers {
private Question question;
private List possibleAnswers;
}
public class AnsweredQuestion {
private Question question;
private Answer answer;
}
public interface WebService {
public List getQuiz(String q
You should be able to use two bindings together like this:
public String getValidators() {
StringBuilder validators = new StringBuilder("a,b,c");
if (required) {
validators.append(",required");
}
return validators.toString();
}
--
View this message in context:
http://tapest
Hmm... try validate="prop:validate:validators"
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Is-it-possible-to-add-Field-validators-at-render-time-tp5682920p5683113.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---
Another option is:
@Inject Field textField;
@Inject FieldValidatorSource fieldValidatorSource;
public FieldValidator getValidators() {
StringBuilder validators = new StringBuilder("a,b,c");
if (required) {
validators.append(",required");
}
fieldValidatorSource.createValidators
I think that the "var:" binding is a bit of an edge case and I think it's
best to avoid it. I've never needed it and have always managed to get by
with component properties.
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Is-it-possible-to-add-Field-validators-at-render-tim
In your example, you are reading from the textfield's render variables (using
var:) but you are storing on the page's render variables
(resources.getPage().getComponentResources().storeRenderVariable())
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Is-it-possible-to-add-F
Correction:
In your example, you are reading from mycomponent's render variables but are
writing to the page's render variables.
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Is-it-possible-to-add-Field-validators-at-render-time-tp5682920p5683292.html
Sent from the Tapes
1. What is the value of
resources.getComponentModel().getEmbeddedComponentIds();
2. Try afterRenderBody() instead of beforeRender()
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Is-it-possible-to-add-Field-validators-at-render-time-tp5682920p5683326.html
Sent from the Tap
Netdawg, this is not the first time you've come on the list, been given
good advice, ignored it and done your own hacky thing
This blog post of yours is ignoring every piece of advice you were given on
the list http://crudsqbe.wordpress.com/2012/04/29/tapestry
I can understand thiago's frustratio
There was a slight typo in my solution before (I used @Inject instead of
@InjectComponent)
Is there something stopping you from doing this in your component?
public class MyComponent {
@InjectComponent
private Field textField;
}
--
View this message in context:
http://tapestry.1045711.n5
I've just gone through the thread here
http://tapestry.1045711.n5.nabble.com/Pagelink-above-grid-picks-up-context-from-last-pagelink-in-grid-td5660049.html
And I've taken out a few comments:
---
Can I see the serverside code for your edit page? I get the fe
setupRender() will not be called on form submission
http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/whatiscalledandwhen
I'm still not sure I entirely understand what it is that you are doing but
perhaps you need to put your logic in onActivate()
--
View this message in contex
The onPrepare() event will be fired in both cases (rendering the form and
submitting the form).
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Is-it-possible-to-add-Field-validators-at-render-time-tp5682920p5685917.html
Sent from the Tapestry - User mailing list archive at
Instead of implementing a HttpServletRequestFilter that is not managed by
tapestry, you could contribute a org.apache.tapestry5.services.RequestFilter
instead.
In your AppModule add the following
public void contributeRequestHandler(OrderedConfiguration
configuration) {
configuration.
Hi guys, I've been thinking about a "push" component for a while and I
thought I might make a start when I got some free time. I will be using an
abstraction on top of DWR's reverse ajax to achieve this.
Basically, it will look something like this:
ItemsComponent.tml
${i
Interesting to know you are thinking about push for tapestry. I know that DWR
have done quite a bit of work to abstract the underlying mechanism for push
(comet / polling / piggyback), do you think that you would roll-your-own
push mechanism or do you have a library in mind?
--
View this message i
I see... I might keep going with the DWR approach then. So If I understand
your proposal.
1. Use the incoming page request (& component resources) to generate a URL.
Should this URL be to "activate" to component or to do the actual work (eg
"doPush" in my example)?
2. In the asynchronous event (n
I think you might be explicitly calling close() on the response
outputstream somewhere in your code which you shouldn't do. It's the
servlet container's responsibility and I think it's failing when tomcat is
trying to close() a stream that has already been closed.
I could be wrong too ;)
I hastily jumped to the conclusion that it was your code which was calling
close(). It could also be a bug in Tapestry. As I said before, I could be
wrong but this sounds like a strange issue that I have had in the past.
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Null-
1301 - 1400 of 1604 matches
Mail list logo