Re: Tapestry > 5.3 makes it impossible to load symbols from DB (TAP5-1823)

2013-02-08 Thread derkoe
Lance Java wrote
> As suggested in the Jira, your SettingsService could @Inject ObjectLocator
> instead of the hibernate session. It could then lazily call
> ObjectLocator.getService(Session.class) to get the hibernate session.

This doesn't work since a method is invoked on the SettingsService in the
contribution and the exception is thrown when realizing the service.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-5-3-makes-it-impossible-to-load-symbols-from-DB-TAP5-1823-tp5719752p5719889.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Tapestry > 5.3 makes it impossible to load symbols from DB (TAP5-1823)

2013-02-04 Thread derkoe
We need to change some Tapestry symbols based on values from the database,
e.g. the SUPPORTED_LOCALES. We have a SettingsService that reads the values
- this service uses Hibernate, so it needs Tapestry IoC to be configured.

We use something like this to add the symbol:
public static void contributeApplicationDefaults(MappedConfiguration configuration, SettingsService settings) {
  configuration.add(SymbolConstants.SUPPORTED_LOCALES,
settings.getString(UISymbolConstants.SUPPORTED_LOCALES, "de,en"));
}

This worked fine in Tapestry 5.2.x - now we upgraded to 5.3.x and we get an
ERROR during IoC initialization: "Construction of service 'ServiceOverride'
has failed due to recursion".

The reason behind this is the new TapestryModule#productionModeOverrides -
this method makes ServiceOverride dependent on symbols (hence SymbolSource).

We also tried another approach with contributing to SymbolSource:
@Contribute(SymbolSource.class)
public static void
addSettingsSymbolSource(OrderedConfiguration configuration,
final SettingsService settings) {
configuration.add("settings", new SymbolProvider()
{
public String valueForSymbol(String symbolName)
{
return settings.getString(symbolName, null);
}
}, "after:*");
}
with the same result.

There was already a bug filed (closed without solution):
https://issues.apache.org/jira/browse/TAP5-1823

Has anyone an idea how to solve this problem?





--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-5-3-makes-it-impossible-to-load-symbols-from-DB-TAP5-1823-tp5719752.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: Inject managed beans?

2012-10-28 Thread derkoe
membersound wrote
> What is the T5 equivalent to the following JSF?
> 
> class Person {}
> 
> class SigninPage {
>   @Inject
>   Person person;
> }
> 
> If I try this in tapestry, I'm getting:
> org.apache.tapestry5.runtime.ComponentEventException
> Error obtaining injected value for field person: No service implements the
> interface Person.
> 
> What do I have to change to use this kind of injection in T5?

You need to define Person as a service in your module: 

public static void bind(ServiceBinder binder) {
  binder.bind(Person.class);
}

But why do you want to define a value object (Person seems to be one) as a
service?

I think the better way is to just define it as a member of your page:

class SigninPage {
  @Property
  private Person person;
}

You find more about services and injection in the docs: 
http://tapestry.apache.org/ioc-cookbook-basic-services-and-injection.html



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Inject-managed-beans-tp5717346p5717368.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: Why variable do not update in a text field

2012-10-25 Thread derkoe
dinesh707 wrote
> following are my code parts. So when some one and a mp3URL to some text
> area, system will send a ajax request to " onMp3UrlChanged()". Then it
> will get the title and set that value into "songName" and refresh the
> zone. IT WORKS!. But my problem is later when i change the text in the
> TextField and call "uploadToDB()" inside "onSuccess()", then still the
> output will be last set value to the "songName". It is not taking the new
> update from the form. 
> 
> WHY? and how to fix it ? 
> 
> --- java class ---
> @Persist 
> @Property
> private String songName;
> 
> @InjectComponent(value="songName")
> private TextField songNameField;
> 
> //this is an ajax call
> void onMp3UrlChanged() {
> mp3Url = request.getParameter("param");
> sip = new SongInformationParser(mp3Url);
> songName = sip.getTitle();
> disabled = false;
> ajaxResponseRenderer.addRender("songInfoZone1", songInfoZone1)
> }
> 
> void uploadToDB(){
> System.out.println(songName);
> }
> 
> --- TML ---
> 
>   
>  size="30"/>
> 

Is your disabled property also @Persist? If not it will be re-initalized
with false and Tapestry will not bind disabled fields.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Why-variable-do-not-update-in-a-text-field-tp5717217p5717223.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: domain forwarding

2012-09-06 Thread derkoe

sommeralex wrote
> 
> I have several domains for my project, which runs at 188.40.34.137. one
> domain is airwriting.de, the other domain is airwriting.com .com is on
> godaddy, de on another domain provider. 
> 
> both domains are forwarding to 188.40.34.137. BUT if i move my mouse over
> the links at www.airwriting.com, i can see 188.40.34.137/myPage as link in
> the status bar. on airwriting.de, everything works fine, i dont see any
> numbers.. 188.40.34.137. 
> 

Just tried your links - I get links with DNS name using both URLs. They even
match the requested URL - all links use "airwriting.com" when I go to
"airwriting.com". Maybe it's a DNS problem on your local machine?

-- 
Chris

PS: update your Tapestry version - you're still on 5.3.1




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/domain-forwarding-tp5716105p5716112.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: favicon

2012-05-05 Thread derkoe

sommeralex wrote
> 
> i have set a browser favicon, and masked forwards of several domains
> pointing to my server. But not all forwards are showing the favicons. Any
> ideas why?
> e.g
> www.domain1.com shows the favicon
> www.domain2.com does not. 
> 

I guess you have some misconfiguration in your web server (whatever your're
using) - I guess that's no Tapestry problem.

More info on how favicons work at https://en.wikipedia.org/wiki/Favicon.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/favicon-tp5687569p5687586.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: TypeCoercer..? Example.?

2012-05-05 Thread derkoe

sommeralex wrote
> 
> Hi!
> 
> I was upgrading vom Tapestry 2.6 to 3.0 and have one issue:
> 
>   if(encoder == null){
>   encoder = new EnumValueEncoder(enumType); 
>   }
>   return encoder;
> 
> the EnumValueEncoder does not exist anymore as a contructor with one
> parameter. Now, I need a TypeCoercer as the first paramter, but have no
> idea for what. 
> 
TypeCoercer is a service so just @Inject it.
Documentation can be found at
http://tapestry.apache.org/typecoercer-service.html


sommeralex wrote
> 
> There are no examples. This is really one thing which demotivates me using
> tapestry. Rather than bringing easy examples, new methods occur quickly. 
> 
There are many examples of different use cases at JumpStart:
http://jumpstart.doublenegative.com.au/home.html



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/TypeCoercer-Example-tp5687042p5687584.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: Retrieving and displaying the current locale

2012-05-04 Thread derkoe

Julien Martin wrote
> 
> Hello,
> What is the best way to retrieve and display the currently used locale's
> language on a page with tapestry?
> Thanks in advance,
> Julien.
> 

In your page class:
@Property(write=false)
@Inject Locale locale;

In your tml:
Current language is: ${locale.language}

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Retrieving-and-displaying-the-current-locale-tp5686219p5686573.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



