Antwort: Eating the dog food: experiences with T5 so far

2008-05-29 Thread Christian Koeberl
Hi Dan!

>  * We have an internal t5-based library (or 3 actually) that aids in
> building CMS and other administrative applications. One library 
> provides super-slick Lucene integration for Hibernate entities.

We're just looking through Lucene to use it in our T5/Hibernate apps. 
We're just examining Hibernate Search (http://search.hibernate.org/) which 
looks quite good for us (I've got a small demo running with it). Maybe you 
could share some of the ideas/concepts/experiences in your Lucene 
integration.

Thanks,
Chris

Re: How to Localize persistent Objects

2008-05-28 Thread Christian Koeberl
There are two good practices to do database i18n:
http://www.theserverside.com/tt/blogs/showblog.tss?id=HibernateInternational
http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/i18n/i18n5.html

We do quite the same with just one table for all texts.

Cheers,
Chris

Antwort: Re: T5 Activation/Passivation - strangeness

2008-04-28 Thread Christian Koeberl
> Jan Vissers <[EMAIL PROTECTED]> wrote:
> Our layout component has:
> 

If you have this in your code the browser will request 
"/yourpage/favicon.ico" or "mypackage/mypage/favicon.ico". Tapestry treats 
"favicon.ico" as an activation context. I think you have a 
onActivate(Long) in your page. So, Tapestry tries to coerce favicon.ico to 
a long which fails. 

Maybe you should try:


-- 
Chris

Antwort: Re: How to 'bypass' client side validation - when 'Cancel' is pressed.

2008-04-18 Thread Christian Koeberl
> However when I come back to the form - the respective fields are (still)
> marked as erroneous. Any way around that?
This is related to this issue: 
https://issues.apache.org/jira/browse/TAPESTRY-2354
I think this is fixed in the trunk - or at least you can specify the 
persistence scope of the ValidationTracker.

A workaround for older versions is described here:
http://www.nabble.com/Writing-an-FAQ-for-Tapestry-5-tt15719185.html#a15732836

> Using this script - indeed skips client side validation.
I would rather use an ActionLink or PageLink and style it or use the 
Button component form T5Components 
(http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/components/Button.html).

-- 
Chris

Re: Accessing a containing component parameter from within a 'child' component

2008-04-14 Thread Christian Koeberl
> inherit: binding - however this doesn't work for me.
That should work.

With the inherit keyword you can forward parameters to sub-components, 
like this example of a zebra Grid component:

public class MyGrid
{
@Parameter(required = true)
private GridDataSource source;

@Parameter
private BeanModel model;

@Parameter(defaultPrefix = TapestryConstants.
LITERAL_BINDING_PREFIX)
private String reorder;

@Component(inheritInformalParameters = true, parameters =
{ "rowClass=cycle:odd,even", "source=inherit:source",
"model=inherit:model", "reorder=inherit:reorder" })
private Grid grid;
}

-- 
Chris

Re: [FAQ] common design

2008-03-10 Thread Christian Koeberl
Robert Zeigler wrote:
> "the code works": Nope, it doesn't.

Now, it's getting interesting! This is what I get, when I try your code:




If t:container replaces $content$, this shouldn't render

 This is the only thing that should render if t:container replaces 
$content$. 


Very strange, isn't it?

When I have this Start.tml:
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

myapp Start Page






Then I get:




myapp Start Page

 This is the only thing that should render if t:container replaces 
$content$. 


Looks quite good to me.

I use Tapestry 5.0.10 on Windows JDK 5 with Jetty 5.1.14, I started with a 
clean archetype generated app and added the SampleComonent and changed 
Start.tml.

-- 
Chris

Re: [FAQ] common design

2008-03-05 Thread Christian Koeberl
> will render the  tags (outside the ) every time the 
> component is used (in another component, in my case).
I just tried this out with 5.0.10 - with my test it doesn't render the 
 tags.

> I checked in jumpstart 3.3.3 as well, and it has the same problem (see 
BasicCustomComponent).
I don't understand what this has to do with BasicCustomComponent!?

Here's my code which doesn't render the tags:
TestComponent.tml (in components):

http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
 ${page}



TestComponent.java (in components):
public class TestComponent
{
@Parameter
private String page;
@Parameter
private String accessKey; 
@Parameter
private String title;
@Parameter
private String cssClass;
// getters
}

Start.tml (in pages):
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
http://www.w3.org/1999/xhtml"; 
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
 
Test


Test




Start.java (in pages):
public class Start
{
@Component(parameters = {"page=literal:Start", 
"accessKey=literal:a", "title=literal:Hello", "cssClass=literal:x"})
private TestComponent testComponent;
}

Produces this output:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
http://www.w3.org/1999/xhtml";>

  

Test




Test


Start




-- 
Chris

Re: T5: Grid's rowClass

2008-03-03 Thread Christian Koeberl
You can override and extend Grid like this:

package com.poi.egh.turntable.ui.components;

/**
 * Grid component to be used in ProjectX.
 * 
 * Provides the following extensions to the Tapestry TurntableGrid:
 * 
 * class="odd" for all odd rows
 * 
 * 
 * @author Christian Köberl
 */
public class ProjectXGrid extends 
org.apache.tapestry.corelib.components.Grid
{
private int rowIndex = 1;

@Override
public String getRowClass()
{
return rowIndex++ % 2 != 0 ? "odd" : "";
}
}

-- 
Chris

Re: [FAQ] common design

2008-02-29 Thread Christian Koeberl
> Jesper Zedlitz <[EMAIL PROTECTED]> wrote
> This is the T4 feature:
> <
http://tapestry.apache.org/tapestry4/UsersGuide/template.html#template.directives.content
>
> 
> Is something like this possible with T5?

The replacement of $content$ is the t:container construct (see 
https://issues.apache.org/jira/browse/TAPESTRY-1469).
So, you could write:


This is a test


http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>





T5 only renders the contents in the container, the stuff around is ignored 
(works since 5.0.6).

There is no real replacement of $remove$ but there are some options:
- use t:block around content to be removed
- write a custom component Remove which returns false in beginRender. You 
could use it like: . Maybe Howard will write 
some kind of stuff (or take your comonent if you add it to a JIRA).

-- 
Chris

Abwesenheit/Out of office

2007-09-26 Thread Christian Koeberl

Ich werde ab  26.09.2007 nicht im Büro sein. Ich kehre zurück am
27.09.2007.

Bitte kontaktieren Sie in dringenden Fällen das Porsche Informatik Customer
Care Center:
http://www.porsche-informatik.at/sup_kontakt.htm
oder per Web:
http://support.porscheinformatik.at/

Grüße,
Christian Köberl


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Abwesenheit/Out of office

2007-09-23 Thread Christian Koeberl

Ich werde ab  23.09.2007 nicht im Büro sein. Ich kehre zurück am
26.09.2007.

Bitte kontaktieren Sie in dringenden Fällen das Porsche Informatik Customer
Care Center:
http://www.porsche-informatik.at/sup_kontakt.htm
oder per Web:
http://support.porscheinformatik.at/

Grüße,
Christian Köberl


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: UploadedFile componet is not compatible with UTF-8

2007-09-18 Thread Christian Koeberl
> After packaging new package, but occur NullPointer Exception:
> because request.getCharacterEncoding() == null

You also have to add the UTF-8 filter described in 
http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding

-- 
Chris

Antwort: T5: UploadedFile componet is not compatible with UTF-8

2007-09-17 Thread Christian Koeberl
> Is this a bug of UploadFile or I should change the code?
This is a bug, see: https://issues.apache.org/jira/browse/TAPESTRY-1723

You can checkout the code, apply the patch and build your own 
tapestry-upload.jar

-- 
Chris

Re: [5.0.6-SNAPSHOT] Bug? isTraceEnabled missing when I switch to slf4j

2007-09-12 Thread Christian Koeberl
> followup.  Strange thing is - looking at the actuall log4j.Logger - it 
> has an isTraceEnabled, so I'm really unclear as to why this would 
> happen.
The problem is the log4j lib in the Jetty ext directory - replace it with 
the newer log4j (1.2.12 or higher) version.

-- 
Chris

[T5] Validator JavaScript problem with clientValidation=false

2007-09-07 Thread Christian Koeberl
Hello!

Has anybody ever tried to set "clientValidation=false" in a form with 
validators?

The T5 validators still generate the validation JavaScript but the form 
does not inlude the required JS-libs. This leads to an JS error on the 
client side.
This script is generated with clientValidation=false:




I looked around in the validators and it seems that they do not know if 
clientValidation is enabled or not - they just render the JS code with 
PageRenderSupport#addScript.

Anyone the same problems? Has anyone a workaround for this?

-- 
Chris

Re: T5: using DOJO?

2007-09-04 Thread Christian Koeberl
Hello T5 developers!

As everybody likes to have a different JavaScript Framework for Ajax use, 
it's probably
the best to make that flexible as Kristian suggested in:
https://issues.apache.org/jira/browse/TAPESTRY-1650

I think of something like tapestry-upload - you can use it or you can 
build you own upload
component based on another framework (there are some: 
http://www.jguru.com/faq/view.jsp?EID=160).

In Tapestry4 the Dojo integration was too tight - you couldn't actually 
use another JS framework
for partial page rendering. If your project was using another framework 
you ended up having
both in the script-section.

It would feel really Tapestry5ish if the default just works but you could 
change most of the
behaviour by implementing some lines of code. 

Cheers,
Chris

Re: Re: [T5]Encoding Problem while submiting form with a Upload component.

2007-08-28 Thread Christian Koeberl
> Not everyone is using tapestry-upload and not everyone is using fancy
> file names and tapestry-upload module is the younger in T5 space so...
> anyway you´re is indeed a good catch so propably will be evaluated.

It's not the file name. The problem is: as soon as you add a upload 
component to a form all other text fields (in the same form) are not 
decoded with the request encoding. 
So, you cannot have text fields and an upload in one form (with UTF-8
encoding).

Cheers,
Chris

Re: [T5]Encoding Problem while submiting form with a Upload component.

2007-08-28 Thread Christian Koeberl
> I have a form with a 'textfield' and a 'upload' field .
> The Chinese words I input in textfield will be irrecognizable  when I 
> submit the form .

I wondered, why nobody found this bug before. Anyway, I filed the
bug yesterday and provided a fix.

https://issues.apache.org/jira/browse/TAPESTRY-1723

You can easyily apply the fix and generate your own tapestry-upload jar
or wait until one of the committers applies the patch.

-- 
Chris

Antwort: T5: trying out tutorial hi/lo game, but...

2007-08-22 Thread Christian Koeberl
Angelo Chen <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm learning by trying out the hi/lo game, everytime I clicked one of 
the
> number links, the onActionFromLink was not called, here is the template:

It should be onActionFromGuess because the link's id is "guess".

-- 
Chris 

Re: T5 Type to ValueEncoderFactory

2007-08-14 Thread Christian Koeberl
Tapestry just supports a ValueEncoder for String and Enum. If you want 
additional
encoders you have to implement them yourself:

class LongValueEncoder implements ValueEncoder
{
public String toClient(Long value)
{
return value == null ? "" : value.toString();
}

public Long toValue(String clientValue)
{
try
{
return new Long(clientValue);
}
catch (NumberFormatException e)
{
return null;
}
}
}

To use the encoder either add them to your AppModule:

public static void contributeValueEncoderSource(
MappedConfiguration configuration)
{
configuration.add(Long.class, new 
GenericValueEncoderFactory(new LongValueEncoder()));
} 

or add the encoder directly to your RadioGroup (or Select) components (see 

http://tapestry.apache.org/tapestry5/tapestry-core/component-parameters.html)

See:
http://issues.apache.org/jira/browse/TAPESTRY-1598

-- 
Chris

Antwort: Re: [T5] Why is default ValidationTracker in Form marked Persist not Persist("flash")

2007-08-04 Thread Christian Koeberl
> Could you give us an example of how to accomplish this?What we did is to extend the Form component with a flash-persist defaultTracker. We're using our Form component everywhere:public class Form extends org.apache.tapestry.corelib.components.Form{    @Persist("flash")    private ValidationTracker defaultTracker;    @Override    public ValidationTracker getDefaultTracker()    {        if (defaultTracker == null)            defaultTracker = new ValidationTrackerImpl();    return defaultTracker;    }    @Override    public void setDefaultTracker(ValidationTracker defaultTracker)    {        this.defaultTracker = defaultTracker;    }}
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Antwort: Re: [T5] Why is default ValidationTracker in Form marked Persist not Persist("flash")

2007-08-04 Thread Christian Koeberl
> By making it @Persist (i.e. with default), then the container (i.e., your> page) can set a @Meta to control the default persistence of components below> it.  Thus, if you want the default to be "flash", you're in luck.So, you think every page in every T5 app in the world should override the default persistence to "flash"? I don't think that's good - Tapestry should have reasonable defaults. Most of the newbies will have big problems with the defaultTracker to be in the session - most will think T5 has a bug because it does not clear form errors on leaving the page.If somebody wants some other behaviour, he/she could still set another tracker parameter to the form. > Or, you can inject the Form component, it has methods that overlap>ValidationDelegate for clearing errors & etc. (it just delegates to>its ValidationDelegate).I don't think dealing with clearing errors manually on page-leave should be the concern of the "normal" programmer - the framework should do this at reasonable points (with the option to clear them manually).-- Chris
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[T5] Why is default ValidationTracker in Form marked Persist not Persist("flash")

2007-08-03 Thread Christian Koeberl
Hi!

I was wondering why the "_defaultTracker" in the Form component is marked
as @Persist not as @Persist("flash").

In my opinion it should be @Persist("flash")!!

Persisting the ValidationTracker in the session leads to some (usually) 
not wanted
behaviour: the validation is not reset, even though a new object is edited 
with that form.

Here is an example:

Assume you have a page with a form and a TextField. I disabled client 
validation to
see the problem:

@SuppressWarnings("unused")
@Component(parameters = "clientValidation = false")
private Form mainForm;

@SuppressWarnings("unused")
@Component(parameters =
{ "value = name", "label = literal:Name", "validate = required, 
maxlength=20" })
private TextField nameField;

private String name;
// getters and setters

When you try to save the form the ValidationTracker tracks the error and 
the error
is displayed to the user. So far, so good.
Next, the user triggers a PageLink ("Cancel edit") to another page. There 
the user 
selects another name and is forwarded to the page with the form again, the 
new name 
is set with setName("xxx"). The form still displays the error and the old 
value of the
previously edited name.

-- 
Chris