Re: Non trivial example application?

2007-06-11 Thread robinson wang

i want a copy to learn , would you please send it to me ,thank you


Re: dojo dialog render issue

2007-06-11 Thread Paul Stanton

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

how's 4.1.2 coming?



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



bean declared already exception

2007-06-11 Thread Warner Onstine

I'm still seeing this issue when I'm trying to convert from 4.0.2 up
to 4.1.2. Here's my issue:

I have a Login component that declares a bean

@Bean(EventsValidationDelegate.class)
   public abstract IValidationDelegate getValidationDelegate();

And on the NewEvent page where the Login component is included I also
have a validation delegate declared:
@Bean(EventsValidationDelegate.class)
   public abstract IValidationDelegate getValidationDelegate();

When I try and visit this page I get this error:

Error: An error occured processing annotation
@org.apache.tapestry.annotations.Bean(value=class
com.sourcebeat.tap101.components.errors.EventsValidationDelegate,
lifecycle=REQUEST, initializer=) of public abstract
org.apache.tapestry.valid.IValidationDelegate
com.sourcebeat.tap101.components.Login.getValidationDelegate(): Bean
validationDelegate has already been declared (at Annotation
@org.apache.tapestry.annotations.Bean(value=class
com.sourcebeat.tap101.components.errors.EventsValidationDelegate,
lifecycle=REQUEST, initializer=) of public abstract
org.apache.tapestry.valid.IValidationDelegate
com.sourcebeat.tap101.components.Login.getValidationDelegate()).

This appears to be the same error that was fixed in 4.1.1 -
http://issues.apache.org/jira/browse/TAPESTRY-848

Thanks for the help. Let me know if you want me to attach any pages,  
or reopen the bug.


-warner

Warner Onstine - Programmer/Author
New book on Tapestry 4!
Tapestry 101 available at http://sourcebeat.com/books/tapestrylive.html
[EMAIL PROTECTED]
http://warneronstine.com/blog




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



T5 encoding issue

2007-06-11 Thread Martin Grotzke
Hi,

I have currently an encoding issue, but am not really sure what's
the reason for this.

I have an url that contains a url encoded german umlaut (ü) in UTF-8
and looks like the following:

http://localhost:8080/app/search/%C3%BCbel (the %C3%BC represents the ü
in UTF-8, this url is created by
componentResources.createPageLink( "search", new Object[]{ _query } )
in the submit method of the search page)

Now, when I look in the onActivate(string) method, the string is not
"übel" but it's "?bel", both printed via logging as when I inspect the
variable during debugging.

AFAICS the created url from the page link is correct in terms of utf-8
encoding, but the parsed query string seems to be wrong, as it contains
only the "?"...

We have the following in our AppModule:

public void contributeRequestHandler(
OrderedConfiguration configuration,
@InjectService("TimingFilter")
final RequestFilter filter, @InjectService("Utf8Filter")
final RequestFilter utf8Filter ) {
configuration.add( "Timing", filter );
configuration.add( "Utf8Filter", utf8Filter ); // handle UTF-8
}

public RequestFilter buildUtf8Filter(
@InjectService("RequestGlobals")
final RequestGlobals requestGlobals ) {
return new RequestFilter() {
public boolean service( Request request, Response response, 
RequestHandler handler ) throws IOException {
requestGlobals.getHTTPServletRequest().setCharacterEncoding( 
"UTF-8" );
return handler.service( request, response );
}
};
}

public static PageResponseRenderer decoratePageResponseRenderer(
@InjectService("PageMarkupRenderer")
final PageMarkupRenderer markupRenderer,
@InjectService("MarkupWriterFactory")
final MarkupWriterFactory markupWriterFactory, final Object 
delegate ) {

return new PageResponseRenderer() {
public void renderPageResponse( Page page, Response response )
throws IOException {
MarkupWriter writer = markupWriterFactory.newMarkupWriter();
markupRenderer.renderPageMarkup( page, writer );
PrintWriter pw = response
.getPrintWriter( "text/html; charset=UTF-8" );
writer.toMarkup( pw );
pw.flush();
}
};
}

Is there anything wrong, or what am I missing?

Thanx && cheers,
Martin




signature.asc
Description: This is a digitally signed message part


Re: About component 'loop' usage in T5.0.4

2007-06-11 Thread Daniel Jue

Wait for the Tapestry-PaddleShifter library?

I think the politeness is just lost in translation.  I can relate with
my in-laws. :-)

On 6/11/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:

"I really like this Ferarri, but I don't like to drive stick.  What do I do?"