[ANN] Tapestry article in Javamagazin (German)

2012-05-02 Thread derkoe
The first article of my 4-part series in German Javamagazin was published
today:
http://it-republik.de/jaxenter/java-magazin-ausgaben/JSF-2.2-000500.html

Hope that'll help getting Tapestry more popular in Austria, Germany and
Switzerland.

(for non-German speakers: Javamagazin is the biggest German magazine about
the Java platform)

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/ANN-Tapestry-article-in-Javamagazin-German-tp5681052.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: Multiple Tapestry5 app on a single server

2012-04-26 Thread derkoe

Massimo Lusetti wrote
> 
> So do you manage ram and server settings for each tomcat instance, right?
> 

Yes, we created scripts for setting up and managing Tomcats because we have
lots of webapps and Tomcats. 

Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Multiple-Tapestry5-app-on-a-single-server-tp5667202p5668400.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: Multiple Tapestry5 app on a single server

2012-04-26 Thread derkoe

Massimo Lusetti wrote
> 
> Hi all,
> I'm in the need to prepare a server for hosting multiple (read from 6 to
> 8) tapestry5 apps.
> 
> Do anyone have any experience in this field? Which is your typical
> settings in this scenario?
> 

We use Tomcat with a single CATALINA_HOME and multiple CATALINA_BASE -
usually one per "logical application". A "logical application" consist of
one or more WARs.

We usually do not put JARs in the common/lib - we do that just for database
drivers (so that Tomcat can manage the db pool).

Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Multiple-Tapestry5-app-on-a-single-server-tp5667202p5667217.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: 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-26 Thread derkoe

sommeralex wrote
> 
> 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:
> 

When you are in development mode (and you're using Tapestry 5.3) the
stacktrace is show in the browser with a js popup. The stacktrace is also
logged via slf4j - so it depends on your logging config if the stacktrace is
shown.

The null check in getGroups does not help since you  access the field
directly in onProgressiveDisplayFromLoadingScreen:

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

You can also use a debugger - it always helps :)


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

2012-04-02 Thread derkoe
Robert asked if you have a @Persist on your CollageModel in the parent
component or page. Parameters in Tapestry have a bi-directional binding. So,
if you have a @Persist on the model it is shared in the session. Two browser
tabs/windows also share the same session.
If you want to have state per window you have to either store that on the
client side or implement a sub-session per window. 

We're currently working on a @Persist("window") and @WindowState here
https://github.com/porscheinformatik/tapestry-conversation - but it's just a
work in progress. 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Issue-with-Component-Parameter-tp5612950p5613282.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: Unable to decode multipart encoded request - Help required to check this exception

2012-04-02 Thread derkoe

nazarhussain_s wrote
> 
> Currently I am facing the following issues during the uploading of a File
> through a form in tapestry. I need to know how to handle the below
> exceptions.I am using Tapestry 4 , Jdk 1.5 , Weblogic 9.2. Can you please
> suggest what could be done for below two exceptions 
> 
> -> org.apache.hivemind.ApplicationRuntimeException: Unable to decode
> multipart encoded request: Processing of multipart/form-data request
> failed. Read timed out
> 
> -> org.apache.hivemind.ApplicationRuntimeException: Unable to decode
> multipart encoded request: Processing of multipart/form-data request
> failed. Stream ended unexpectedly
> 

This looks like a problem in commons FileUpload as described here:
http://stackoverflow.com/questions/646189/why-did-i-get-fileuploadexception-stream-ended-unexpectedly-with-apache-commo

I also found problems regarding IIS
(http://web.archiveorange.com/archive/v/ZaXOZy6IEYaAU8RY8nqQ) - just if
you're using IIS in front of Weblogic.


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Unable-to-decode-multipart-encoded-request-Help-required-to-check-this-exception-tp5606124p5612637.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: Bean Validation Localization

2012-03-06 Thread derkoe

Igor Drobiazko wrote
> 
> Tapestry provides its own MessageInterpolator which is the wrapper around
> the default one. Tapestry's interpolator is using ThreadLocale#getLocale()
> in MessageInterpolator#interpolate without Locale parameter. Check this
> out.
> 
> https://svn.apache.org/repos/asf/tapestry/tapestry5/trunk/tapestry-beanvalidator/src/main/java/org/apache/tapestry5/internal/beanvalidator/MessageInterpolatorImpl.java
> 
> I guess the problem is that you didn't place the translations into a file
> expected by the Bean Validation API. So far only these files are
> supported,
> Tapestry's message catalog not.
> 

Thanx Igor - you're right!

I found the problem: it is related to a Bug in the Java ResourceBundle
implementation (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6463986).

Given you have Locale.getDefaultLocale == "de" (-Duser.language=de)
and you have the following files:
test.properties with text test=English
test_de.properties with text test=Deutsch
When you get the bundle with ResourceBundle.getBundle("test.properties",
Locale.ENGLISH)
and you call bundle.getString("test")
then you will get "Deutsch".

This is not what you would think would happen. You can solve this by
creating an empty file test_en.properties - then the fallback works as
expected.

Tapestry's Message implementation does not have this bug :)

-- 
Chris

PS: by the way - here's the code and the link to the running version of a
simple crud app with jsr303:
https://github.com/derkoe/tapestry-javamagazin
http://tapestry-javamagazin2.cloudfoundry.com/

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Bean-Validation-Localization-tp5538273p5541534.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: tapestry5-db-migrations

2012-03-05 Thread derkoe

Taha Hafeez wrote
> 
> I was looking for something like rails migration and came across
> https://github.com/spreadthesource/tapestry5-db-migrations. It looks
> promising. I have a few queries about it :-
> 
> 1) Is it being actively maintained as the last commit was 9 months ago.
> 
> 2) It is based on Tapestry-5.2. Any plans of upgrading to 5.3
> 
> 3) And how do we add a custom column definition like in
> @Column(columnDefinition = "longtext") etc.
> 

We use Liquibase (http://www.liquibase.org/) - it works like a charm. We
created a simple Tapestry service which you can contribute a collection of
Liquibase changelog files. 

This LiquibaseService is called from a HibernateConfigurer which builds the
Hibernate ConnectionProvider and passes the connection to the
LiquibaseService.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/tapestry5-db-migrations-tp5535228p5537715.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: Is it possible to use Zone with Radio Group to trigger an onValueChangedFrom?

2012-02-25 Thread derkoe

georgeludwig wrote
> 
> I was able to get a Select with zone to trigger an onValueChangedFrom...
> event, and now I want to do the same thing with a radio group.
> 
> After flailing away for a couple of hours, I consulted the documentation
> and noted that the Select component indicates it will use the zone param
> to
> trigger an org.apache.tapestry5.EventConstants#VALUE_CHANGED event.
> However, neither Radio nor Radio Group have that in the doc.
> 
> So I'm guessing my code isn't working because Radio Group doesn't
> support zones. Is this correct, and if so, are there plans to support it?
> Is there an alternate approach by using a zone for the form containing the
> radio button?
> 

You're right Radio/RadioGroup does not support this. But you can implement
it yourself with a Mixin - look at the Code of the Select component and
extract the JS/Ajax stuff into the Mixin. Then apply the Mixin to your Radio
or RadioGroup.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Is-it-possible-to-use-Zone-with-Radio-Group-to-trigger-an-onValueChangedFrom-tp5514257p5514833.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: browser cache - response headers - page/ajax/asset requests

2012-02-24 Thread derkoe

Paul Stanton-4 wrote
> 
> Hi All,
> 

Hi!


Paul Stanton-4 wrote
> 
> In a t5.1 app, I thought it was worth checking every request path and 
> setting the 'no-cache' response headers for all page/ajax requests.
> 
> I'm not sure if this is still needed, but my required behaviour is that 
> all page and ajax requests are NEVER cached, while all assets are ALWAYS 
> cached.
> 
> Does tapestry now take care of this, or do I still need to set the
> headers?
> 

You have to decorate the PageResponseRenderer (and AjaxResponseRenderer).
Why did you think Tapestry will do this out of the box? I guess this would
be bad practice for most applications (we have to do it because of security
restrictions).

Here's our PageResponseRenderer:

public final class CacheHeaderPageResponseRendererDecorator implements
PageResponseRenderer
{
private final PageResponseRenderer delegate;

private final Response response;

public CacheHeaderPageResponseRendererDecorator(PageResponseRenderer
delegate, Response response)
{
this.delegate = delegate;
this.response = response;
}

public void renderPageResponse(Page page) throws IOException
{
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", 0);

delegate.renderPageResponse(page);
}
}


Paul Stanton-4 wrote
> 
> Thanks, Paul.
> 

You're welcome!

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/browser-cache-response-headers-page-ajax-asset-requests-tp5511964p5513984.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: Issue with my T5 unit tests

2012-02-15 Thread derkoe

Julien Martin wrote
> 
> Hello,
> 

Hi!


Julien Martin wrote
> 
> I am trying to make sure that if a user has not accepted the terms and
> conditions, then they cannot register.
> 
> However my "*testFailsIfConditionsNotAccepted*" always fails and logging
> info indicates that the checkbox is always checked despite the test
> setting
> the value of the boolean to false.
> 
> This behavior is not exhibited when I run my app and when I test my forms
> manually...
> 
> Can anyone please help?
> 

Maybe that's because you set the acceptsConditions to true in the test:
fieldValues.put("acceptsConditions", "true");* 

And one comment: childminderAccount does not have to be @Persist - you reset
it to a new instance anyway every time in setupRender 


Julien Martin wrote
> 
> Regards,
> J.
> 

Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Issue-with-my-T5-unit-tests-tp5486297p5486842.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: OnValidate reset form values on error

2012-02-14 Thread derkoe

captain_rhino wrote
> 
> In my onvalidate I attempt to change a different form value from one that
> I was validating (reset it to blank) but the field always displays the
> original form value) and not blank as I would wish.  Can anyone suggest
> anything obviously wrong?  thx in adavnce
> 

Tapestry holds the values entered by the user in the ValidationTracker until
validation is successful - on validation errors the values are taken from
there. This is done because otherwise you would need not mark all form
values as @Persist("flash").

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/OnValidate-reset-form-values-on-error-tp5482780p5483288.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: Current Bean in Environment

2012-02-13 Thread derkoe

Михаил Слободянюк wrote
> 
> Hi!
> 
Hi!


Михаил Слободянюк wrote
> 
> When i wrote bean display/edit block i must know state of other properties
> of object in addition to current editable.
> Why Grid, BeanEditor and BeanDisplay do not provide it possibility?
> 
A good question - it would be helpful to have the current bean in the
BeanEditContext. 
@Devs: is there a reason that it's not in there?

A workaround could be to create your own context and push the object to the
Environment in BeginRender of your enclosing component.
Or you could use the BeanValidationContext but then you have to add your
object as validate to the Form.


Михаил Слободянюк wrote
> 
> Mihail.
> 
Christian

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Current-Bean-in-Environment-tp5476313p5479391.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: OpenSAML2 - Blank page

2012-02-13 Thread derkoe

Ditso wrote
> 
> Hi everybody,
> 

Hi!


Ditso wrote
> 
> currently we are building an application with an OpenSAML2 login. We are
> using a JBOSS 6.1 environment and tapestry 5.2.6.
> 
> Sometimes when we restart the server we are able to login and the pages
> are shown. Other times we retrieve a blank page from the redirect. Does
> anybody had any similar problems? Or is there an efficient way to trace
> requests and responses or other debug mechanism to handle this problem?
> 

I would use Firebug's "Net" tab. Set it to "persist". There you'll see all
request including redirects. Usually you can tell by the URL and/or content
which framework/server is sending the responses.


Ditso wrote
> 
> Kind regards,
> Dieter
> 

Cheers, Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/OpenSAML2-Blank-page-tp5478877p5479107.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: Tapestry at Confess 2012

2012-02-08 Thread derkoe

Igor Drobiazko wrote
> 
> Great. Last year it was me. This year you will represent Tapestry. Enjoy
> the great conference. What a pity I won't be there this year. Vienna is
> one
> of my favorite cities.
> 

I'll try my best - there are lots of JSF developers there, so it won't be
easy ...

Actually - this year's location is even better - Confess is in Salzburg's
mountains:
http://www.krallerhof.com/en/service/impressionen/


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-at-Confess-2012-tp5467211p5467608.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: Stuts VS Tapestry - I need some ammo

2012-01-26 Thread derkoe

Thim Anneesens wrote
> 
> Hello Tapestry users,
> 

Hi!


Thim Anneesens wrote
> 
> The company where I work is going to choose a web framework to implement 
> there site (the company core business revolves around that site). We did 
> a POC with Spirng MVC, JSF, Struts and Tapestry.
> We have shortlisted to Struts and Tapestry and I have the feeling that 
> Struts will win.
> 

Are there any reasons why Struts is winning? I think Struts is quite an old
framework and I won't use it in a new project.

When you are looking for a new web framework look at the requirements of
your project. Do you want to have a component framework (like JSF and
Tapestry) or an action framework (like Spring MVC and Struts)? Do you need
to adhere to standards (JSF, EJB, etc.)? How many users will use your app -
do you need to be stateless (this will sort out some frameworks)? Are all
you programmers well trained in HTML/JS (if you have just some web gurus
then a component framework will be better)? How big will your app be? Will
it be modularized (if yes Tapestry will be a very good choice)?

This article might help with some considerations:
http://net.tutsplus.com/tutorials/other/15-most-important-considerations-when-choosing-a-web-development-framework/

I guess Tapestry is a good general purpose framework - so you can use it for
web sites with thousands of users and for complex internal admin apps with
just a few users.
Tapestry is especially good for modular web applications and for
encapsulating JS/AJAX (so that just some developers have to know how). You
can also implement cross-cutting concerns better than in any other web
framework I know.

PS: 
I think it's quite strange that Struts and Tapestry are your final
candidates since the main choice (component vs. action) would lead to
another grouping.


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Stuts-VS-Tapestry-I-need-some-ammo-tp5432282p5432725.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: grid label for not sortable column

2011-12-03 Thread derkoe