On 6/11/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
> Stick with T4.1?
>
> On 6/9/07, Allen Guo <[EMAIL PROTECTED]> wrote:
> > Can anybody give some suggestion?
> >
> > Allen Guo 写道:
> > > Hi All,
> > >
> > > If I use loop component in html template like this
> > > 
> > > ${_sort.name}
> > > 
> > >
> > > I have to define the property in corresponding page class like this
> > > public class SortList {
> > > .
> > > private Sort sort;
> > > private List sorts;
> > > public Sort getSort() {
> > > return sort;
> > > }
> > >
> > > public void setSort(Sort sort) {
> > > this.sort = sort;
> > > }
> > > .
> > > }
> > > It seems that the 'sort' must be defined in page class. It's so 
terrible.:(
> > > If I can remove the property 'sort' from page class like T4.1, it will
> > > be great.
> > >
> > >
> > > Thanks
> > > Allen Guo
> > >
> > >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Howard M. Lewis Ship
> TWD Consulting, Inc.
> Independent J2EE / Open-Source Java Consultant
> Creator and PMC Chair, Apache Tapestry
> Creator, Apache HiveMind
>
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
>


--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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




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



Re: About component 'loop' usage in T5.0.4

2007-06-11 Thread Massimo Lusetti

On 6/11/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:


"I really like this Ferarri, but I don't like to drive stick.  What do I do?"


Very nice comparison! And it fits well...

--
Massimo
http://meridio.blogspot.com

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



Re: About component 'loop' usage in T5.0.4

2007-06-11 Thread Howard Lewis Ship

"I really like this Ferarri, but I don't like to drive stick.  What do I do?"

On 6/11/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:

Stick with T4.1?

On 6/9/07, Allen Guo <[EMAIL PROTECTED]> wrote:
> Can anybody give some suggestion?
>
> Allen Guo 写道:
> > Hi All,
> >
> > If I use loop component in html template like this
> > 
> > ${_sort.name}
> > 
> >
> > I have to define the property in corresponding page class like this
> > public class SortList {
> > .
> > private Sort sort;
> > private List sorts;
> > public Sort getSort() {
> > return sort;
> > }
> >
> > public void setSort(Sort sort) {
> > this.sort = sort;
> > }
> > .
> > }
> > It seems that the 'sort' must be defined in page class. It's so terrible.:(
> > If I can remove the property 'sort' from page class like T4.1, it will
> > be great.
> >
> >
> > Thanks
> > Allen Guo
> >
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com




--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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



Re: About component 'loop' usage in T5.0.4

2007-06-11 Thread Howard Lewis Ship

Stick with T4.1?

On 6/9/07, Allen Guo <[EMAIL PROTECTED]> wrote:

Can anybody give some suggestion?

Allen Guo 写道:
> Hi All,
>
> If I use loop component in html template like this
> 
> ${_sort.name}
> 
>
> I have to define the property in corresponding page class like this
> public class SortList {
> .
> private Sort sort;
> private List sorts;
> public Sort getSort() {
> return sort;
> }
>
> public void setSort(Sort sort) {
> this.sort = sort;
> }
> .
> }
> It seems that the 'sort' must be defined in page class. It's so terrible.:(
> If I can remove the property 'sort' from page class like T4.1, it will
> be great.
>
>
> Thanks
> Allen Guo
>
>


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





--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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



RE: Converting T3 to T4 issues

2007-06-11 Thread Robert J. Walker
1. The method getRequestContext() is undefined for the type IRequestCycle.

The RequestContext doesn't exist anymore. Now we have the Infrastructure 
object. Also, in order to support portlets, the Infrastructure object doesn't 
give you HttpServletRequest or HttpServletResponse objects, but instead give 
you a custom object called WebRequest and WebResponse. If you want a reference 
to the actual HttpServletRequest, you can inject it into the page. With 
Tapestry annotations, that's done like this:

@InjectObject("service:tapestry.globals.HttpServletRequest")
public abstract HttpServletRequest getRequest();

I'm not sure how to get a reference to the Servlet or ServletConfig, but I'm 
reasonably certain that it would be in a similar manner.

2. The method getServiceParameters() is undefined for the type IRequestCycle

IRequestCycle.getServiceParameters() is now 
IRequestCycle.getListenerParameters().

3. The method getObject(Class) in the type IBinding is not applicable
   for the arguments (String, Class)

Retrieval of values from Ibinding objects has been simpllified; you now just 
call getObject(), or getObject(Class) if you want to perform an assignability 
check. So yeah, calling .getObject(Browser.class) should work just fine.

5. (What happened to 4? :))org.apache.tapestry.event.PageRenderListener; is not 
used in TP4
   what should I use here?

PageRenderListener was split into PageBeginRenderListener and 
PageEndRenderListener.


The information is kind of spread around, so I can understand that it's a bit 
hard to find, but there are several pages to look to for this kind of help. 
Here are some I found useful:

User's Guide:
http://tapestry.apache.org/tapestry4.1/usersguide/index.html

Component Reference:
http://tapestry.apache.org/tapestry4.1/components/index.html

Tapestry Wiki:
http://wiki.apache.org/tapestry/

JavaDocs:
http://tapestry.apache.org/tapestry4.1/apidocs/index.html


Robert J. Walker


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



Re: Portlet - custom Exception page

2007-06-11 Thread Miguel Angel Hernández

I think that the way to go on this, is adding a contribution to
tapestry.InfraestructureOverrides in your hivemodule.xml:


   
   

cheers,

miguel

On 5/31/07, Petras Martin, Centire <[EMAIL PROTECTED]> wrote:


 Hi all,

I am trying to change the default Exception page in my portlet
application.

My files (only the most important):
context/WEB-INF/myApplication.application
context/WEB-INF/hivemodule.xml
context/WEB-INF/myPortlet/myPortlet.application
context/WEB-INF/myPortlet/hivemodule.xml

1. As I know, the simplest way is to create Exception.page and
Exception.html in context/WEB-INF/. But that works fine only when running
in standard application context. However, it does not work when running in
portlet container.

2. I tried to change the Exception page. So I added

to myApplication.application and myPortlet.application. Also did not work.

3. I tried to add



to all hivemodule.xml files. I also specified MyException as

in *.application files. Still did not work.

None of the three ways worked. Tapestry always displayed the default
Exception page.

Can anyone help?


 --

*Martin Petras*

Java Developer Senior



*C**entire, s.r.o.*

Zahradnicka 72

821 08  Bratislava

Slovak republic

phone  +421 2 5010 9800

fax+421 2 5010 9888

*www.centire.com* 



* Help save paper - do you need to print this email?


  This message contains information that may be privileged or confidential
and is the property of the S&K Management Systems s.r.o. It is intended
only for the person to whom it is addressed. If you are not the intended
recipient, you are not authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies of this message. The S&K Management Systems s.r.o. cannot accept
liability for any loss or damage caused to recipient using of both this
message content or appendix. Tato sprava obsahuje informacie, ktore mozu byt
dolezite alebo doverne a ako take su vlastnictvom spolocnosti S&K Management
Systems s.r.o. Sprava je urcena len adresovanym osobam. Ak nie ste touto
osobou, nemate pravo spravu, ani jej casti ci prilohy, citat, vytlacit,
uchovavat, kopirovat, sirit, distribuovat alebo vyuzivat inym sposobom. V
pripade, ze ste spravu obdrzali omylom alebo vdaka chybe, upozornite prosim
bez vahania odosielatela a vymazte vsetky kopie spravy. Spolocnost S&K
Management Systems s.r.o. nenesie zodpovednost za akekolvek straty alebo
skody sposobene prijemcovi vyuzitim obsahu alebo priloh tejto spravy.
- To
unsubscribe, e-mail: [EMAIL PROTECTED] For additional
commands, e-mail: [EMAIL PROTECTED]