chpasha wrote
> 
> Hi all, I'm migrating to 5.3 from 5.2 and experience a problem showing
> column label for not sortable columns. Here is my BeanModel Code
> 
> private BeanModel createAndConfigureGridModel() {
> BeanModel model =
> beanModelSource.createDisplayModel(Evaluation.class, messages);
> 
> model.add("model", null).sortable(true);
> model.add("submitter", null).sortable(true);
> model.add("editAction", null).label("");
> model.get("submitterComment").sortable(false);
> model.get("evaluatorComment").sortable(false);
> 
> 
> model.reorder("model", "dealerPrice", "submitter",
> "submitterComment");
> 
> return model;
> }
> 
> all sortable(false) columns have no column label when rendered. if i
> remove sortable(false) - everything works like expected. Is it some known
> breaking change?
> 

I just tried that - there are labels for all columns except "editAction" -
where label "" was specified.

Here's my grid






And i created a Evaluation class:
public class Evaluation
{
public String submitterComment;
public String evaluatorComment;
public Long dealerPrice;
}

--
Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/grid-label-for-not-sortable-column-tp5041541p5044420.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: Code Coverage link on Tap homepage doesn't work anymore

2011-12-03 Thread derkoe
Just found out that Tapestry's metrics are published via Sonar at Apache:
https://analysis.apache.org/dashboard/index/48022

But I guess there's something wrong - since Tapestry has a coverage of 25.7%
there!? And it used to have coverage > 90%. I guess that's because the
integration tests with browser are not running.

But one thing makes me worry - the coverage was still up at 44.6% in March:
https://analysis.apache.org/plugins/resource/48022?page=org.sonar.plugins.timeline.GwtTimeline

Is this some build glitch with the switch to Gradle? Or is this the problem
with meta-programming and measuring coverage?

Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Code-Coverage-link-on-Tap-homepage-doesn-t-work-anymore-tp5011461p5044361.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



Code Coverage link on Tap homepage doesn't work anymore

2011-11-21 Thread derkoe
Link "See Tapestry's code coverage report" on Tapestry home page leads to
http://tapestry.apache.org/current/tapestry-core/cobertura/index.html which
results in a 404.

JIRA? Or can somebody fix that quickly?

-- 
Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Code-Coverage-link-on-Tap-homepage-doesn-t-work-anymore-tp5011461p5011461.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: Flexigrid with tapestry 5.2

2011-11-21 Thread derkoe

Cucchietti Denis-2 wrote
> 
> Hi all !
> 
Hi

Cucchietti Denis-2 wrote
> 
> Is there a mean to integrate flexigrid ( http://flexigrid.info/ )
> component into tapestry 5.2 ? Maybe a custom component already exists?
> 

Haven't heard of any - but I've done an implementation for
http://datatables.net/ - I can publish that if you want.

Seems like the got5 guys are also implementing a DataTable component:
https://github.com/got5/tapestry5-jquery/blob/master/src/main/java/org/got5/tapestry5/jquery/components/DataTable.java


Cucchietti Denis-2 wrote
> 
> Thanks in advance.
> 

Your'e welcome,
Chris



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Flexigrid-with-tapestry-5-2-tp5010845p5011427.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Tapestry in Scala

2011-11-21 Thread derkoe
During the (excellent) Scala workshop at W-JAX 2011 - with not a single
Tapestry talk :( - I thought how it would be to develop a Tapestry
application in Scala.

In a nutshell: Tapestry and Scala work perfectly together (when you keep
some things in mind).

I wrote a post about the good things and pitfalls 
http://derkoe.wordpress.com/2011/11/18/tapestry-in-scala/

and created a demo app with Tapestry and JPA:
https://github.com/derkoe/tapestry-scala-demo

-- 
Chris


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-in-Scala-tp5010192p5010192.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: Print functionality in tapestry 4.1.6

2011-11-21 Thread derkoe

NewUser wrote
> 
> Hi everyone,
> 
> I am using tapestry 4.1.6 in my project. I have to implement a print
> functionality that includes :
> 
> 1. displaying a 'Print' button on a page
> 2. click on 'Print' button opens up that particular page in pop-up along
> with print dialog box
> 
> I have been so far successful in achieving  both the above using
> PopupLinkRenderer with directLink and window.print() . 
> 
> The problem is my page is inside a frame (that's another portal). I don't
> want the outer portal to get printed when i call window.print()
> 
> Is there some way to achieve this??  So that only the page will get print
> and not the frame or portal containing the page.
> 

That's not quite a Tapestry but a general web dev question ... anyway:

A web page cannot set the printing behavior when it comes down to frames. In
most browser the user can choose the what to print - all frames, a single
frame or as shown in the browser. 

A solution from the application-side could be to open a new window with the
print version and close it after printing.

-- 
Chris



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Print-functionality-in-tapestry-4-1-6-tp5009536p5010175.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: Print functionality in tapestry 4.1.6

2011-11-21 Thread derkoe


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Print-functionality-in-tapestry-4-1-6-tp5009536p5010161.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: Spring-security can't add AuthenticationProvider

2011-11-21 Thread derkoe

kado wrote
> 
> Hi,
> 
> I am trying to add a facebook provider to my app.
> 
> I added the config to the xml and I had created the  Class
> FacebookDaoProvider just for testing if everything goes fine but when I
> start the server this message is shown:
> 
> Construction of service ProviderManager failed: Error invoking service
> builder method
> nu.localhost.tapestry5.springsecurity.services.SecurityModule.buildProviderManager(List)
> (at SecurityModule.java:333) (for service 'ProviderManager'): Error
> invoking service contribution method
> ar.com.condor.services.CondorSecurityModule.contributeProviderManager(OrderedConfiguration,
> AuthenticationProvider): Spring context contains 2 beans assignable to
> type
> org.springframework.security.providers.AuthenticationProvider:
> daoAuthenticationProvider, facebookDaoProvider.
> 
> Does anybody know what I am missing or what I am doing wrong?
> 

The problem is that you have 2 Spring beans binding the same type
(AuthenticationProvider) - Tapestry's injection is based on types, so it
cannot determine which service to inject.

For a solution you can either eliminate one of the two Spring beans or
inject ApplicationContext and get the bean manually. 

-- 
Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Spring-security-can-t-add-AuthenticationProvider-tp5005539p5009797.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: Jetty Restarts every time i save

2011-11-16 Thread derkoe

Josh Kamau wrote:
> 
> Hi there,
> 
> I am learning tapestry using eclipse/jetty/maven. I have followed the
> instructions on the tapestry page. However, every time i save on eclipse,
> jetty automatically restarts. Is this the ways it is supposed to be? when
> i
> disable 'scanning' in jetty run configurations, my changes are not
> reloaded. How can i work without jetty automatically restarting ?
> 
> regards.
> 
> Josh.
> 

How do you start Jetty?

The best way is to use RunJettyRun (http://code.google.com/p/run-jetty-run/)
or Eclipse Jetty (http://eclipse-jetty.sourceforge.net/).

I think live reloading doesn't work when starting with "mvn jetty:run"

Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Jetty-Restarts-every-time-i-save-tp4998463p4998584.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: Tapestry / Obfuscation / Service Alias recursion

2011-11-16 Thread derkoe
I guess you did forget to change the "tapestry.app-package" context parameter
or/and change the module classes in MANIFEST.MF.

Chris


Nicolas Barrera wrote:
> 
> Hi all,
> 
> I wanted to share my strange use case and the errors I 'm facing in my way
> to accomplish it, either way if none can help me this serves as a kind of
> therapy don't you think?
> 
> The problem appears only after obfuscating the webapp do you think this
> can
> araise problems with tapestry IoC? (I 'm just obfuscating my own
> libraries... not third parties)
> 
> well, this is the case:
> 
> We 've already coded all the app when some guy says "it must not contain
> the company's name in the whole deliverable" (he does some grep to control
> this),
> so we opted to obfuscate the code using Proguard, certainly we 're not
> obfuscating all the code we 're just obfuscating to remove the trhee first
> major packages (which contains the company name), methods and class names
> and subpackages like pages & components are kept unchanged!
> 
> That done, we move on to test the web application after being obfuscated
> and here I post the stactrace when I init the app in Tomcat 5.5.20 or
> Jetty
> standalone 7.0.0:
> 
> It seems to be a problem while loading a Module named CustomSecurityModule
> (we 're using tapestry spring security) and use this custom module to
> contribute provider manager with an ldap provider.
> 
> INIT org.eclipse.jetty.servlet.ServletHolder$Config@65394b
>> 16/11/2011 14:58:37.275 [INFO ] [RegistryBuilder] - Adding module
>> definition for class org.apache.tapestry5.ioc.services.TapestryIOCModule
>> 16/11/2011 14:58:37.368 [INFO ] [RegistryBuilder] - Adding module
>> definition for class
>> nu.localhost.tapestry5.springsecurity.services.SecurityModule
>> 16/11/2011 14:58:37.401 [INFO ] [RegistryBuilder] - Adding module
>> definition for class org.apache.tapestry5.spring.SpringModule
>> 16/11/2011 14:58:37.520 [INFO ] [RegistryBuilder] - Adding module
>> definition for class org.apache.tapestry5.upload.services.UploadModule
>> 16/11/2011 14:58:37.547 [INFO ] [RegistryBuilder] - Adding module
>> definition for class org.apache.tapestry5.services.TapestryModule
>> 16/11/2011 14:58:37.626 [INFO ] [RegistryBuilder] - Adding module
>> definition for class
>> org.apache.tapestry5.internal.services.InternalModule
>> 16/11/2011 14:58:37.650 [INFO ] [RegistryBuilder] - Adding module
>> definition for class a.cemiWebapp.services.AppModule
>> 16/11/2011 14:58:37.951 [ERROR] [OperationTrackerImpl] - Construction of
>> service 'Alias' has failed due to recursion: the service depends on
>> itself
>> in some way. Please check
>> org.apache.tapestry5.services.TapestryModule.buildAlias(Logger,
>>  String, AliasManager, Collection) (at TapestryModule.java:325) for
>> references to another service that is itself dependent on service
>> 'Alias'.
>> 16/11/2011 14:58:37.952 [ERROR] [OperationTrackerImpl] - Operations
>> trace:
>> 16/11/2011 14:58:37.954 [ERROR] [OperationTrackerImpl] - [ 1] Realizing
>> service ServletApplicationInitializer
>> 16/11/2011 14:58:37.955 [ERROR] [OperationTrackerImpl] - [ 2] Invoking
>> org.apache.tapestry5.services.TapestryModule.buildServletApplicationInitializer(Logger,
>> List, ApplicationInitializer) (at TapestryModule.java:1247)
>> 16/11/2011 14:58:37.956 [ERROR] [OperationTrackerImpl] - [ 3]
>> Constructing
>> module class org.apache.tapestry5.services.TapestryModule
>> 16/11/2011 14:58:37.957 [ERROR] [OperationTrackerImpl] - [ 4] Determining
>> injection value for parameter #1
>> (org.apache.tapestry5.ioc.services.PipelineBuilder)
>> 16/11/2011 14:58:37.958 [ERROR] [OperationTrackerImpl] - [ 5] Resolving
>> object of type org.apache.tapestry5.ioc.services.PipelineBuilder using
>> MasterObjectProvider
>> 16/11/2011 14:58:37.959 [ERROR] [OperationTrackerImpl] - [ 6] Realizing
>> service Alias
>> 16/11/2011 14:58:37.960 [ERROR] [OperationTrackerImpl] - [ 7] Invoking
>> org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String,
>> AliasManager, Collection) (at TapestryModule.java:325)
>> 16/11/2011 14:58:37.961 [ERROR] [OperationTrackerImpl] - [ 8] Determining
>> injection value for parameter #4 (java.util.Collection)
>> 16/11/2011 14:58:37.962 [ERROR] [OperationTrackerImpl] - [ 9] Collecting
>> unordered configuration for service Alias
>> 16/11/2011 14:58:37.963 [ERROR] [OperationTrackerImpl] - [10] Invoking
>> method
>> a.cemiWebapp.services.AppModule.contributeAlias(AuthenticationProcessingFilter,
>> Configuration) (at null:-1).
>> 16/11/2011 14:58:37.964 [ERROR] [OperationTrackerImpl] - [11] Determining
>> injection value for parameter #1
>> (org.springframework.security.ui.webapp.AuthenticationProcessingFilter)
>> 16/11/2011 14:58:37.965 [ERROR] [OperationTrackerImpl] - [12] Resolving
>> object of type
>> org.springframework.security.ui.webapp.AuthenticationProcessingFilter
>> using
>> MasterObjectProvider
>> 16/11/2011 14:58:37.966 [ERROR] [OperationTrackerImpl] - [13] Realizing
>> servic

Re: Web services using Tapestry

2011-11-08 Thread derkoe

Tim Fletcher wrote:
> 
> Hi All,
> 
> I have spent the last day trying to find a simple method for adding web
> services via Tapestry5, but have only found slightly old
> tutorials referring to Tapestry4.
> 
> Do you guys have any specific recommendations?
> 
> Ideally, i would like to use JAX-WS style annotations.
> 
> Thanks in advance,
> Tim
> 

Here's a simple integration for Metro (JAX-WS RI):
https://github.com/derkoe/tapestry-jaxws

You can also use the libraries (Metro, CXF) directly by then you cannot
inject Tapestry services.

-- 
Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Web-services-using-Tapestry-tp4974432p4974549.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: [5.3] JPA Maven Dependency not found

2011-11-08 Thread derkoe
Yeah - that's what I did but I think this should be fixed before releasing
5.3


lprimak wrote:
> 
> I specifically exclude persistence in my Pom when I import tapestry-jpa as
> a workaround. 
> 
> On Nov 8, 2011, at 7:05 AM, derkoe <tapestry.christian.koeberl@>
> wrote:
> 
>> Just tried to use 5.3-rc-2 tapestry-jpa module, but Maven cannot find the
>> dependency to org.eclipse.persistence:javax.persistence:2.0.3
>> 
> 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/5-3-JPA-Maven-Dependency-not-found-tp4974063p4974541.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



[5.3] JPA Maven Dependency not found

2011-11-08 Thread derkoe
Just tried to use 5.3-rc-2 tapestry-jpa module, but Maven cannot find the
dependency to org.eclipse.persistence:javax.persistence:2.0.3

There seems to be a 2.0.0 but not 2.0.3:
http://search.maven.org/#search|ga|1|a%3A%22javax.persistence%22
http://mvnrepository.com/artifact/org.eclipse.persistence/javax.persistence

Anyway - I think it's not good to have this artifact as a transient
dependency: it would be good when the artifact is marked as optional=true or
scope=provided in the pom so that it is not inherited transiently.

-- 
Chris


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/5-3-JPA-Maven-Dependency-not-found-tp4974063p4974063.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: Ability to stop logging user errors?

2011-10-30 Thread derkoe

lprimak wrote:
> 
> I just put out a test web site to 50 users. 
> We have enterprise monitoring software that sends emails to all the bosses
> when an error is logged in the web site.
>  

First of all - working on weekends is no good idea :)



> Right now, errors such as form submits via GET, minification syntax errors
> and other issues that are clearly user errors are getting emailed to the
> management. 
> 
> Is there any way to turn those off?  
> Right now I disablede all logging for IOCRegistry module, but I don't
> think it's the right solutions. 
> Is there a better solution?  Is this worthy of a JIRA?  Thanks!
> 

You could simply override RequestExceptionHandler - the default version logs
an error with stacktrace. Your version can do whatever you want (e.g. log a
warning without stacktrace for some exceptions).
See:
http://tapestry.apache.org/overriding-exception-reporting.html#OverridingExceptionReporting-Version2:OverridingtheRequestExceptionHandler

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Ability-to-stop-logging-user-errors-tp4949134p4949810.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: Datepicker localization issue

2011-10-24 Thread derkoe

lprimak wrote:
> 
> The dates show up fine for my US Locale,
> but that 6 month popup is "2011 Oct" as opposed to "Oct 2011" :)
> 

I guess that is intended by the datpicker.js - the top label in the picker
is also in format "year month". If you want another JS date picker you can
quite easily create your own Tapestry component (or copy the core one and
path it).

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Datepicker-localization-issue-tp4928694p4933554.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: Datepicker localization issue

2011-10-24 Thread derkoe

lprimak wrote:
> 
> There is a a label on top of the date picker that says "2011 October"
> When you click on that it turns into a popup where you can choose the last
> six months.
> I looked at it actually and its hardcoded in JavaScript, so I had to
> monkey patch it,
> as it wasn't localized at all.
> 

Hey - cool! I haven't noticed that.

Which Locale are you using? In German it works - the dates are shown
localized (Tapestry 5.2.6).

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Datepicker-localization-issue-tp4928694p4932601.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: ActivationRequestParameter only works in a page?

2011-10-24 Thread derkoe

trsvax wrote:
> 
> I know it's documented but is there any real reason the
> ActivationRequestParameter annotation only works in a page and not a
> component? I realize poor naming conventions could cause conflicts but
> it seems like an unnecessary restriction.
> 

I think that's a very good restriction - I also think that
activate/passivate should not be handled/raised by/to components.

The first point on our Tapestry best practice list is: Never use
onActivate/passivate in components. 

There are many problems with activation context in components: 
 * One problem is when you reuse the component and are not aware of the
activation context handling.
 * I guess the framework's problem is to handle multiple onPassivates. If
you have to components with an activation context to passivate, which one
should Tapestry take?

-- 
Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/ActivationRequestParameter-only-works-in-a-page-tp4932370p4932417.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: Datepicker localization issue

2011-10-24 Thread derkoe

lprimak wrote:
> 
> Right now the default EN locale for the 6 month popup is not localized
> properly. "2011Octpber" vs. "October 2011". 
> Worthy of a JIRA issue?
> 

Are you talking about Tapestry's DateField component? I don't know any "6
month popup". Can you be more specific or provide an example?

-- 
Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Datepicker-localization-issue-tp4928694p4932284.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: Javascript access to Tapestry Image Asset

2011-10-20 Thread derkoe

Ray Fortycoats wrote:
> 
> Hi all,
> 

Hi Ray!


Ray Fortycoats wrote:
> 
> I need to be able to access an image from javascript using the following
> call:
> 
> jQuery(button).attr("style", "background-image :
> url(images/button.png);");
> 
> The problem is that this will not work for me in the future as I have a
> requirement to change the URL based on locale.
> 
> So what I was hoping that perhaps I could use a Tapestry Asset with a
> fixed
> path and access it from javacript.
> 
> Is this possible? Any assistance would be greatly appreciated.
> 
> 

Yes, it is :)

Just inject the asset and use it in your script - see
http://tapestry.apache.org/assets.html

Code should look something like this:
  @Inject
  @Path("context:images/button.png")
  private Asset button;
...
  javaScriptSupport.addScript("jQuery(button).attr('style',
'background-image : url(%s);');", button.toClientURL());

-- 
Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Javascript-access-to-Tapestry-Image-Asset-tp4920809p4920940.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: The difference between "ValueEncoder" and "Translator"

2011-10-17 Thread derkoe

dick_hu wrote:
> 
> Now I use the FCKeditor, because of it often has many html tags,so the
> value's length often over the db's words limit.So I want to transform the
> html tags to short string.
> I want to use the "Translator",But I find "ValueEncoder" seems has the
> same feature.
> Which one can I choose? Can AnyOne tell me the difference  between
> "ValueEncoder" and "Translator".
> 

ValueEncoder is for converting between objects and strings to be used in
links, select values, etc. (so computer readable).
Translator is for converting between objects and strings for humans - e.g.
in inputs.

See also JavaDoc:
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ValueEncoder.html
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/Translator.html

-- 
Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/The-difference-between-ValueEncoder-and-Translator-tp4908456p4908962.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: NumberFormatter

2011-10-12 Thread derkoe

Leon Derks wrote:
> 
> I have a TextField that shows a double value.
> 
> But I want to format the value in the Textfield as a decimal with 4
> decimals (i.e. 0.1234)
> 
> In Tapestry there is a NumericFormatter and a BigDecimalNumericFormatter.
> But I can't find any documentation on how to use these on a TextField.
> Can someone give me an example how I can format my double value into a
> decimal value with 4 decimals?
> 
> regards,
> Leo
> 

For input fields (such as TextField) you can add a parameter "translate" of
type FieldTranslator which translates between the object (e.g. BigDecimal)
and the String representation in the input.
See:
http://tapestry.apache.org/current/tapestry-core/ref/org/apache/tapestry5/corelib/components/TextField.html

You can also define your translator globally by contributing to
TranslatorSource.

-- 
Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/NumberFormatter-tp4894812p4894939.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: BeanEditor & Bugs

2011-10-11 Thread derkoe

Wechsung, Wulf wrote:
> 
> so, I noticed that BeanEditors don't work very well a loops. Seems to just
> not render anything. Should I file that as a bug or is this a D'oh kind of
> thing that should be obvious?
> 

Just created a page with a BeanEditor in a loop - it renders inputs as it
should.

Can you provide some code showing your problem?

-- 
Chris

PS: Howard already addressed the jiretiquette :)

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/BeanEditor-Bugs-tp4892146p4892793.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: Grid sorting - lowercase,uppercase

2011-10-11 Thread derkoe
The problem is that Tapestry uses the usual Java String comparison for
sorting in Grid (generally speaking - Grid is not really localized).
String's compare uses the value of the character (and in UTF-8 encodings "b"
is greater than "G", as in ASCII).