Re: how to implement hivemind.Startup function in T5?

2007-06-11 Thread Otho

Thank you very much! That was it.
Just one more catch: Injecting the Services like I did doesn't work with
@EagerLoad. One needs to either cache them by providing a module constructor
or inject them at the method parameters as described here:
http://tapestry.apache.org/tapestry5/tapestry-ioc/module.html#Caching%20Services
Regards,
Otho

2007/6/11, Davor Hrg <[EMAIL PROTECTED]>:


you missed it just sligtly,

anotating your Impl works if you use "bind"

here, because you are constructing th Impl tapestry is not
checking out annotations on it.
you have to annotate you build Method
extract from doc:
---
Eager Loading Services
Services are normally created only as needed (per the scope discussion
above).
This can be tweaked slightly; by adding the EagerLoad annotation to the
service builder method,
...


put:
@EagerLoad
public MyInterface buildMyInterface(final Log log)
{
   log.debug("Creating service MyInterface");
   return new MyInterfaceImpl(springService);
}



On 6/11/07, Otho <[EMAIL PROTECTED]> wrote:
>
> Any hints as to how that exactly works?
>
> I wrote a service interface,
>
> public interface MyInterface
> {
> }
>
> implemented it and annotated it with @EagerLoad
>
> @EagerLoad
> public class MyInterfaceImpl implemets MyInterface
> {
> public MyInterfaceImpl(SpringService springService)
> {
> doSomeStuff(springService);
> }
>
> private void doSomeStuff(SpringService springService);
> }
>
> and in the app module wrote:
>
> @Inject
> @Service("SpringService")
> private SpringService springService; //will be reused in other services
>
> public MyInterface buildMyInterface(final Log log)
> {
> log.debug("Creating service MyInterface");
> return new MyInterfaceImpl(springService); <=
> }
>
>
> Still... when debugging with Tomcat the buildMyInterface method isn't
> executed, in contrast to all other methods (like the example timing
filter
> from the archetype). I am a bit lost at that.
>
> Regards,
> Otho
>



Re: how to implement hivemind.Startup function in T5?

2007-06-11 Thread Davor Hrg

you missed it just sligtly,

anotating your Impl works if you use "bind"

here, because you are constructing th Impl tapestry is not
checking out annotations on it.
you have to annotate you build Method
extract from doc:
---
Eager Loading Services
Services are normally created only as needed (per the scope discussion
above).
This can be tweaked slightly; by adding the EagerLoad annotation to the
service builder method,
...


put:
@EagerLoad
public MyInterface buildMyInterface(final Log log)
{
  log.debug("Creating service MyInterface");
  return new MyInterfaceImpl(springService);
}



On 6/11/07, Otho <[EMAIL PROTECTED]> wrote:


Any hints as to how that exactly works?

I wrote a service interface,

public interface MyInterface
{
}

implemented it and annotated it with @EagerLoad

@EagerLoad
public class MyInterfaceImpl implemets MyInterface
{
public MyInterfaceImpl(SpringService springService)
{
doSomeStuff(springService);
}

private void doSomeStuff(SpringService springService);
}

and in the app module wrote:

@Inject
@Service("SpringService")
private SpringService springService; //will be reused in other services

public MyInterface buildMyInterface(final Log log)
{
log.debug("Creating service MyInterface");
return new MyInterfaceImpl(springService); <=
}


Still... when debugging with Tomcat the buildMyInterface method isn't
executed, in contrast to all other methods (like the example timing filter
from the archetype). I am a bit lost at that.

Regards,
Otho



Re: how to implement hivemind.Startup function in T5?

2007-06-11 Thread Otho

Any hints as to how that exactly works?

I wrote a service interface,

public interface MyInterface
{
}

implemented it and annotated it with @EagerLoad

@EagerLoad
public class MyInterfaceImpl implemets MyInterface
{
   public MyInterfaceImpl(SpringService springService)
   {
   doSomeStuff(springService);
   }

   private void doSomeStuff(SpringService springService);
}

and in the app module wrote:

@Inject
@Service("SpringService")
private SpringService springService; //will be reused in other services

public MyInterface buildMyInterface(final Log log)
{
   log.debug("Creating service MyInterface");
   return new MyInterfaceImpl(springService); <=
}


Still... when debugging with Tomcat the buildMyInterface method isn't
executed, in contrast to all other methods (like the example timing filter
from the archetype). I am a bit lost at that.

Regards,
Otho


how to get column index of contrib:table during iteration

2007-06-11 Thread Ken nashua

Folks,

I am using contrib table... and need to operate off of the current column 
index.


Is there a way to get this?



			jwcid="[EMAIL PROTECTED]" value="ognl:object[linkProperty]"/>







Instead of this...
   descriptor="ognl:descriptor"
I would like to do this...
   descriptor="ognl:descriptors[currentColumn]"

Best regards
Ken in nashua

_
Get a preview of Live Earth, the hottest event this summer - only on MSN 
http://liveearth.msn.com?source=msntaglineliveearthhm



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



Re: Refreshing a dojo Dialog on submit

2007-06-11 Thread Stephane Decleire

We are using Tap4.1.1

Christian Dutaret a écrit :

What version are you using? I had issues with refreshing the content of a
Dialog through XHR requests. That's actually what motivated the move to
4.1.2

2007/6/8, Stephane Decleire <[EMAIL PROTECTED]>:


My submit is async but nothing happens.
I've tried to force the refresh with
cycle.getResponseBuilder().updateComponent(getClientId());
Same result ... The component is not refreshed.

Any idea ?

Stephane

Christian Dutaret a écrit :
> If your submit is async, just specify your form component id (or any
> component you want refreshed on submit) in the updateComponents
> attribute of
> the @Form.
>
> 2007/6/7, Stephane Decleire <[EMAIL PROTECTED]>:
>>
>> Hi,
>>
>> I've got a signon form in a dojo Dialog box.
>> Is there a way to refresh the content of the Dialog box in order to
show
>> authentication errors when the submit button is fired ?
>>
>> Thanks in advance.
>>
>> Stephane
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>

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






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



Re: T5 tab-like component

2007-06-11 Thread Erik Vullings

Thanks Kris, for the great explanation!!! It also thaught me the use of the
delegate and block components. I've taken the liberty to add your example to
the T5 Wiki (attributed to you, of course),
http://wiki.apache.org/tapestry/Tapestry5HowToCreateATabPanel. If you see
any mistakes, please feel free to correct them (or point them out to me)...

Cheers
Erik


On 6/11/07, Kristian Marinkovic <[EMAIL PROTECTED]> wrote:


Hi Erik,

in T5 its very easy to create a tab component.
Just create a component for every tab you have.
Then add a Delegate to the page that should
display the tab and bind the "to" parameter of
the Delegate to a method. This method then returns
the respective tab component

example code:

template:

tab1
tab2

   
   


java class:

// dont forget getter methods
@Component private Tab tab1_link
@Component private Tab tab2_link

// because of redirect
@Persist("flash") private int selectedComponent;

public void onActionFromTab1_link()  { selectedComponent = 1;}
public void onActionFromTab2_link()  { selectedComponent = 2;}

public Object selectedTab() {
   if(selectedComponent == 1)
   return tab1;
   if(selectedComponent == 2)
   return tab2;
   return tab1;
}

g,
kris




"Erik Vullings" <[EMAIL PROTECTED]>
10.06.2007 11:54
Bitte antworten an
"Tapestry users" 


An
"Tapestry users" 
Kopie

Thema
T5 tab-like component






Hi all,

Since there does not seem to be a T5 tab component, should I use the Dojo
one? Furthermore, what's the best way to use it for offering multiple
views
on the same object. For example, when choosing a user in a list, I would
like to use a tab-like view to show business details, personal details,
etc.
However, I would like to separate the development of these views as much
as
possible, and would prefer not to put everything in one view/page, i.e. I
would prefer not to create one page, and have something like
Generate tab 1 content
Generate tab 2 content
etc.

What would be the best way to achieve this separation of concern?

Thanks
Erik




Re: how to use Grid component

2007-06-11 Thread Eugene Lozovan


"-   how do I select columns to not show all of the classes properties
and how do
I set labels different from the getter methods?"