So, if you want correct sorting you have to use a Collator.

Here's a correct GridDataSource (using a Collator on Strings):

/**
 * {@link GridDataSource} for {@link Collection}s with correct {@link
String} sorting.
 */
@SuppressWarnings("unchecked")
public class MyCollectionGridDataSource implements GridDataSource
{
private final List list;

private final Locale locale;

private final Class clazz;

/**
 * Constructs a {@link GridDataSource} for the given collection (clazz 
is
determined by first
 * element in collection).
 * 
 * @param collection the collection
 * @param locale the current locale
 */
public MyCollectionGridDataSource(final Collection collection, final 
Locale
locale)
{
this(collection, locale, null);
}

/**
 * Constructs a {@link GridDataSource} for the given collection.
 * 
 * @param collection the collection
 * @param locale the current locale
 * @param clazz which is the common super type of the objects in the
collection
 */
public MyCollectionGridDataSource(final Collection collection, final 
Locale
locale, final Class clazz)
{
Validate.notNull(collection, "collection");

if (collection instanceof List)
{
// Keep original list so that sorting it will reflect 
changes in UI
list = (List) collection;
}
else
{
// Copy the collection so that we can sort it in a list
list = CollectionFactory.newList(collection);
}

this.locale = locale;

if (clazz != null)
{
this.clazz = clazz;
}
else
{
this.clazz = list.isEmpty() ? null : 
list.get(0).getClass();
}
}

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

public void prepare(int startIndex, int endIndex, List
sortConstraints)
{
for (final SortConstraint constraint : sortConstraints)
{
final ColumnSort sort = constraint.getColumnSort();

if (sort == ColumnSort.UNSORTED)
continue;

final PropertyConduit conduit =
constraint.getPropertyModel().getConduit();

final Comparator valueComparator = new Comparator()
{
public int compare(Comparable o1, Comparable o2)
{
// Simplify comparison, and handle case 
where both are nulls.

if (o1 == o2)
return 0;

if (o2 == null)
return 1;

if (o1 == null)
return -1;

return (conduit.getPropertyType() == 
String.class) ?
Collator.getInstance(
locale).compare(o1, o2) : 
o1.compareTo(o2);
}
};

final Comparator rowComparator = new Comparator()
{
public int compare(Object row1, Object row2)
{
int modifier = sort == 
ColumnSort.ASCENDING ? 1 : -1;
Comparable value1 = (Comparable) 
conduit.get(row1);
Comparable value2 = (Comparable) 
conduit.get(row2);

return modifier * 
valueComparator.compare(value1, value2);
}
};

// We can freely sort this list because its just a copy.
Collections.sort(list, rowComparator);
}
}

/**
 * Returns the type of the first element in the list, or null if the 
list
is empty.
 */
public Class getRowType()
{
return clazz;
}

public Object getRowValue(int index)
{
return list.get(index);
}
}

You have to set the GridDataSource for your Grid or you add it to the

[ANN] Tapestry and JAX-WS (Metro)

2011-10-09 Thread derkoe
I read the recent threads about integrating JAX-WS and Tapestry. One of our
projects is using JAX-WS (Metro) with Tapestry for 3 years now, so I
extracted the relevant code and put in on github.

Here's the result: Tapestry JAX-WS Integration
https://github.com/derkoe/tapestry-jaxws

Features:

 * Using Tapestry services as web services
 * JAX-WS API 2.2
 * SOAPLoggingHandler for easy logging of requests/responses
 
I plan to add other JAX-WS supporting web service stacks as CXF.

Usage:
 
You can easily add a contribution to the MetroHttpServletRequestFilter:
 
public static void
contributeMetroHttpServletRequestFilter(OrderedConfiguration
configuration,
TestWebservice testWebservice)
{
configuration.add("testws", new Webservice(TestWebservice.class,
testWebservice, "TestWebservice", "/testws",
new SOAPLoggingHandler("testws")));
}

The Webservice constructor takes the following parameters:

 * the web service class (containing the JAX-WS annotations)
 * the web service instance (or Tapestry service, since this will be a
proxy)
 * the name used in 
 * the URL pattern like "/webservice" or "/ws/myws"
 * and a list of handlers to be added

-- 
Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/ANN-Tapestry-and-JAX-WS-Metro-tp4884925p4884925.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: Page as Ajax return

2011-10-03 Thread derkoe

Henrik Schlanbusch wrote:
> 
> Hi
> 
> Yes I am aware of this one. To describe my problem, I have a rather big 
> framework I would like to rebuild from T4 ->T5. In this framework we use a
> lot 
> of tabbed panes. In T4 we loaded pages into each tab. This made our code 
> cleaner, since we could maintain one tab in one class/page file. My
> impression 
> is that if I start using Zones, I have to implement the zones and their
> markup 
> in one big page. Correct me if I am wrong.
> 
> -Henrik
> 

You have two options:
1. you put your tab contents into components and add them all components to
the tab page. Here, you have the whole power of Tapestry parameters.

2. you keep tab contents on separate pages. With this you lose the power of
parameters and have to hand over parameters to tabs and between tabs via
some threaded context service.
For the page solution you have to put the contents into a block and get the
block into the othere page (like described here by Taha:
http://tawus.wordpress.com/2011/04/20/tapestry-magic-3-plugin-blocks/).
We've coded a small BlockService you can contribute to blocks to and get
them on another page.

-- 
Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Page-as-Ajax-return-tp4864551p4864692.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: Page as Ajax return

2011-10-03 Thread derkoe

Henrik Schlanbusch wrote:
> 
> Hi
> 
> Is it possible to return a page as an ajax result or will this only work
> with 
> zones?
> 
> -Henrik
> 

When you return a page to an AJAX event handler the Tapestry JS will make a
redirect to that page - for more infos see:
http://tapestry.apache.org/ajax-and-zones.html

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Page-as-Ajax-return-tp4864551p4864662.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: Combination of Grid, Submit Button and Context does not work

2011-09-19 Thread derkoe
This seems to be a bug.

Also the JavaDoc of Submit is a bit mileading: "The notification is named
"selected" and has no context" in the class but "The list of values that
will be made available to event handler method of this component when the
form is submitted." on the context parameter.

A solution might be to store the context in ProcessSubmission component
action.

-- 
Chris


Stephan Windmüller wrote:
> 
> Hi!
> 
> About a year ago there was a bug regarding the usage of submit buttons
> with context in loops:
> 
> https://issues.apache.org/jira/browse/TAP5-869
> 
> The bug was closed because using the defer parameter of the submit
> button fixed the problem.
> 
> Now I have the same problem, but this time in a Grid rather than a loop
> component. Defer is set to false but every time I click on a button,
> only the context of the last one is used.
> 
> I created a small example demonstrating the problem, it is attached to
> this e-mail. Try clicking on every user and watch the console output:
> Always the last user is printed.
> 
> Is there a workaround? Is it a known bug or should I file a bug report?
> 
> Regards
>  Stephan
> 


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Combination-of-Grid-Submit-Button-and-Context-does-not-work-tp4813699p4818363.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: [T5.3-beta-6] Not Ready For Production!

2011-09-14 Thread derkoe
What you try doesn't work in 5.2.6 either (and I think it didn't work in any
Tapestry version before). This results in: "Construction of service
'ApplicationDefaults' has failed due to recursion: the service depends on
itself in some way". 