You can use either  @NonVisual annotation for a setter or grid's "model"
attribute (
http://tapestry.apache.org/tapestry5/tapestry-core/guide/beaneditform.html)
:


... some code here
   

   void pageLoaded()
 {
   _model = _beanModelSource.create(TUser.class, true, _resources);
   _model.remove("password");
 }

As for labels - it might be possible to use . properies file like
src\main\resources\org\example\myapp\pages\PageClassName.properties:

userName-label= Login name
firstName-label= First name

Here is a very simple T5 application, just a couple of pages with
screencasts examples -   http://www.box.net/shared/jk4blh9chu , Home page
uses Grid.

E.L.

On 11/06/07, Thomas Beckmann <[EMAIL PROTECTED]> wrote:


Hi,

we want to use Grid component but I can't find any example code.
Current issues are:
-   how do I select columns to not show all of the classes properties
and how do
I set labels different from the getter methods?
-   how do I connect paging with paging on database level (in our case
it's
hibernate)?

Many thanks in advance

Thomas

--
Thomas Beckmann
Dipl.-Math.

freiheit.com technologies gmbh
Straßenbahnring 22 / 20251 Hamburg, Germany
fon   +49 (0)40 / 890584-0
fax   +49 (0)40 / 890584-20
HRB Hamburg 70814

DB48 4B15 11BA 9268 B74B  64A0 48AE 80AB C86A 46A3
Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof

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




Re: how to use Grid component

2007-06-11 Thread Erik Vullings

Hi Thomas,

Have a look at Howard's screencasts, esp. #5, for an introduction (
http://tapestry.apache.org/tapestry5/screencast.html)

- In case you need to hide properties, the @NonVisual annotation should do
the trick (before the property declaration).
- Different labels: I haven't tried it with the Grid component, but for the
BeanEditForm, setting the beaneditform.properties did the trick, e.g. prop
firstName --> firstName-label=Vorname (btw, these can be localized if you
use beaneditform_de.properties too). In the beaneditform screencast, an
example is given by Howard too.

I can't help you on the 3rd issue, though.

Cheers
Erik



On 6/11/07, Thomas Beckmann <[EMAIL PROTECTED]> wrote:


Hi,

we want to use Grid component but I can't find any example code.
Current issues are:
-   how do I select columns to not show all of the classes properties
and how do
   I set labels different from the getter methods?
-   how do I connect paging with paging on database level (in our case
it's
   hibernate)?

Many thanks in advance

Thomas

--
Thomas Beckmann
Dipl.-Math.

freiheit.com technologies gmbh
Straßenbahnring 22 / 20251 Hamburg, Germany
fon   +49 (0)40 / 890584-0
fax   +49 (0)40 / 890584-20
HRB Hamburg 70814

DB48 4B15 11BA 9268 B74B  64A0 48AE 80AB C86A 46A3
Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof

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




Form Validation

2007-06-11 Thread petros

I have a problem with the following code. 

When the form is submitted my form displays a message advising if the email
is valid or not. 
When the message is displayed I start another browser and I access the same
page. The message
is still displayed the first time the "second" user accesses this page. I
solved the problem by having the caller of UserDetails to call
setFeedbackMessage("") but I am not happy with this approach. 

Is there a better approach for both feedbackMessage and formUserDetails ?
~~ UserDetails.html ~~~

   ${feedbackMessage}
 


~~ UserDetails.java ~~~
@Persist("flash")
private String feedbackMessage = null;
@Component
private Form formUserDetails;

Object onSuccessFromFormUserDetails(){
   if (!isValid(getEmail())){
formUserDetails.recordError("InvalidEmail");
   }else{
   feedbackMessage = "Valid Email";
}
}

 AppModule.java ~~~
public void contributeApplicationDefaults(MappedConfiguration configuration) {
configuration.add("tapestry.persistence-strategy", "flash");

}   
~~
-- 
View this message in context: 
http://www.nabble.com/Form-Validation-tf3900603.html#a11057776
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



RE: T5 included javascript libraries

2007-06-11 Thread Martin Grotzke
On Mon, 2007-06-11 at 11:25 +0200, Martin Grotzke wrote:
> Thanx for this explanation, Adam!
> 
> I just set clientValidation to false for my form, however, the js files
> are added to body. Is it somehow possible to tell T5 not to add
> these libraries (or scriptaculous.js) to the body?
Ouuups, sorry, my fault! There was still another form in our layout
template that didn't have the clientValidation="false" - now I've set
this and js libs are added to the body - really cool!

Thanx for your help,
cheers,
Martin


> 
> Otherwise, as a very ugly hack, it should be possible to replace the
> js files by empty ones, as long as we're using none of them...
> What do I have to add to the configuration in
> contributeApplicationDefaults to specify the
> "js/empty/scriptaculous.js"? Or where do I find documentation concerning
> this question?
> 
> Thanx a lot,
> cheers,
> Martin
> 
> 
> On Mon, 2007-06-11 at 01:39 -0700, Adam Ayres wrote:
> > >From what I can tell only the Form component uses prototype and
> > scriptaculous when the clientValidation parameter is set to true (which
> > is the default).  The tapestry.js that is added as part of the Form
> > component uses some of the element and event helper methods from
> > prototype and some of the effects from scriptaculous.
> > 
> > The way the scriptaculous library works is that when the base
> > scriptaculous.js is included in a page all of the various files for the
> > library (builder, controls, dragdrop, etc) are dynamically added as
> > additional script tags within the body of the HTML, no matter if the
> > individual components are used or not.  This has the negative side
> > effect of making the rendered page code ugly (and difficult to
> > troubleshoot in firebug) as well as creating 5 additional server
> > requests.
> > 
> > I would suggest replacing the default prototype and scriptaculous
> > libraries with a minified (and compressed) version:
> > 
> > http://groups.google.com/group/prototype-core/browse_thread/thread/40e58
> > 15f5bc5fba9
> > 
> > http://protoculous.wikeo.be/
> > 
> > Currently using one of these solutions that combines prototype and
> > scriptaculous is not possible with the Form component since it wants to
> > add a separate file for both prototype and scriptaculous.  However
> > adding compressed versions for each works.
> > 
> > Adam
> > 
> > 
> > -Original Message-
> > From: Martin Grotzke [mailto:[EMAIL PROTECTED] 
> > Sent: Monday, June 11, 2007 1:02 AM
> > To: Tapestry users
> > Subject: Re: T5 included javascript libraries
> > 
> > Are these js files used at all? I ask as they increase loading time
> > and I'd like to remove them if they're not used...
> > 
> > However, wait 5 days and I'll ask how to start with ajax in T5 ;)
> > 
> > Cheers,
> > Martin
> > 
> > 
> > On Sun, 2007-06-10 at 23:50 -0700, Howard Lewis Ship wrote:
> > > You have some control, via contributions to the ApplicationDefaults
> > > service configuration, over where the files come from, so you can use
> > > a different version of prototype & scriptaculous than the ones
> > > provided with Tapestry.  However, we have yet to take a crack at an
> > > abstraction layer that would allow you to replace p&s with some other
> > > similar library, such as Dojo.
> > > 
> > > On 6/10/07, Martin Grotzke <[EMAIL PROTECTED]> wrote:
> > > > Hi,
> > > >
> > > > T5 adds several js libraries to the body, e.g. prototype.js,
> > > > scriptaculous.js and others.
> > > >
> > > > Are they all required, or is there a possibility to affect
> > > > which libs are added to the body?
> > > >
> > > > Thx && cheers,
> > > > Martin
> > > >
> > > >
> > > >
> > > >
> > > 
> > > 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


how to use Grid component

2007-06-11 Thread Thomas Beckmann
Hi,

we want to use Grid component but I can't find any example code.
Current issues are:
-   how do I select columns to not show all of the classes properties and 
how do
I set labels different from the getter methods?
-   how do I connect paging with paging on database level (in our case it's
hibernate)?

Many thanks in advance

Thomas

-- 
Thomas Beckmann
Dipl.-Math.

freiheit.com technologies gmbh
Straßenbahnring 22 / 20251 Hamburg, Germany
fon   +49 (0)40 / 890584-0
fax   +49 (0)40 / 890584-20
HRB Hamburg 70814

DB48 4B15 11BA 9268 B74B  64A0 48AE 80AB C86A 46A3
Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof

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



Re: T5 Invoke ValidationTracker recordError with elementName instead of Field

2007-06-11 Thread Martin Grotzke
Hi Howard,

On Sat, 2007-06-09 at 22:44 +0200, Martin Grotzke wrote:
> Does this enable us to use hibernate validator in our business layer
> that is completely independent from tapestry?
> Hibernate validator is right now our favorite option for validation,
> but it might be that we have to use an own implementation - we're still
> evaluating.
> 
> What we're sure about is that in the business layer validation is
> performed and that for each validation error details are provided
> that should allow the presentation layer to map this information
> to a specific field/element.
> 
> IMHO a good solution for this use case is recording the error with
> the element name, without being forced to have a Field for each
> element.
> 
> What do you think?
Do you have any comments/feedback concerning this?

Thanx && cheers,
Martin


> 
> Cheers,
> Martin
> 
> 
> 
> On Sat, 2007-06-09 at 12:48 -0700, Howard Lewis Ship wrote:
> > That's true ... though I expect to make Tapestry smarter about
> > recognizing the Hibernate annotations and producing automatic client-
> > and server-side validation for them.
> > 
> > On 6/9/07, Martin Grotzke <[EMAIL PROTECTED]> wrote:
> > > We want to do validation in the business layer (with hibernate
> > > validator) and get back an exception with a list of invalid values,
> > > where each invalid value provides the property path.
> > >
> > > Then we want to have a mapping of the property path to the element
> > > name and record an error for this on the tapestry form.
> > >
> > > The value is to be able to use hibernate validator in our business
> > > layer and not to be forced to define each Field in the page class,
> > > which is better in terms of performance and saves unnecessary work.
> > >
> > > Cheers,
> > > Martin
> > >
> > >
> > > On Sat, 2007-06-09 at 10:07 -0700, Howard Lewis Ship wrote:
> > > > I don't see the value ... how would you obtain the element name
> > > > without getting the field itself; and if you've injected the field (to
> > > > invoke getElementName() ), then why wouldn't you just pass the field
> > > > to the tracker?
> > > >
> > > > Convince me there's something actually missing.
> > > >
> > > > On 6/9/07, Martin Grotzke <[EMAIL PROTECTED]> wrote:
> > > > > Hello,
> > > > >
> > > > > right now there's a recordError(Field,String) method for storing
> > > > > errors for elements of the page.
> > > > >
> > > > > We would like to have also a method recordError(String,String) where
> > > > > the first parameter is the element name.
> > > > >
> > > > > The ValidationTrackerImpl seems to use only the elementName of the
> > > > > Field:
> > > > >
> > > > > private FieldTracker get(Field field)
> > > > > {
> > > > > String key = field.getElementName();
> > > > >
> > > > > refreshFieldToTracker();
> > > > >
> > > > > FieldTracker result = InternalUtils.get(_fieldToTracker, key);
> > > > >
> > > > > if (result == null)
> > > > > result = new FieldTracker(key);
> > > > >
> > > > > return result;
> > > > > }
> > > > >
> > > > > so an additional method seems to be not a big issue.
> > > > >
> > > > > Would this be possible to add to T5? Shall we submit a patch for this
> > > > > here in the list or enter an issue?
> > > > >
> > > > > Thanx && cheers,
> > > > > Martin
> > > > >
> > > > >
> > > > > --
> > > > > Martin Grotzke
> > > > > Dipl.-Inf.
> > > > >
> > > > > freiheit.com technologies gmbh
> > > > > Straßenbahnring 22 / 20251 Hamburg, Germany
> > > > > fon   +49 (0)40 / 890584-0
> > > > > fax   +49 (0)40 / 890584-20
> > > > > HRB Hamburg 70814
> > > > >
> > > > > eb0e 645c 9730 c8a3 ee2f  1b9a 5de5 21cb c259 fe34
> > > > > Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof
> > > > >
> > > > >
> > > >
> > > >
> > > --
> > > Martin Grotzke
> > > http://www.javakaffee.de/blog/
> > >
> > >
> > 
> > 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: Fwd: How to load a image dynamically in tapestry5.0.4

2007-06-11 Thread petros

I am using the approach suggested by Howard below in conjunction with the
UploadedFile component and JAI to upload an image and re-scale it before
saving it into the database. My code is provided below

This may not be very relevant to many T5 users but I thought of sharing my
code anyway. 

Petros
#
UserDetails.html



#
UserDetails.java

@Persist
protected UploadedFile uploadedFileCmpnt;

@Inject
private ComponentResources cmpntResources;  
private InputStream imageFileInputStream = null;

public void pageDetached()
{
try
{
imageFileInputStream.close();
if(uploadedFileCmpnt != null)
{
uploadedFileCmpnt.getStream().close();
}
} catch (IOException e)
{
// TODO Log an error
e.printStackTrace();
}
}

public Object onImage(long productId) throws IOException
{
imageFileInputStream = new ByteArrayInputStream(
   
getUser().getUserProfileImages().getImageFileAsBytesScaledThumb());

return createStreamResponse(imageFileInputStream);
}

private StreamResponse createStreamResponse(final InputStream is)
{
return new StreamResponse()
{
public String getContentType()
{
return "img/jpeg";
}
public InputStream getStream() throws IOException
{
return is;
}
};
}

public Link getUserImageURL() throws IOException
{
return cmpntResources.createActionLink("image", false, 0);
}


Object onSuccessFromFormUserDetails()
{
if(uploadedFileCmpnt != null)
{
 getAndScaleUserImage(uploadedFileCmpnt);
}
userManager.saveUser(getUser());
}

protected void getAndScaleUserImage(UploadedFile uploadedFileCmpnt) 
throws
IOException
{
byte[] imageAsByteArrayNotScaled =
StreamUtils.getBytesArrayFromInputStream(uploadedFileCmpnt.getStream());

byte[] imageAsByteArrayCompressedMain =
ImageUtils.getScaledImageByteArray(500, 0, imageAsByteArrayNotScaled);

byte[] imageAsByteArrayCompressedThumb =
ImageUtils.getScaledImageByteArray(200, 0, imageAsByteArrayNotScaled);


getUser().setImageFileAsBytesScaledThumb(imageAsByteArrayCompressedThumb);

getUser().setImageFileAsBytesScaledMain(imageAsByteArrayCompressedMain);
getUser().setImageFileName(uploadedFileCmpnt.getFileName());

}

##
ImageUtils.java
public static byte[] getScaledImageByteArray(int newWidthInPixels, int
newHeightInPixels, byte[] unscaledImageAsByteArray) throws IOException
{
InputStream unscaledImageInputStream = new
ByteArrayInputStream(unscaledImageAsByteArray);

SeekableStream seakableStream =
ByteArraySeekableStream.wrapInputStream(unscaledImageInputStream, true);
RenderedOp objImage = JAI.create("stream", seakableStream);

float xScale = (float)newWidthInPixels / objImage.getWidth();
float yScale = (float)newHeightInPixels / objImage.getHeight();

if(xScale == 0){xScale = yScale;}
if(yScale == 0){yScale = xScale;}

ParameterBlock pb = new ParameterBlock();
pb.addSource(objImage); // The source image
pb.add(xScale); // The xScale
pb.add(yScale); // The yScale
pb.add(0.0F); // The x translation
pb.add(0.0F); // The y translation
pb.add(new InterpolationNearest()); // The interpolation 

objImage = JAI.create("scale", pb, null);
BufferedImage bufferedScaledImage = 
objImage.getAsBufferedImage();

ByteArrayOutputStream scaledImageAsByteArrayOutputStream = new
ByteArrayOutputStream();
ImageIO.write(bufferedScaledImage, "jpeg",
scaledImageAsByteArrayOutputStream);


byte[] scaledImageAsByteArray =
scaledImageAsByteArrayOutputStream.toByteArray();

scaledImageAsByteArrayOutputStream.close();
unscaledImageInputStream.close();

return scaledImageAs

Re: How can I use javascript in html template with TP5.0.4

2007-06-11 Thread Jiri Mares

Hi,

why not to use CDATA section:





Jirka

Allen Guo napsal(a):
> Hi All,
> 
> I use javascript in my html template file like this.
> 15

RE: T5 included javascript libraries

2007-06-11 Thread Martin Grotzke
Thanx for this explanation, Adam!

I just set clientValidation to false for my form, however, the js files
are added to body. Is it somehow possible to tell T5 not to add
these libraries (or scriptaculous.js) to the body?

Otherwise, as a very ugly hack, it should be possible to replace the
js files by empty ones, as long as we're using none of them...
What do I have to add to the configuration in
contributeApplicationDefaults to specify the
"js/empty/scriptaculous.js"? Or where do I find documentation concerning
this question?

Thanx a lot,
cheers,
Martin


On Mon, 2007-06-11 at 01:39 -0700, Adam Ayres wrote:
> >From what I can tell only the Form component uses prototype and
> scriptaculous when the clientValidation parameter is set to true (which
> is the default).  The tapestry.js that is added as part of the Form
> component uses some of the element and event helper methods from
> prototype and some of the effects from scriptaculous.
> 
> The way the scriptaculous library works is that when the base
> scriptaculous.js is included in a page all of the various files for the
> library (builder, controls, dragdrop, etc) are dynamically added as
> additional script tags within the body of the HTML, no matter if the
> individual components are used or not.  This has the negative side
> effect of making the rendered page code ugly (and difficult to
> troubleshoot in firebug) as well as creating 5 additional server
> requests.
> 
> I would suggest replacing the default prototype and scriptaculous
> libraries with a minified (and compressed) version:
> 
> http://groups.google.com/group/prototype-core/browse_thread/thread/40e58
> 15f5bc5fba9
> 
> http://protoculous.wikeo.be/
> 
> Currently using one of these solutions that combines prototype and
> scriptaculous is not possible with the Form component since it wants to
> add a separate file for both prototype and scriptaculous.  However
> adding compressed versions for each works.
> 
> Adam
> 
> 
> -Original Message-
> From: Martin Grotzke [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 11, 2007 1:02 AM
> To: Tapestry users
> Subject: Re: T5 included javascript libraries
> 
> Are these js files used at all? I ask as they increase loading time
> and I'd like to remove them if they're not used...
> 
> However, wait 5 days and I'll ask how to start with ajax in T5 ;)
> 
> Cheers,
> Martin
> 
> 
> On Sun, 2007-06-10 at 23:50 -0700, Howard Lewis Ship wrote:
> > You have some control, via contributions to the ApplicationDefaults
> > service configuration, over where the files come from, so you can use
> > a different version of prototype & scriptaculous than the ones
> > provided with Tapestry.  However, we have yet to take a crack at an
> > abstraction layer that would allow you to replace p&s with some other
> > similar library, such as Dojo.
> > 
> > On 6/10/07, Martin Grotzke <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > > T5 adds several js libraries to the body, e.g. prototype.js,
> > > scriptaculous.js and others.
> > >
> > > Are they all required, or is there a possibility to affect
> > > which libs are added to the body?
> > >
> > > Thx && cheers,
> > > Martin
> > >
> > >
> > >
> > >
> > 
> > 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5: inherited @Parameter's in component classes

2007-06-11 Thread Martin Dietze
Hi,

On Fri, June 08, 2007, Martin Dietze wrote:

>  I tried to inherit some compoment classes from an abstract
> component base class which contains some propeties the above
> share. In the template I would then use these components like
> this:
> 
>   
> 
> In the base class I have:
> 
>   @Parameter
>   private String _myCommonParam;
> 
>   public String getMyCommonParam() { return _myCommonParam; }
>   public void setMyCommonParam(myCommonParam) { _myCommonParam = 
> myCommonParam; } 
> 
> However it seems like the member variable in the base class 
> never gets touched, the getters and setters not used.

 I forgot to mention that putting the above code directly
into my component class works flawlessly, it only seems like
the @Parameter does not survive inheritance...

Cheers,

Martin

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
Es gibt Themen genug in Deinem eigenen Leben, und wenn sie einmal ausgehn,
gibt es Themenlaeden.  -- Die Sterne

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



Re: how to implement hivemind.Startup function in T5?

2007-06-11 Thread Davor Hrg

Why not use EagerLoad
it was in Hivemind, and it exists in T5 as well...

http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html
look for "eager load"

Davor Hrg

On 6/11/07, Otho <[EMAIL PROTECTED]> wrote:


Hi all!
I have the same problem [T5] of initializing the database at startup and
tried it with contribution like this:

In my MyAppModule I added

public void

contributeApplicationInitializer(OrderedConfiguration
configuration)
{
configuration.add("myApp.applicationIitializer", new
MyAppInitializer());
}

with MyAppInitializer implementing the ApplicationInitializer interface.
Unfortunately that seems to be wrong, since the app is never entering the
initializeApplication method.

Any tips as to how to get that right?

Regards,
Otho




2007/5/29, Renat Zubairov <[EMAIL PROTECTED]>:
>
> I assume the similar to 4.0 way - via ApplicationInitializer
>
>
>
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ApplicationInitializer.java?view=markup
>
> And
>
>
>
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ApplicationInitializerFilter.java?view=markup
>
> Renat
>
> On 29/05/07, Jun Tsai <[EMAIL PROTECTED]> wrote:
> > In T4,I often use hivemind.Startup to initialize my application data.
> > Which contribution configuration as same function in t5?
> >
> > thanks.
> >
> > Jun Tsai
> >
> > ps:I don't want to override the tapestry filter.
> >
> >
> >
> > --
> > Welcome to China Java Users Group(CNJUG).
> > http://cnjug.dev.java.net
> >
>
>
> --
> Best regards,
> Renat Zubairov
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



RE: T5 included javascript libraries

2007-06-11 Thread Adam Ayres
>From what I can tell only the Form component uses prototype and
scriptaculous when the clientValidation parameter is set to true (which
is the default).  The tapestry.js that is added as part of the Form
component uses some of the element and event helper methods from
prototype and some of the effects from scriptaculous.

The way the scriptaculous library works is that when the base
scriptaculous.js is included in a page all of the various files for the
library (builder, controls, dragdrop, etc) are dynamically added as
additional script tags within the body of the HTML, no matter if the
individual components are used or not.  This has the negative side
effect of making the rendered page code ugly (and difficult to
troubleshoot in firebug) as well as creating 5 additional server
requests.

I would suggest replacing the default prototype and scriptaculous
libraries with a minified (and compressed) version:

http://groups.google.com/group/prototype-core/browse_thread/thread/40e58
15f5bc5fba9

http://protoculous.wikeo.be/

Currently using one of these solutions that combines prototype and
scriptaculous is not possible with the Form component since it wants to
add a separate file for both prototype and scriptaculous.  However
adding compressed versions for each works.

Adam


-Original Message-
From: Martin Grotzke [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 11, 2007 1:02 AM
To: Tapestry users
Subject: Re: T5 included javascript libraries

Are these js files used at all? I ask as they increase loading time
and I'd like to remove them if they're not used...

However, wait 5 days and I'll ask how to start with ajax in T5 ;)

Cheers,
Martin


On Sun, 2007-06-10 at 23:50 -0700, Howard Lewis Ship wrote:
> You have some control, via contributions to the ApplicationDefaults
> service configuration, over where the files come from, so you can use
> a different version of prototype & scriptaculous than the ones
> provided with Tapestry.  However, we have yet to take a crack at an
> abstraction layer that would allow you to replace p&s with some other
> similar library, such as Dojo.
> 
> On 6/10/07, Martin Grotzke <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > T5 adds several js libraries to the body, e.g. prototype.js,
> > scriptaculous.js and others.
> >
> > Are they all required, or is there a possibility to affect
> > which libs are added to the body?
> >
> > Thx && cheers,
> > Martin
> >
> >
> >
> >
> 
> 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/

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



Re: how to implement hivemind.Startup function in T5?

2007-06-11 Thread Otho

Hi all!
I have the same problem [T5] of initializing the database at startup and
tried it with contribution like this:

In my MyAppModule I added

public void
contributeApplicationInitializer(OrderedConfiguration
configuration)
{
   configuration.add("myApp.applicationIitializer", new
MyAppInitializer());
}

with MyAppInitializer implementing the ApplicationInitializer interface.
Unfortunately that seems to be wrong, since the app is never entering the
initializeApplication method.

Any tips as to how to get that right?

Regards,
Otho




2007/5/29, Renat Zubairov <[EMAIL PROTECTED]>:


I assume the similar to 4.0 way - via ApplicationInitializer


http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ApplicationInitializer.java?view=markup

And


http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ApplicationInitializerFilter.java?view=markup

Renat

On 29/05/07, Jun Tsai <[EMAIL PROTECTED]> wrote:
> In T4,I often use hivemind.Startup to initialize my application data.
> Which contribution configuration as same function in t5?
>
> thanks.
>
> Jun Tsai
>
> ps:I don't want to override the tapestry filter.
>
>
>
> --
> Welcome to China Java Users Group(CNJUG).
> http://cnjug.dev.java.net
>


--
Best regards,
Renat Zubairov

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




Re: T5 included javascript libraries

2007-06-11 Thread Martin Grotzke
Are these js files used at all? I ask as they increase loading time
and I'd like to remove them if they're not used...

However, wait 5 days and I'll ask how to start with ajax in T5 ;)

Cheers,
Martin


On Sun, 2007-06-10 at 23:50 -0700, Howard Lewis Ship wrote:
> You have some control, via contributions to the ApplicationDefaults
> service configuration, over where the files come from, so you can use
> a different version of prototype & scriptaculous than the ones
> provided with Tapestry.  However, we have yet to take a crack at an
> abstraction layer that would allow you to replace p&s with some other
> similar library, such as Dojo.
> 
> On 6/10/07, Martin Grotzke <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > T5 adds several js libraries to the body, e.g. prototype.js,
> > scriptaculous.js and others.
> >
> > Are they all required, or is there a possibility to affect
> > which libs are added to the body?
> >
> > Thx && cheers,
> > Martin
> >
> >
> >
> >
> 
> 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part