This is quite logical since the SymbolSource needs the contribution to
ApplicationDefaults (since this is where symbols are added) - so you can't
refer to symbols when changing symbols (apart from using expansions
referencing other symbols). Otherwise you could change production-mode while
referencing it.

-- 
Chris 

PS: I think Lenny was laughing about the post title "beta not ready for
production" (that's why it's a beta).


Steve Eynon wrote:
> 
> Yep, looks like you can't inject SymbolSource into your
> ApplicationDefaults contribution method when ProdMode is set to true;
> bit of a pain because I was using it to extract my webapp version for
> setting as the tapestry.app-version.
> 
> I'm not entirely happy with the contribution dependency tree changing
> when changing such an obvious flag - I'm sure others will run into the
> same issue, and probably just as they're going live too!
> 
> Still, as Lenny says, it was bloody funny!
> 
> Cheers,
> 
> Steve.
> 


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-3-beta-6-Not-Ready-For-Production-tp4802640p4803728.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: Run javascript after a zone is updated

2011-09-13 Thread derkoe

Muhammad Gelbana wrote:
> 
> I solved the situation using a workaround. But I still couldn't
> efficiently run javascript when the block zone is updated.
> I tried using the javascriptsupport service but couldn't find a way to
> use it as it needs to be used in the "afterrender" event of the zone
> which i couldn't figure out where to implement !..mixins doesn't work
> with zones !!
> 
> If any of this sounds crazy..it's because I'm new to ajax with tapestry.
> 

In your AJAX event handler just add the script via JavaScriptSupport - this
script will be executed after the zone is updated:

onAjaxEvent()
{
  javaScriptSupport.addScript("alert('Hello')");
}


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Run-javascript-after-a-zone-is-updated-tp4787067p4799165.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: Getting JS conflicts while upgrading tapestry version.

2011-09-12 Thread derkoe

biswanath@gmail.com wrote:
> 
> I am updating the tapestry version from 5.0.18 to 5.2.6.
> 
> 1. How can I disable loading default tapestry js files like
> ...(scriptaculous.js, tapestry-messages.js, tapestry-console.js,
> tapestry-beanvalidator.js, tapestry.js, prototype.js).
> 
> 2. How to fix the JS conflicts as tapestry combines the JS files(like
> JQuery and default ones) even jQuery.noConflict(); also not working ?
> 
> Looking forward to light on these issues.Thanks in advance.
> Biswanath
> 

1. Change Path for Prototype/Scriptaculous:
http://tapestry.apache.org/configuration.html#Configuration-tapestry.scriptaculous
. If you want to override the Tapestry js (not recommended) you can change
undocumented symbol tapestry.default-javascript.

2. It will be a problem if you have two versions of Prototype. But there
should be no problem with combining jQuery and Prototype (with noConflict).

-- 
Chris

PS: you dont' seem to be subscribed in the mailing list - your post is only
on nabble.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Getting-JS-conflicts-while-upgrading-tapestry-version-tp4785038p4795178.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: Run javascript after a zone is updated

2011-09-12 Thread derkoe

Muhammad Gelbana wrote:
> 
> I have a table with many cells being updated using ajax calls. In the
> block returned by the ajax call, I conditionally run some java script
> to style the td and div in which the response is rendered.
> 
> For a reason, this javascript isn't executed well. But I when I run
> the returned script manually on friebug after the cell is rendered, It
> causes the desired effect !!
> May be the dom isn't ready for the script to run ? I'm confused !
> 

I guest that's simply a JavaScript problem - did you solve it? 

Do you add the Script via JavaScriptSupport?

-- 
Chris


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Run-javascript-after-a-zone-is-updated-tp4787067p4795128.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: [T5.x] onException() During Render Phase

2011-09-12 Thread derkoe

Steve Eynon wrote:
> 
> ...it doesn't say "Hello!!!"? Is onException() not called during
> RenderPhase events? And if not, why not!? (It would seem a little
> inconsistent.)
> 
> I wish to throw a couple of bespoke exceptions during onActivate() and
> setupRender() and have then caught and handled by a Mixin that I apply
> to every page. How else may I accomplish this? The exceptions relate
> to IllegalContexts / StaleSessions and the like, so they are real
> problems encountered during the render phase.
> 

As the documentation states
(http://tapestry.apache.org/component-events.html#ComponentEvents-EventMethodExceptions)
exceptions are only allowed in even methods. I think it's no good idea to
throw Exceptions in render phase. 
If you want to handle that anyway you could decorate/replace
RequestExceptionHandler service.

This works (because activate is an evet handler):
public class Whoops
{
void onActivate()
{
throw new RuntimeException("Whoops!");
}

Object onException(Throwable t)
{
System.err.println("Hello!!!");
return true;
}
}


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-x-onException-During-Render-Phase-tp4793110p4795093.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: Localization Problems

2011-09-12 Thread derkoe

Rendy Tapestry wrote:
> 
> Hi Christian,
> 
> Thank you for taking time to help. I try to solve my problem using second
> approach from your suggestion. Creating LocalizationDispatcher and
> register
> it before PageRender. I try to run my application, it seems rendering
> wasn't
> happened (blank page is returned).
> 
> Here is my code snippet.
> 
> public class LocalizationDispatcher implements Dispatcher {
> private final PersistentLocale persistentLocale;
> 
> public LocalizationDispatcher(PersistentLocale persistentLocale) {
> this.persistentLocale = persistentLocale;
> }
> 
> public boolean dispatch(Request request, Response response) throws
> IOException {
> if (!persistentLocale.isSet()) {
> persistentLocale.set(new Locale("in", "ID"));
> }
> 
> return true;
> }
> }
> 

You have to return "false" in the Dispatcher - otherwise Tapestry will think
the request has been handled  and does not continue in the chain.

-- 
Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Localization-Problems-tp4782013p4795034.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: Zone update causes to loose js/css bound to div inside zone

2011-07-13 Thread derkoe

sandeep kale wrote:
> 
> Hi,
> 

To do it like Thiago: Hi!



> I am using zone to reset ordering of rows in my list grid. I reorder the
> rows in the list after clicking on reset button which refreshes zone
> containing list grid. Upto this it's fine. But I have added js to on load
> of document to set the class of rows in the list to a css class through
> javascript call. But this binding is lost when zone refreshes my list
> grid.
> 
> Please suggest me the solution either to rebind to listgrid after zone
> update or not to lose binding after zone update.
> 

Just add a JavaScript to the zone that calls the same javascript method that
is executed on load of document. This should update your row classes.

-- 
Chris


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Zone-update-causes-to-loose-js-css-bound-to-div-inside-zone-tp4579141p4584041.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