Re: dojo dialog to populate portion of form and submit

2007-05-31 Thread Miguel Angel Hernández

The trick is that the dialog its always inside the Form, as a hidden part of
the dom i,e: visibility='hidden':
div
   id=ognl:contenedorId
   jwcid=@Any
   style=position:absolute;visibility:hidden;z-index: 555
   
   span jwcid=@RenderBody/
/div

Whenever I need such dialog to show(and render or populate its bindings) I
update the @Any component,
and change the visibility and position via javascript (it has to be done
with js to paint it right).

regards,

Miguel

On 5/30/07, Paul Stanton [EMAIL PROTECTED] wrote:


how did you handle population of the dialog form portion?

Miguel Angel Hernández wrote:
 Hi Paul I've been in a very similar situation(but in tap4 with tacos)
 you're in. To solve it I decided to implement my own Dialog component
 which
 can be contained inside a form, and this worked fine for me. I've
 controlled
 the show and hide issue with Javascript and css. So the component its
 always
 rendered. I'll post the code if you are interested.


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




Re: Lehky_SPAM: Re: T5 Decoupling a Template From its Component Class

2007-05-31 Thread Jiri Mares

Hi Howard,

I would like to ask, whether there is still possibility to have localized 
templates?

eg.

org/example/myapp/components/CClamp.html
org/example/myapp/components/CClamp_en.html
org/example/myapp/components/CClamp_en_US.html
org/example/myapp/components/CClamp_de.html

Thanks

Howard Lewis Ship napsal(a):
 There are internal services that can be overridden to handle those kinds of
 situations.
 
 The goal is to create something that works amazingly well for all the more
 typical cases, then start going after these others.  Often it will involve
 moving a private interface out into the public space ... but once that's
 done, its very hard to change the interface in the future without breaking
 backwards compatibility, so we're pretty conservative about pulling back
 the
 curtain until we know the interface is full and complete.
 
 On 5/30/07, David Kendall [EMAIL PROTECTED] wrote:

 I am a Tapestry newbie getting up to speed on Tap 5. I am working on an
 application with extensive co-branding requirements.

 As I understand things, there is - by default - a tight coupling between
 a component class name and its template path. For example - if a
 component has a FQCN of...

 org.example.myapp.components.CClamp

 ...then the template has to be on the classpath as

 org/example/myapp/components/CClamp.html

 It would be very helpful if the mapping between the component and the
 template could be decoupled - this would allow me to pull in component
 templates that have been tweaked for a particular co-brand.

 For example - I might want to have a template on the class path as

 org/example/myapp/override/cobrand1/components/CClamp.html

 Is there any way to do this?

 Thanks in advance.

 David Kendall




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


 
 

-- 
Jiří Mareš (mailto:[EMAIL PROTECTED])
ČSAD SVT Praha, s.r.o. (http://www.svt.cz)
Czech Republic

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



Re: T5: when is @Persist necessary and when not...

2007-05-31 Thread Martin Dietze
On Wed, May 30, 2007, Howard Lewis Ship wrote:

 On 5/30/07, Martin Dietze  [EMAIL PROTECTED] wrote:

[...]

   For all these I have getters and setters defined.
   
   In my page class I have a constructor like this:
   
   | public CreatePartner() {
   |   _contact = new Person();
  ^^^ `person' of course!
   | }

[...]

 Just noticed your constructor. Don't do that.
 
 The Person object that you create will become the default value for this
 property, rather than null.  This is documented.

This is strange. If the _person member variable gets reset to
the default at the end of each request I would expect not to
see the values from it on my page after submit in the render
request.

What I want to achieve is very much the same scenario found in
the documentation section Form Input and Validation, only I
have several compound objects like `Person'. Since the form
accesses members of these objects they need to be created in
the page class. Since the constructor is obviously not the
right place for this, which one would you suggest?

Cheers,

Martin

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
Was ist ein Cluster?
Wenn vier Bratscher unisono spielen.

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



Re: URGENT: T4.1.1 on Oracle OC4J 9.0.4, 10.1.2.xxx - Missing classpath resource '/dojo' issue

2007-05-31 Thread Jan Vissers
Just to give you an update...

I managed to work around this issue using a hacked version of
org.apache.hivemind.util.ClasspathResource. Since I already had to hack
another part of Hivemind in order for 'it' to work on
OC4J9.0.4/10.1.2.x.x, I thought it best to centralize these 'hacks'.

public Resource getLocalization(Locale locale){
  String path = getPath();

  //hack
  String localizedPath = null;
  Locale pathLocale = null;

  //hack
  if( path.equals(/tapestry/) || path.equals(/dojo/) ) {
  localizedPath = path;
  pathLocale = null;
  } else {
  LocalizedResourceFinder finder
 = new LocalizedResourceFinder(_resolver);
  LocalizedResource localizedResource
 = finder.resolve(path, locale);

  if (localizedResource == null)
  return null;

  localizedPath = localizedResource.getResourcePath();
  pathLocale = localizedResource.getResourceLocale();
  }


  if (localizedPath == null)
return null;

  if (path.equals(localizedPath))
return this;

  return new ClasspathResource(_resolver, localizedPath, pathLocale);
}


Just, hoping this will be the end of it.

-J.

 Hi,

 Thanks for your suggestion. I am wondering whether a custom
 AjaxShellDelegate will effectively change the fact that the getResource()
 to dojoPath and tapestryPath are called - as this is what causing me
 problems at the moment.

 Or to put in other words - will this be sufficient to make the problem go
 away, or do I need to actually hack the hivemind code that performs te
 getResource()?

 -J.


 You can make the Shell use a custom AjaxShellDelegate, here's the
 default
 implementation

 http://svn.apache.org/viewvc/tapestry/tapestry4/tags/4.1.1/tapestry-framework/src/java/org/apache/tapestry/dojo/AjaxShellDelegate.java?view=markup

 btw, i'd go for the 4.1.2 version

 On 5/30/07, Jan Vissers [EMAIL PROTECTED] wrote:

 Okay - this might sound stupid...

 It looks like this problem occurs when getResource() needs to get
 'directories' within a library. More specifically in the Shell
 component:


 http://svn.apache.org/viewvc/tapestry/tapestry4/tags/4.1.1/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc?view=markup

 asset name=defaultDojoPath path=classpath:/dojo/ /
 asset name=defaultTapestryPath path=classpath:/tapestry/ /

 When these assets are the only ones of their kind in the Tapestry
 framework, couldn't I create a custom Shell component that declares
 these
 assets in some other way?

 Still hoping I can use 4.1.1 - that's why I'm not ready to give up yet.

 -J.

  Good luck. ;)
 
  p.s. You can always just switch to software not written by bad
 programmers
  -
  like jboss or something.  It must work reasonably well if it's good
 enough
  for google.
 
  On 5/30/07, Jan Vissers [EMAIL PROTECTED] wrote:
 
  snipped/
 
  I'm thinking about filing a service request/bug with Oracle, but
 don't
  think it'll make an impression on them.
 
  -J.
  snipped/
 
 
 
 
  --
  Jesse Kuhnert
  Tapestry/Dojo team member/developer
 
  Open source based consulting work centered around
  dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
 



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




 --
 Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
 Tapestry / Tacos developer
 Open Source / JEE Consulting




 -
 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]



very very interesting

2007-05-31 Thread Andrea Chiumenti

http://www.sitepen.com/blog/2007/05/30/google-gears-dojo-offline-and-sitepen/

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



T5: select using a wrapped enum

2007-05-31 Thread Martin Dietze
Hi,

 I created a selectmodel based on a enum wrapped by a generic
wrapper and using a generic value encoder.

By this I intend to simplify creating select inputs consisting of
something like please select and  followed by the enum's
entries which are the only valid inputs for the select.

The code seems to work well, I the select options are created
properly and show up in the form, also selected values are 
delivered after submit. However when rendering the result page
the previously submitted option is not selected.

I wonder whether my code is not OK or do I have to insert some
code on my own to get the last choice selected in the result
page?

Cheers,

Martin

--- snip -

Here is my code:

The selectmodel:

|  public final class SalutationSelectModel extends AbstractSelectModel {
|  private final Messages _msgs;
|
|  public SalutationSelectModel(final Messages msgs) {
|_msgs = msgs;
|  }
|
|  public ListOptionGroupModel getOptionGroups() {
|return null;
|  }
|  public ListOptionModel getOptions() {
|final ListOptionModel result = new ArrayListOptionModel();
|
|// Add please select... entry and disabled --...
|result.add(new OptionModelImpl(_msgs.get(select_pleaseSelect),
|  false, null, new String[0]));
|result.add(new OptionModelImpl(_msgs.get( select_separator),
|  true, new CommonSelectViewSalutation(null), new String[0]));
|
|for(Salutation salut : Salutation.values()) {
|  result.add(new OptionModelImpl(_msgs.get(salutation_ + salut.name()),
|  false, new CommonSelectViewSalutation(salut), new String[0]));
|}
|
|return result;
|  }
|}

The enum:

| public enum Salutation {
|   MR,
|   MRS;
| }

The generic enum wrapper:

| public class CommonSelectViewM {
|   private final M _model;
|   public CommonSelectView(M model) {
| _model = model;
|   }
|   public M getModel() {
| return _model;
|   }
| }

The generic value encoder lets me differenciate between
invalid inputs (like please select) and disabled ones so
that I do not get more than one selected=selected when
the page is displayed for the first time:

| ValueEncoderM extends EnumM implements ValueEncoderCommonSelectViewM {
| 
|   private ClassM _cls;
|   public CommonValueEncoder(ClassM cls) {
| _cls = cls;
|   }
| 
|   public String toClient(CommonSelectViewM value) {
| if (value == null) {
|   return null;
| } else if (value.getModel() == null) {
| return disabled;
| }
| return value.getModel().name();
|   }
| 
|   public CommonSelectViewM toValue(String clientValue) {
| if (null.equals( clientValue) || disabled.equals(clientValue)) {
|   return null;
| }
| M m = Enum.valueOf(_cls, clientValue);
| return new CommonSelectViewM(m);
|   }
| }

All this is used in this page class:

| public class CreatePartner {
|   @Inject
|   private Messages _messages;
|   @Component
|   private Form _form;
|   @Persist
|   private CommonSelectViewSalutation _contactSalutation;
| 
|   private static ValueEncoderCommonSelectViewSalutation
| _salutationValueEncoder = new 
CommonValueEncoderSalutation(Salutation.class);
|   private SelectModel _salutationModel;
| 
|   public CreatePartner() {
| _salutationModel = new SalutationSelectModel( _messages );
|   }
| 
|   @OnEvent(value=submit)
|   public void submit() {
| _form.recordError(Submit received: 
|   + (_contactSalutation != null? _contactSalutation.getModel() : null));
|   }
| 
|   public SelectModel getSalutationModel() {
| return _salutationModel;
|   }
| 
|   public ValueEncoderCommonSelectViewSalutation 
getSalutationValueEncoder() {
| return _salutationValueEncoder;
|   }
| 
| 
|   public CommonSelectViewSalutation getContactSalutation() {
| return _contactSalutation;
|   }
| 
|   public void setContactSalutation(CommonSelectViewSalutation 
contactSalutation) {
| _contactSalutation = contactSalutation;
|   }
| 
| }

Finally, in the form I have this entry for the select:

| select name=salutation id=salutation tabindex=10
|   t:type=select
|   t:id=salutation
|   t:encoder=salutationValueEncoder
|   t:model=salutationModel
|   t:validate=required
|   t:value=contactSalutation
|   
|   option selected=selectedbitte wählen.../option
|   option disabled=disabled---/option
|   optionHerr/option
|   optionFrau/option
| /select

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
* Free Speech Online!!! Support the Blue Ribbon Campaign! *

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



custom js validator T4.0

2007-05-31 Thread Viktor Matić

 Hi,

I have problem with js validator, which looks like:

Tapestry.validate_basket_qty = function(event, fieldId, min, message)
{
var o = this.find(fieldId);
var value = o.value;

if (value == ) return;

if (Number(value)  min  Number(value) != 0 )
  event.invalid_field(field, message)
}

as it can be seen it is similar to Tapestry min validator with minor  
change (it accepts 0). Script
is placed in our package and it is used by custom validator render  
method which extends BaseValidator.


Page renders correctly and above function is called on form submit,  
but for some reason


event.invalid_field(field, message)

fails to do the job. Page submits which should not happen. After it  
is submitted server side validation

fires.

Regards,

Viktor Matic




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



T5: Inject Entities into Page component

2007-05-31 Thread Joshua Jackson

Dear all,

Would it be possible to Inject Entities into my Page component to be
used for Hibernate, so I don't have to write get and set for setting
and getting the value of my object in my Page component?

So I can just write as such:
public void onAction(){
 session.save(myobj)
}

inside my action handler without having to set the value of myobj
manually in the code but instead the value is automatically injected
from the value of HTML form.

I used tapestry-hibernate module for setting up the Session and Session Factory.


Thanks for the help

--
YM!: thejavafreak
Blog: http://www.nagasakti.or.id/roller/joshua/

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



dynamic component injection

2007-05-31 Thread Andrea Chiumenti

Hello I'd like to konw if in Tap 4.1.2 there is a way do dynamically
render components inside a page.

If yes, how ?

regards,
kiuma

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



Re: Detecting Tapestry version

2007-05-31 Thread Geoff Callender

Thanks.

On 30/05/2007, at 11:44 PM, Jesse Kuhnert wrote:

Looking at the javascriptdoc (like javadoc for javascript) linked  
to from

here:

http://tapestry.apache.org/tapestry4.1/javascript/index.html

http://tapestry.apache.org/tapestry4.1/jsdoc/index.html

You can find that the tapestry.version property is a global javascript
reference to the current version of the tapestry client side  
library you are

using in string form.

Not sure about the java side.  I think there is a static utility  
method for

that off of Tapestry or TapestryUtils.

On 5/30/07, Geoff Callender [EMAIL PROTECTED] wrote:


What's a simple way in javascript to tell if you're running with 4.0
vs 4.1?
And how would you do it in Java?

Geoff

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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com



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



T5: Using my own localization backend

2007-05-31 Thread Martin Dietze
Hi,

 I need to use a particular localization backend for my
project. As I understand, T5 provides its own code for
retrieving messages based on the .properties files, and if
I understand Howard's posting from Mar 4 right, simply
plugging in my own ComponentMessageSource implementation
is not yet supported.

Would it make any sense trying to circumvent T5's message
facilities and implement my own which I could access by a
different prefix, i.e. msg:, or is this complete nonsense?

Cheers,

Martin

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
manche meinen, lechts und rinks kann man nicht velwechsern.
werch ein illtum!  -- elnst jandr

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



Moving T4 to T5 broke Acegi

2007-05-31 Thread petros

I had the attached entries in my acegi configuration and I also had the
following Tapestry pages
Login, Start, AccessDenied

Moving to T5 I removed the html extensions from acegi config and everything
works fine except the accessDenniedHandler

I am getting a 404 error when acegi forwards me to context/AccessDenied
However, typing context/AccessDenied in the URL and pressing enter works
fine. 

I initially thought that was an Acegi problem but now I am almost certain is
a T5 problem.

Any ideas?

Petros

bean id=authenticationProcessingFilter
class=org.acegisecurity.ui.webapp.AuthenticationProcessingFilter
property name=authenticationManager ref=authenticationManager/
property name=authenticationFailureUrl
value=/Login.html?error=true/
property name=defaultTargetUrl value=/Start.html/
property name=filterProcessesUrl value=/j_security_check/
property name=rememberMeServices ref=rememberMeServices/
/bean

bean id=exceptionTranslationFilter
class=org.acegisecurity.ui.ExceptionTranslationFilter
property name=authenticationEntryPoint
ref local=authenticationProcessingFilterEntryPoint/
/property  
property name=accessDeniedHandler
bean 
class=org.acegisecurity.ui.AccessDeniedHandlerImpl
property name=errorPage 
value=/AccessDenied.html/
/bean
/property 
/bean

bean id=httpSessionContextIntegrationFilter
class=org.acegisecurity.context.HttpSessionContextIntegrationFilter/

bean id=logoutFilter
class=org.acegisecurity.ui.logout.LogoutFilter
constructor-arg value=/Start/ !-- URL redirected to after 
logout --
constructor-arg
list
bean 
class=org.acegisecurity.ui.logout.SecurityContextLogoutHandler/
/list
/constructor-arg
property name=filterProcessesUrl value=/j_acegi_logout/
/bean

-- 
View this message in context: 
http://www.nabble.com/Moving-T4-to-T5-broke-Acegi-tf3845975.html#a10891952
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Form names in T4.1

2007-05-31 Thread Brian Long

Hi all,

this is just a quick question, in previous versions of tapestry a Form was
assigned a name using the convention jwcid=[EMAIL PROTECTED], however in
T4.1this no longer sets the name but assigns an id=someName.
Question is, how
do I assign a name to my Form component in 4.1, as informal parameters are
allowed but name is reserved?

Regards, Brian.


Re: T5: Inject Entities into Page component

2007-05-31 Thread Davor Hrg

i belive howard is planning for a tighter integration of hibernate module
...
don't know is this doable easier since this approach requires a lot code,
I could make sth to handle all entities but here's something so you can play
and see the easynes of tapestry-ioc.

code is not perfect but worked wonderflully both on the page where I list
the reports, a well as on action link

template ...
   t:loop source=reports value=report
   [t:ActionLink context=reportLink${report.name
}/t:ActionLink]br/
   /t:loop

method:
   public Object[] getReportLink() {
   return new Object[] { en, report };
   }

action method that generates a PDF
   public Object onAction(String lang, AdReport adReport) throws
DocumentException {
...



the code needed for it to work
first the version vith an dao object (code goes to AppModule):

   public static void contributeTypeCoercer(ConfigurationCoercionTuple
configuration,final AdReportDAO  dao)
   {
 CoercionAdReport, String coercion = new CoercionAdReport, String()
 {
   public String coerce(AdReport input)
   {
 return input.getId().toString();
   }
 };

 configuration.add(new CoercionTupleAdReport, String(AdReport.class,
String.class, coercion));

 CoercionString, AdReport coercion2 = new CoercionString,
AdReport()
 {
   public AdReport coerce(String input)
   {
 try {
   return dao.findById(Long.parseLong(input), false);
 } catch (NumberFormatException e) {}
 return null;
   }
 };

 configuration.add(new CoercionTupleString, AdReport(String.class,
AdReport.class, coercion2));

   }


---
the version with session object (code goes to AppModule):

   public static void contributeTypeCoercer(ConfigurationCoercionTuple
configuration,final Session  session)
   {
 CoercionAdReport, String coercion = new CoercionAdReport, String()
 {
   public String coerce(AdReport input)
   {
 return input.getId().toString();
   }
 };

 configuration.add(new CoercionTupleAdReport, String(AdReport.class,
String.class, coercion));

 CoercionString, AdReport coercion2 = new CoercionString,
AdReport()
 {
   public AdReport coerce(String input)
   {
 try {
   return (AdReport) session.get(AdReport.class,Long.parseLong
(input));
 } catch (NumberFormatException e) {}
 return null;
   }
 };

 configuration.add(new CoercionTupleString, AdReport(String.class,
AdReport.class, coercion2));

   }



On 5/31/07, Joshua Jackson [EMAIL PROTECTED] wrote:


Dear all,

Would it be possible to Inject Entities into my Page component to be
used for Hibernate, so I don't have to write get and set for setting
and getting the value of my object in my Page component?

So I can just write as such:
public void onAction(){
  session.save(myobj)
}

inside my action handler without having to set the value of myobj
manually in the code but instead the value is automatically injected
from the value of HTML form.

I used tapestry-hibernate module for setting up the Session and Session
Factory.


Thanks for the help

--
YM!: thejavafreak
Blog: http://www.nagasakti.or.id/roller/joshua/

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




Re: T5: Using my own localization backend

2007-05-31 Thread SergeEby

Hi,

You can provide your own implementation by contributing to aliasOverrides:

http://tapestry.apache.org/tapestry5/tapestry-core/guide/alias.html

/Serge


Martin Dietze wrote:
 
 Hi,
 
  I need to use a particular localization backend for my
 project. As I understand, T5 provides its own code for
 retrieving messages based on the .properties files, and if
 I understand Howard's posting from Mar 4 right, simply
 plugging in my own ComponentMessageSource implementation
 is not yet supported.
 
 Would it make any sense trying to circumvent T5's message
 facilities and implement my own which I could access by a
 different prefix, i.e. msg:, or is this complete nonsense?
 
 Cheers,
 
 Martin
 
 -- 
 --- / http://herbert.the-little-red-haired-girl.org /
 -
 =+= 
 manche meinen, lechts und rinks kann man nicht velwechsern.
 werch ein illtum!  -- elnst jandr
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-Using-my-own-localization-backend-tf3845988.html#a10892326
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



[T5] proposal for a java api for adding javascript = tapestry-javascript

2007-05-31 Thread Kristian Marinkovic
hi all,

wouldn't it be nice to have a java api in tapestry that could
be used to add certain javascript functionality to a page? 
preferable independent from a javascript library?

like: 
jsApi.addEventListener(Page page, Component comp, String eventType);

or:
jsApi.addAsynchronousLink(Page page, ActionLink action) which would be
called by a mixin that was applied to a ActionLink component

@Component @MixinClasses(AsynchronousLink.class)
ActionLink checkDate

this way you could provide (contribute) custom implementations 
for several libraries like dojo, prototye, yahoo ui,... T4 is very dojo 
centric and makes it almost impossible to replace dojo... except you
replace any component with dojo specific script code :)

the basic services offered by this api would be for:
- communication (ajax, json)
- (a)synchronous calls
- adding/removing event listener (see T4)
(- effects)
...

i'd be grateful to some other thoughts and comments on this idea

g,
kris




Re: T5: Using my own localization backend

2007-05-31 Thread Martin Dietze
On Thu, May 31, 2007, SergeEby wrote:

 You can provide your own implementation by contributing to aliasOverrides:
 
 http://tapestry.apache.org/tapestry5/tapestry-core/guide/alias.html

Thank you for your reply. I took a look at that page, but I do
not quite understand it. It seems like I lack some a-priori
knowledge on some of T5's concepts.

Could you give me a quick example and / or some hint on how I
could facilitate this mechanism for using my own localization
backend?

Cheers,

Martin

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
In an organization, each person rises to the level of his own incompetency.
   -- The Peter Principle 

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



Re: Form names in T4.1

2007-05-31 Thread Andrew Ingram

Hi Brian,

I'm not sure if this is the reasoning behind the change, but when using 
a strict doctype the form tag isn't allowed a name attribute and id is 
used instead. In tapestry 3 I had to rewrite the form component to use 
id rather than name.


Rewriting the form component to use name instead would be the obvious 
answer, but you probably need to consider whether you should actually be 
using name at all.


Regards,
Andrew

Brian Long wrote:

Hi all,

this is just a quick question, in previous versions of tapestry a Form 
was

assigned a name using the convention jwcid=[EMAIL PROTECTED], however in
T4.1this no longer sets the name but assigns an id=someName.
Question is, how
do I assign a name to my Form component in 4.1, as informal parameters 
are

allowed but name is reserved?

Regards, Brian.


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__


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



T5 / redirect / https

2007-05-31 Thread jb
Hi to all Tapestry users,

is there a best practice for redirect? I noticed in T4 there was a 
RedirectException. In T5 I got the redirect working just by setting 
response.sendRedirect(MyClassName.getSimpleName()) in my filter. How is it 
possible to switch the channel from http to https together with the redirect? 
And how can I keep the https channel for further user interaction?

 
Thanks in advance for any hint

Jens

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



Re: flash covers dojo dialog

2007-05-31 Thread Heping Zhang

I resolved it. Just add param name=wmode value=opaque /


Re: [T5] proposal for a java api for adding javascript = tapestry-javascript

2007-05-31 Thread Joshua Jackson

Hi Kris

I agree with you. I think it will be great to have this component to
replace dependency to a specific javascript framework like dojo or
scriptalous.

On 5/31/07, Kristian Marinkovic [EMAIL PROTECTED] wrote:

hi all,

wouldn't it be nice to have a java api in tapestry that could
be used to add certain javascript functionality to a page?
preferable independent from a javascript library?

like:
jsApi.addEventListener(Page page, Component comp, String eventType);

or:
jsApi.addAsynchronousLink(Page page, ActionLink action) which would be
called by a mixin that was applied to a ActionLink component

@Component @MixinClasses(AsynchronousLink.class)
ActionLink checkDate

this way you could provide (contribute) custom implementations
for several libraries like dojo, prototye, yahoo ui,... T4 is very dojo
centric and makes it almost impossible to replace dojo... except you
replace any component with dojo specific script code :)

the basic services offered by this api would be for:
- communication (ajax, json)
- (a)synchronous calls
- adding/removing event listener (see T4)
(- effects)
...

i'd be grateful to some other thoughts and comments on this idea

g,
kris






--
YM!: thejavafreak
Blog: http://www.nagasakti.or.id/roller/joshua/

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



Localization of validation messagges and their css

2007-05-31 Thread Otho

Hi all,
is there a better/more standard way to localize validation errors than to
create org.apache.tapestry.internal.ValidationMessages_xx_XX.properties and
org.apache.tapestry.corelib.components.Errors_xx_XX.properties in resources
package? And where do I override the css?
Regards,
Otho


Re: custom js validator T4.0

2007-05-31 Thread Viktor Matić

Hi,
On 2007.05.31, at 11:30, Viktor Matić wrote:


 Hi,

I have problem with js validator, which looks like:

Tapestry.validate_basket_qty = function(event, fieldId, min, message)
{
var o = this.find(fieldId);
var value = o.value;

if (value == ) return;

if (Number(value)  min  Number(value) != 0 )
  event.invalid_field(field, message)
}
it seems that default_invalid_field_handler is not registered in  
FormEventManager for forms with custom validator.
I could not find why. So I took ugly shortcut and resolved this issue  
by doing same thing which should be done in

default_invalid_field_handler.

Now js validator looks like this:

Tapestry.validate_basket_qty = function(event, fieldId, min, message)
{
var o = this.find(fieldId);
var value = o.value;

if (value == ) return;

if (Number(value)  min  Number(value) != 0 )
{
   Tapestry.set_focus(o);

   window.alert(message);

   event.abort = true;
   event.cancel_handlers = true;
}
}


as it can be seen it is similar to Tapestry min validator with  
minor change (it accepts 0). Script
is placed in our package and it is used by custom validator render  
method which extends BaseValidator.


Page renders correctly and above function is called on form submit,  
but for some reason


event.invalid_field(field, message)

fails to do the job. Page submits which should not happen. After it  
is submitted server side validation

fires.

Regards,

Viktor Matic




-
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: dynamic component injection

2007-05-31 Thread Andrea Chiumenti

Is it right to do this ?
public IRender getDynaComp() {
   IRequestCycle cycle = getEngine().getInfrastructure().getRequestCycle();
   IWorkerRender result;
   if ((cycle.getParameter(body) != null) 
(!(cycle.getParameter(body).equals())) ) {
   result = from a service via IOC 
   result.setRenderWorker(getRenderWorker());
   } else {
   result = new DynaRenderer(); //Default
   result.setRenderWorker(getRenderWorker());
   }
   return result;
   }

of course components must not be abstract.


On 5/31/07, Andrea Chiumenti [EMAIL PROTECTED] wrote:

Hello I'd like to konw if in Tap 4.1.2 there is a way do dynamically
render components inside a page.

If yes, how ?

regards,
kiuma



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



JumpStart v1.3 is now available - Web Flows

2007-05-31 Thread Geoff Callender

Tapestry JumpStart v1.3 is now available.  This version adds:

* Example of Web Flow And Wizards
	  - demonstrates how Tapestry makes web flow a breeze.  No XML or  
additional frameworks required!


* Example of Web Flow With Random Navigation.  Includes techniques for:
  - setting default focus
  - setting default button

You'll find JumpStart here:

http://files.doublenegative.com.au/jumpstart

All comments gladly received.

Cheers,

Geoff Callender

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




Re: T5: select using a wrapped enum

2007-05-31 Thread Howard Lewis Ship

Have you considered using OptionGroups as the labels?

On 5/31/07, Martin Dietze [EMAIL PROTECTED] wrote:


Hi,

I created a selectmodel based on a enum wrapped by a generic
wrapper and using a generic value encoder.

By this I intend to simplify creating select inputs consisting of
something like please select and  followed by the enum's
entries which are the only valid inputs for the select.

The code seems to work well, I the select options are created
properly and show up in the form, also selected values are
delivered after submit. However when rendering the result page
the previously submitted option is not selected.

I wonder whether my code is not OK or do I have to insert some
code on my own to get the last choice selected in the result
page?

Cheers,

Martin

--- snip -

Here is my code:

The selectmodel:

|  public final class SalutationSelectModel extends AbstractSelectModel {
|  private final Messages _msgs;
|
|  public SalutationSelectModel(final Messages msgs) {
|_msgs = msgs;
|  }
|
|  public ListOptionGroupModel getOptionGroups() {
|return null;
|  }
|  public ListOptionModel getOptions() {
|final ListOptionModel result = new ArrayListOptionModel();
|
|// Add please select... entry and disabled --...
|result.add(new OptionModelImpl(_msgs.get(select_pleaseSelect),
|  false, null, new String[0]));
|result.add(new OptionModelImpl(_msgs.get( select_separator),
|  true, new CommonSelectViewSalutation(null), new String[0]));
|
|for(Salutation salut : Salutation.values()) {
|  result.add(new OptionModelImpl(_msgs.get(salutation_ + salut.name
()),
|  false, new CommonSelectViewSalutation(salut), new String[0]));
|}
|
|return result;
|  }
|}

The enum:

| public enum Salutation {
|   MR,
|   MRS;
| }

The generic enum wrapper:

| public class CommonSelectViewM {
|   private final M _model;
|   public CommonSelectView(M model) {
| _model = model;
|   }
|   public M getModel() {
| return _model;
|   }
| }

The generic value encoder lets me differenciate between
invalid inputs (like please select) and disabled ones so
that I do not get more than one selected=selected when
the page is displayed for the first time:

| ValueEncoderM extends EnumM implements
ValueEncoderCommonSelectViewM {
|
|   private ClassM _cls;
|   public CommonValueEncoder(ClassM cls) {
| _cls = cls;
|   }
|
|   public String toClient(CommonSelectViewM value) {
| if (value == null) {
|   return null;
| } else if (value.getModel() == null) {
| return disabled;
| }
| return value.getModel().name();
|   }
|
|   public CommonSelectViewM toValue(String clientValue) {
| if (null.equals( clientValue) || disabled.equals(clientValue)) {
|   return null;
| }
| M m = Enum.valueOf(_cls, clientValue);
| return new CommonSelectViewM(m);
|   }
| }

All this is used in this page class:

| public class CreatePartner {
|   @Inject
|   private Messages _messages;
|   @Component
|   private Form _form;
|   @Persist
|   private CommonSelectViewSalutation _contactSalutation;
|
|   private static ValueEncoderCommonSelectViewSalutation
| _salutationValueEncoder = new CommonValueEncoderSalutation(
Salutation.class);
|   private SelectModel _salutationModel;
|
|   public CreatePartner() {
| _salutationModel = new SalutationSelectModel( _messages );
|   }
|
|   @OnEvent(value=submit)
|   public void submit() {
| _form.recordError(Submit received: 
|   + (_contactSalutation != null? _contactSalutation.getModel() :
null));
|   }
|
|   public SelectModel getSalutationModel() {
| return _salutationModel;
|   }
|
|   public ValueEncoderCommonSelectViewSalutation
getSalutationValueEncoder() {
| return _salutationValueEncoder;
|   }
|
|
|   public CommonSelectViewSalutation getContactSalutation() {
| return _contactSalutation;
|   }
|
|   public void setContactSalutation(CommonSelectViewSalutation
contactSalutation) {
| _contactSalutation = contactSalutation;
|   }
|
| }

Finally, in the form I have this entry for the select:

| select name=salutation id=salutation tabindex=10
|   t:type=select
|   t:id=salutation
|   t:encoder=salutationValueEncoder
|   t:model=salutationModel
|   t:validate=required
|   t:value=contactSalutation
|   
|   option selected=selectedbitte wählen.../option
|   option disabled=disabled---/option
|   optionHerr/option
|   optionFrau/option
| /select

--
--- / http://herbert.the-little-red-haired-girl.org /
-
=+=
* Free Speech Online!!! Support the Blue Ribbon Campaign! *

-
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 

Re: dynamic component injection

2007-05-31 Thread Jesse Kuhnert

Hmm I'm not sure.   It doesn't look right but it's possible.  Wouldn't
@Block be the easiest way to do it?  Or different instances of IRender ?

On 5/31/07, Andrea Chiumenti [EMAIL PROTECTED] wrote:


Is it right to do this ?
public IRender getDynaComp() {
IRequestCycle cycle =
getEngine().getInfrastructure().getRequestCycle();
IWorkerRender result;
if ((cycle.getParameter(body) != null) 
(!(cycle.getParameter(body).equals())) ) {
result = from a service via IOC 
result.setRenderWorker(getRenderWorker());
} else {
result = new DynaRenderer(); //Default
result.setRenderWorker(getRenderWorker());
}
return result;
}

of course components must not be abstract.


On 5/31/07, Andrea Chiumenti [EMAIL PROTECTED] wrote:
 Hello I'd like to konw if in Tap 4.1.2 there is a way do dynamically
 render components inside a page.

 If yes, how ?

 regards,
 kiuma


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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


Re: T5: select using a wrapped enum

2007-05-31 Thread Martin Dietze
On Thu, May 31, 2007, Howard Lewis Ship wrote:

 Have you considered using OptionGroups as the labels?

To me it seemed that if I have to create a number of selects
with similar structure, just plugging in the appropriate enum
might actually be an elegant solution. 

Do you seen anything wrong with the way I implemented this?

Cheers,

Martin

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
- Are you attempting to tell me my duty, sir?
- No. Just having fun trying to guess what they are.

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



Re: Localization of validation messagges and their css

2007-05-31 Thread Juan Maya

To override you need to add the css styles u want to override in u r own
style sheet. For example, if u want to override the tapestry style:
div.t-error you create:
newStyles.css
div.t-error {
   border: 1px solid red;
   padding: 0px;
   margin: 4px 0px;
}

then u include the css in ur page and that's all :)

On 5/31/07, Otho [EMAIL PROTECTED] wrote:


Hi all,
is there a better/more standard way to localize validation errors than to
create org.apache.tapestry.internal.ValidationMessages_xx_XX.propertiesand
org.apache.tapestry.corelib.components.Errors_xx_XX.properties in
resources
package? And where do I override the css?
Regards,
Otho



Re: Shipwreck when downloading T5.0.5

2007-05-31 Thread adasal

I can use this to run 5.0.4 as per Daniel Jue but I cannot run 5.0.5.
I have cheated(?) and installed 5.0.4 tapestry-core as 5.0.5-SNAPSHOT then
if I e.g. mvn clean install -U this is the console output. It looks for the
corresponding pom which it doesn't find.
Otherwise, without the cheat, it would ask for the 5.0.5-SNAPSHOT be
downloaded manually. I am very unclear how to do that or if that is what I
should do.
In short I don't get how to grab a snapshot using maven. Any ideas?
Adam

[INFO] artifact org.apache.maven.plugins:maven-install-plugin: checking for
upda
tes from apache.snapshots
[INFO] artifact org.apache.maven.plugins:maven-install-plugin: checking for
upda
tes from howardlewisship.com
[INFO] artifact org.apache.maven.plugins:maven-install-plugin: checking for
upda
tes from central
[INFO] snapshot org.apache.maven.plugins:maven-install-plugin:2.3-SNAPSHOT:chec
king for updates from apache.snapshots
[INFO] snapshot org.apache.maven.plugins:maven-install-plugin:2.3-SNAPSHOT:chec
king for updates from howardlewisship.com
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] snapshot org.apache.tapestry:tapestry-core:5.0.5-SNAPSHOT: checking
for u
pdates from apache.snapshots
[INFO] snapshot org.apache.tapestry:tapestry-core:5.0.5-SNAPSHOT: checking
for u
pdates from codehaus.snapshots
[INFO] snapshot org.apache.tapestry:tapestry-core:5.0.5-SNAPSHOT: checking
for u
pdates from openqa
Downloading:
http://people.apache.org/repo/m2-snapshot-repository//org/apache/ta
pestry/tapestry-core/5.0.5-SNAPSHOT/tapestry-core-5.0.5-SNAPSHOT.pom
[WARNING] Unable to get resource from repository apache.snapshots (
http://people
.apache.org/repo/m2-snapshot-repository/)
Downloading:
http://snapshots.repository.codehaus.org/org/apache/tapestry/tapest
ry-core/5.0.5-SNAPSHOT/tapestry-core-5.0.5-SNAPSHOT.pom
[WARNING] Unable to get resource from repository codehaus.snapshots (
http://snap
shots.repository.codehaus.org)
Downloading:
http://maven.openqa.org//org/apache/tapestry/tapestry-core/5.0.5-SN
APSHOT/tapestry-core-5.0.5-SNAPSHOT.pom
[WARNING] Unable to get resource from repository openqa (
http://maven.openqa.org
/)
[INFO] [compiler:compile]
[INFO] Compiling 2 source files to
C:\workspace\tapestry-maven\myapp\target\clas
ses
[INFO]

[ERROR] BUILD FAILURE
[INFO]

[INFO] Compilation failure

C:\workspace\tapestry-maven\myapp\src\main\java\org\example\myapp\services\AppMo
dule.java:[5,34] package org.apache.commons.logging does not exist

C:\workspace\tapestry-maven\myapp\src\main\java\org\example\myapp\services\AppMo
dule.java:[6,31] package org.apache.tapestry.ioc does not exist

C:\workspace\tapestry-maven\myapp\src\main\java\org\example\myapp\services\AppMo
dule.java:[7,31] package org.apache.tapestry.ioc does not exist

C:\workspace\tapestry-maven\myapp\src\main\java\org\example\myapp\services\AppMo
dule.java:[8,43] package org.apache.tapestry.ioc.annotations does not exist

C:\workspace\tapestry-maven\myapp\src\main\java\org\example\myapp\services\AppMo
dule.java:[9,43] package org.apache.tapestry.ioc.annotations does not exist

C:\workspace\tapestry-maven\myapp\src\main\java\org\example\myapp\services\AppMo
dule.java:[10,43] package org.apache.tapestry.ioc.annotations does not exist

C:\workspace\tapestry-maven\myapp\src\main\java\org\example\myapp\services\AppMo
dule.java:[25,12] cannot find symbol
symbol  : class MappedConfiguration
location: class org.example.myapp.services.AppModule

C:\workspace\tapestry-maven\myapp\src\main\java\org\example\myapp\services\AppMo
dule.java:[45,49] cannot find symbol
symbol  : class Log
location: class org.example.myapp.services.AppModule

C:\workspace\tapestry-maven\myapp\src\main\java\org\example\myapp\services\AppMo
dule.java:[74,41] cannot find symbol
symbol  : class OrderedConfiguration
location: class org.example.myapp.services.AppModule

C:\workspace\tapestry-maven\myapp\src\main\java\org\example\myapp\services\AppMo
dule.java:[20,1] cannot find symbol
symbol: class Id
@Id(app)

C:\workspace\tapestry-maven\myapp\src\main\java\org\example\myapp\services\AppMo
dule.java:[23,5] cannot find symbol
symbol  : class Contribute
location: class org.example.myapp.services.AppModule

C:\workspace\tapestry-maven\myapp\src\main\java\org\example\myapp\services\AppMo
dule.java:[75,13] cannot find symbol
symbol  : class InjectService
location: class org.example.myapp.services.AppModule

C:\workspace\tapestry-maven\myapp\src\main\java\org\example\myapp\services\AppMo
dule.java:[73,5] cannot find symbol
symbol  : class Contribute
location: class org.example.myapp.services.AppModule


[INFO]

[INFO] For more information, run Maven with the -e switch
[INFO]

Re: dynamic component injection

2007-05-31 Thread Andrea Chiumenti

Well I want to make a single page application, so componentns (the
body part of a page)
will be injected as reference by hivemind into different jars.

Playng a bit with Tapestry src I've found a better way to do this, but
I need some more testing (assets, listeners, etc).

I'm investigating on this kind of solution becase this will optimize
dojo loading with incremental load.

What do you thik about this ?

kiuma

Here it is the code
--
package org.jfly.sample.pages;


import org.jfly.sample.components.widgets.DynaRenderer;
import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.hivemind.HiveMind;
import org.apache.hivemind.Location;
import org.apache.tapestry.AbstractPage;
import org.apache.tapestry.BaseComponent;
import org.apache.tapestry.IComponent;
import org.apache.tapestry.IMarkupWriter;
import org.apache.tapestry.INamespace;
import org.apache.tapestry.IPage;
import org.apache.tapestry.IRender;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.TapestryConstants;
import org.apache.tapestry.annotations.InjectObject;
import org.apache.tapestry.engine.IPageLoader;
import org.apache.tapestry.html.BasePage;
import org.apache.tapestry.pageload.ComponentClassProvider;
import org.apache.tapestry.pageload.ComponentClassProviderContext;
import org.apache.tapestry.pageload.PageLoader;
import org.apache.tapestry.resolver.ComponentSpecificationResolver;
import org.apache.tapestry.services.ComponentConstructor;
import org.apache.tapestry.services.ComponentConstructorFactory;
import org.apache.tapestry.services.ResponseBuilder;
import org.apache.tapestry.spec.ContainedComponent;
import org.apache.tapestry.spec.IComponentSpecification;
import org.apache.tapestry.spec.IContainedComponent;
import org.apache.tapestry.web.WebRequest;
import org.apache.hivemind.Messages;
import org.apache.tapestry.annotations.InjectObject;
import java.util.Date ;

/**
* Start page of application pageInjection.
*/
abstract public class Homeextends BasePage {
   private IRender renderer;

   public IRender getRenderer() {
   return renderer;
   }
   public Date getCurrentTime() {
   return new Date();
   }

   @InjectObject(service:tapestry.page.ComponentClassProvider)
   public abstract ComponentClassProvider getComponentClassProvider();

   @InjectObject(service:tapestry.page.ComponentSpecificationResolver)
   public abstract ComponentSpecificationResolver getComponentResolver();

   @InjectObject(service:tapestry.enhance.ComponentConstructorFactory)
   public abstract ComponentConstructorFactory
getComponentConstructorFactory();

@InjectObject(service:tapestry.page.PageLoader)
   public abstract IPageLoader getPageLoader();

   public IRender getDynaComp() {
   IRequestCycle cycle = getEngine().getInfrastructure().getRequestCycle();
   ComponentSpecificationResolver componentResolver =
getComponentResolver();
   IPageLoader pageLoader = getPageLoader();
   String componentType = DynaRenderer.class.getName();
   Location location = getLocation();
   componentResolver.resolve(cycle, getNamespace(),
componentType, location);

   INamespace componentNamespace = componentResolver.getNamespace();
   IComponentSpecification spec = componentResolver.getSpecification();

   IContainedComponent contained = new ContainedComponent();
   contained.setLocation(location);
   contained.setType(componentType);
   IComponent result = instantiateComponent(this, this, message,
   spec, componentResolver.getType(), componentNamespace,
   contained);


   //IRender result =
getPageLoader().createImplicitComponent(cycle, this, message,
DynaRenderer.class.getName(), getLocation());
   return result;
   }

   private IComponent instantiateComponent(IPage page, IComponent container,
   String id, IComponentSpecification spec, String type,
   INamespace namespace, IContainedComponent containedComponent)
   {
   ComponentClassProviderContext context = new
ComponentClassProviderContext(
   type, spec, namespace);
   String className =
getComponentClassProvider().provideComponentClassName(context);

   if (HiveMind.isBlank(className))
   className = BaseComponent.class.getName();
   else
   {

   Class componentClass =
getEngine().getInfrastructure().getClassResolver().findClass(className);

   if (!IComponent.class.isAssignableFrom(componentClass))
   throw new ApplicationRuntimeException(componentClass +
 is not a component class, container, spec
   .getLocation(), null);

   if (IPage.class.isAssignableFrom(componentClass))
   throw new ApplicationRuntimeException(Not assignable
 + id, container, spec.getLocation(),
   null);
   }

   ComponentConstructor cc =

T4 Maven 2 archetype

2007-05-31 Thread Olivier THIERRY

Hi,

I try to run Maven 2 archetype for Tapestry 4 as said on this page :
http://tapestry.apache.org/tapestry4.1/tapestry-archetype/index.html

But it can't find artifact tapestry-archetype, with the followin error :

Downloading:
http://repo1.maven.org/maven2/org/apache/tapestry/tapestry-archetyp
e/4.1.1/tapestry-archetype-4.1.1.jar

[WARNING] Unable to get resource from repository central (
http://repo1.maven.org/maven2)
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] Failed to resolve artifact.

GroupId: org.apache.tapestry
ArtifactId: tapestry-archetype
Version: 4.1.1

Reason: Unable to download the artifact from any repository

Try downloading the file manually from the project website.

Then, install it using the command:
   mvn install:install-file
-DgroupId=org.apache.tapestry-DartifactId=tapestry-archetype \
   -Dversion=4.1.1 -Dpackaging=jar -Dfile=/path/to/file


 org.apache.tapestry:tapestry-archetype:jar:4.1.1

from the specified remote repositories:
 central (http://repo1.maven.org/maven2)


Anyone has an idea how I could solve this problem ?

Thanks in advance

Olivier


Re: T5: select using a wrapped enum

2007-05-31 Thread Howard Lewis Ship

I meant OptionGroups for the non-selectable labels.  Make the HTML browser
do the work for you.  It actually looks nice, with the items indented
beneath the matching labels.  The indentation means you probably don't need
the row of dashes.

On 5/31/07, Martin Dietze [EMAIL PROTECTED] wrote:


On Thu, May 31, 2007, Howard Lewis Ship wrote:

 Have you considered using OptionGroups as the labels?

To me it seemed that if I have to create a number of selects
with similar structure, just plugging in the appropriate enum
might actually be an elegant solution.

Do you seen anything wrong with the way I implemented this?

Cheers,

Martin

--
--- / http://herbert.the-little-red-haired-girl.org /
-
=+=
- Are you attempting to tell me my duty, sir?
- No. Just having fun trying to guess what they are.

-
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


Re: Blog on Tapestry's Future

2007-05-31 Thread Peter Stavrinides

On 5/21/07, Howard Lewis Ship [EMAIL PROTECTED] wrote:
I'd love to see more comments. Honest comments about your experiences 
going
from 3 to 4, your thoughts on better adoption, how you feel about 
Tapestry 5
(especially if you are in a situation where you'll need to upgrade).  
Please

avoid any comparisons of Tapestry to other frameworks (that just causes
flame wars).

Answering without some comparisons to other frameworks is very 
difficult, because people base their evaluations on their experience. In 
the ten years I have been developing web apps I have used many decent 
web technologies including .Net, Perl,  ColdFusion, and each of these 
platforms had stuff I liked, and so too does Tapestry.


I personally believe the secret to adoption is 1. Ease of use, and 2. 
Productivity. Tapestry in my opinion is neither. Needless to say this 
comment I sn't intended  as an insult, because Tapestry is a wonderfull 
framework and does many things far better than its competitors, but I am 
not an idealist... I prefer like most people just to get my work done as 
quickly and efficiently as possible.


Tapestry 4 was not easy to use because of the following: a lack of 
quality and up-to-date documentation; a lack of working examples; a 
shortage of published information; too much configuration; too many 
dependency and deployment problems, and worst of all the class reloading 
inefficiencies.


Improving Tapestry is not just about the technology, but also about all 
those very time consuming extras that surround it. Tapestry 5 is awesome 
in comparison to 4, I would even say that the new class reloading 
mechanism is totally innovative making it so much more productive than 
version 4, but this is offset by the time it takes to get everything 
going, getting all the configuration and deployment issues sorted, and 
of course not having a good online reference to work with as a start. Ok 
granted Tapestry 5 is still in pre-release, but if it goes anything like 
Tapestry 4 then I am sure I will feel more of those dark moments as my 
deadlines approach and I am stuck on some issues that aren't documented.


I originally scheduled an upgrade to Tapestry 5 this month, but I had to 
push it back for a while until I feel confident enough about 5. Our 
software systems are already running on Java 6 which also appears to be 
an obstacle, especially in development so I am stuck with 4 until it is 
resolved. Although this now leaves me with the problem that we have to 
keep developing new features in 4 so upgrading is becoming more and more 
difficult as time goes on.


Best wishes,
Peter

--
Peter Stavrinides
Albourne Partners (Cyprus) Ltd
Tel: +357 22 750652 

If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Please visit http://www.albourne.com/email.html for important additional terms relating to this e-mail. 




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



Re: Localization of validation messagges and their css

2007-05-31 Thread Otho

Thanks! Too obvious to find it out myself... :)

2007/5/31, Juan Maya [EMAIL PROTECTED]:


To override you need to add the css styles u want to override in u r own
style sheet.



Portlet - custom Exception page

2007-05-31 Thread Petras Martin, Centire
Title: Centire Signature




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
page name="Exception" specification-path="MyException.page"/
to myApplication.application
and myPortlet.application.
Also did not work.

3. I tried to add
contribution configuration-id="tapestry.InfrastructureOverrides"
    property name="exceptionPageName" value="MyException"/
/contribution
to all hivemodule.xml files. I also specified MyException as 
page name="MyException" specification-path="MyException.page"/
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 
 
Centire, 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 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 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 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 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: [T5] proposal for a java api for adding javascript = tapestry-javascript

2007-05-31 Thread Howard Lewis Ship

This is a fine idea, but may be deferred a bit until we get some more
experience with what it means to be cross-library compatible.

On 5/31/07, Joshua Jackson [EMAIL PROTECTED] wrote:


Hi Kris

I agree with you. I think it will be great to have this component to
replace dependency to a specific javascript framework like dojo or
scriptalous.

On 5/31/07, Kristian Marinkovic [EMAIL PROTECTED] wrote:
 hi all,

 wouldn't it be nice to have a java api in tapestry that could
 be used to add certain javascript functionality to a page?
 preferable independent from a javascript library?

 like:
 jsApi.addEventListener(Page page, Component comp, String eventType);

 or:
 jsApi.addAsynchronousLink(Page page, ActionLink action) which would be
 called by a mixin that was applied to a ActionLink component

 @Component @MixinClasses(AsynchronousLink.class)
 ActionLink checkDate

 this way you could provide (contribute) custom implementations
 for several libraries like dojo, prototye, yahoo ui,... T4 is very dojo
 centric and makes it almost impossible to replace dojo... except you
 replace any component with dojo specific script code :)

 the basic services offered by this api would be for:
 - communication (ajax, json)
 - (a)synchronous calls
 - adding/removing event listener (see T4)
 (- effects)
 ...

 i'd be grateful to some other thoughts and comments on this idea

 g,
 kris





--
YM!: thejavafreak
Blog: http://www.nagasakti.or.id/roller/joshua/

-
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


Re: T5 - Service injection and ioc

2007-05-31 Thread vidrilon

Did i understood well?? Could you make it work?

I'm also having the same problem, i have created another module,
UserAuthenticatorModule for validating
a login form, but have the same message:

No service implements the interface org.clinica.bd.pages.UserAuthenticator



Joshua Jackson-3 wrote:
 
 On 5/30/07, Davor Hrg [EMAIL PROTECTED] wrote:
 I tried @Inject Session session; but it didn't work.
 

 you probably have an error in log from tapestry demanding for the field
 to
 be private...

 try:
 @Inject private Session session;

 Davor Hrg
 
 Thank you so much. I've got it running now.
 
 -- 
 YM!: thejavafreak
 Blog: http://www.nagasakti.or.id/roller/joshua/
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5---Service-injection-and-ioc-tf3834669.html#a10898922
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



[T5] Beginning Hibernate with a T5 application

2007-05-31 Thread Daniel Jue

Hey there

I am considering using Hibernate for part of my applications db
access.  Before I was hand writing DAOs/daofactories, but now the
impedance mismatch is growing too large and I want to try something
different.  With T4, there are plenty of good tapestry/hibernate
resources.

With T5, we have IOC in tapestry-core, and then there is
tapestry-hibernate which is in snapshot mode, but has been described
as a placeholder only a few months ago.

All I'm looking for is something like the hibernate hello world or
some sample code that gets me to a point equivalent to this:

Session session = getSessionCreator().createSession();

After that point I get the impression that the use of hibernate
features will be the same as in T4.  ( I am referencing the ewdt book
for T4)

Can anyone copy and paste some code that does something simple?  It
doesn't need to be a whole app, or a whole class even.

I have a myobject.hbm.xml in the same directory as myobject.java, and
hibernate.cfg.xml / hibernate.properties in resources/ .
I assume those kinds of fundamentals are the same when using T5-Hibernate.

I have Hibernate 3.2.1ga and tapestry-hibernate (5.0.5-SNAPSHOT) in my pom.

Thanks for any help you can provide me.

Daniel

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



Re: Shipwreck when downloading T5.0.5

2007-05-31 Thread RobertSchreiber

Looks like you have an old version of this file.

The correct oane is:

package org.example.myapp.services;

import java.io.IOException;

import org.apache.commons.logging.Log;
import org.apache.tapestry.ioc.MappedConfiguration;
import org.apache.tapestry.ioc.OrderedConfiguration;
import org.apache.tapestry.ioc.annotations.InjectService;
import org.apache.tapestry.services.Request;
import org.apache.tapestry.services.RequestFilter;
import org.apache.tapestry.services.RequestHandler;
import org.apache.tapestry.services.Response;

/**
 * This module is automatically included as part of the Tapestry IoC
Registry, it's a good place to
 * configure and extend Tapestry, or to place your own services.
 */
public class AppModule
{
public static void contributeApplicationDefaults(
MappedConfigurationString, String configuration)
{
// Contributions to ApplicationDefaults will override any
contributions to
// FactoryDefaults (with the same key). Here we're restricting the
supported
// locales to just en (English). As you add localised message
catalogs and other assets,
// you can extend this list of locales (it's a comma seperated
series of locale names;
// the first locale name is the default when there's no reasonable
match).

configuration.add(tapestry.supported-locales, en);
}


/**
 * This is a service definition, the service will be named TimingFilter.
The interface,
 * RequestFilter, is used within the RequestHandler service pipeline,
which is built from the
 * RequestHandler service configuration. Tapestry IoC is responsible for
passing in an
 * appropriate Log instance. Requests for static resources are handled
at a higher level, so
 * this filter will only be invoked for Tapestry related requests.
 */
public RequestFilter buildTimingFilter(final Log log)
{
return new RequestFilter()
{
public boolean service(Request request, Response response,
RequestHandler handler)
throws IOException
{
long startTime = System.currentTimeMillis();

try
{
// The reponsibility of a filter is to invoke the
corresponding method
// in the handler. When you chain multiple filters
together, each filter
// received a handler that is a bridge to the next
filter.

return handler.service(request, response);
}
finally
{
long elapsed = System.currentTimeMillis() - startTime;

log.info(String.format(Request time: %d ms, elapsed));
}
}
};
}

/**
 * This is a contribution to the RequestHandler service configuration.
This is how we extend
 * Tapestry using the timing filter. A common use for this kind of
filter is transaction
 * management or security.
 */
public void contributeRequestHandler(OrderedConfigurationRequestFilter
configuration,
@InjectService(TimingFilter)
RequestFilter filter)
{
// Each contribution to an ordered configuration has a name, When
necessary, you may
// set constraints to precisely control the invocation order of the
contributed filter
// within the pipeline.

configuration.add(Timing, filter);
}
}


adasal wrote:
 
 I can use this to run 5.0.4 as per Daniel Jue but I cannot run 5.0.5.
 I have cheated(?) and installed 5.0.4 tapestry-core as 5.0.5-SNAPSHOT then
 if I e.g. mvn clean install -U this is the console output. It looks for
 the
 corresponding pom which it doesn't find.
 Otherwise, without the cheat, it would ask for the 5.0.5-SNAPSHOT be
 downloaded manually. I am very unclear how to do that or if that is what I
 should do.
 In short I don't get how to grab a snapshot using maven. Any ideas?
 Adam
 
 [INFO] artifact org.apache.maven.plugins:maven-install-plugin: checking
 for
 upda
 tes from apache.snapshots
 [INFO] artifact org.apache.maven.plugins:maven-install-plugin: checking
 for
 upda
 tes from howardlewisship.com
 [INFO] artifact org.apache.maven.plugins:maven-install-plugin: checking
 for
 upda
 tes from central
 [INFO] snapshot
 org.apache.maven.plugins:maven-install-plugin:2.3-SNAPSHOT:chec
 king for updates from apache.snapshots
 [INFO] snapshot
 org.apache.maven.plugins:maven-install-plugin:2.3-SNAPSHOT:chec
 king for updates from howardlewisship.com
 [INFO] [resources:resources]
 [INFO] Using default encoding to copy filtered resources.
 [INFO] Copying 1 resource
 [INFO] snapshot org.apache.tapestry:tapestry-core:5.0.5-SNAPSHOT: checking
 for u
 pdates from apache.snapshots
 [INFO] snapshot org.apache.tapestry:tapestry-core:5.0.5-SNAPSHOT: checking
 for u
 pdates from codehaus.snapshots
 [INFO] snapshot 

Re: Lehky_SPAM: Re: T5 Decoupling a Template From its Component Class

2007-05-31 Thread Juan Maya

yes, that;s still supported and documented here:
http://tapestry.apache.org/tapestry5/tapestry-core/guide/localization.html

On 5/31/07, Jiri Mares [EMAIL PROTECTED] wrote:



Hi Howard,

I would like to ask, whether there is still possibility to have localized
templates?

eg.

org/example/myapp/components/CClamp.html
org/example/myapp/components/CClamp_en.html
org/example/myapp/components/CClamp_en_US.html
org/example/myapp/components/CClamp_de.html

Thanks

Howard Lewis Ship napsal(a):
 There are internal services that can be overridden to handle those kinds
of
 situations.

 The goal is to create something that works amazingly well for all the
more
 typical cases, then start going after these others.  Often it will
involve
 moving a private interface out into the public space ... but once that's
 done, its very hard to change the interface in the future without
breaking
 backwards compatibility, so we're pretty conservative about pulling back
 the
 curtain until we know the interface is full and complete.

 On 5/30/07, David Kendall [EMAIL PROTECTED] wrote:

 I am a Tapestry newbie getting up to speed on Tap 5. I am working on an
 application with extensive co-branding requirements.

 As I understand things, there is - by default - a tight coupling
between
 a component class name and its template path. For example - if a
 component has a FQCN of...

 org.example.myapp.components.CClamp

 ...then the template has to be on the classpath as

 org/example/myapp/components/CClamp.html

 It would be very helpful if the mapping between the component and the
 template could be decoupled - this would allow me to pull in component
 templates that have been tweaked for a particular co-brand.

 For example - I might want to have a template on the class path as

 org/example/myapp/override/cobrand1/components/CClamp.html

 Is there any way to do this?

 Thanks in advance.

 David Kendall




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





--
Jiří Mareš (mailto:[EMAIL PROTECTED])
ČSAD SVT Praha, s.r.o. (http://www.svt.cz)
Czech Republic

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




Re: dojo dialog to populate portion of form and submit

2007-05-31 Thread Paul Stanton
Ok, but I need to populate the form content with ajax. I could edit 1 of 
50 elements, and i don't want to load in all of the editable data until 
it's selected. The problem as I see it is less that the dialog is 
shown/hidden, but that the form components are essentially detached from 
the page's form once they are updated via ajax.


FYI I've solved this by reworking my border component so that I can have 
more than one form per page. The only drawback is that if I change the 
enabled/disabled status of an element (click checkbox), then load the 
dialog and save that, my enable/disable change is not registered, as the 
page's form is not submitted.


Anyway, I think it's a small price to pay, however it would have been 
nice if tapestry could maintain the link with updated form components as 
described.


Thanks for the help Miguel.

Miguel Angel Hernández wrote:
The trick is that the dialog its always inside the Form, as a hidden 
part of

the dom i,e: visibility='hidden':
div
   id=ognl:contenedorId
   jwcid=@Any
   style=position:absolute;visibility:hidden;z-index: 555
   
   span jwcid=@RenderBody/
/div

Whenever I need such dialog to show(and render or populate its 
bindings) I

update the @Any component,
and change the visibility and position via javascript (it has to be done
with js to paint it right).

regards,

Miguel

On 5/30/07, Paul Stanton [EMAIL PROTECTED] wrote:


how did you handle population of the dialog form portion? 





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



Re: scrolling window : dojo dialog vs thickbox

2007-05-31 Thread Paul Stanton
well, there's the issue of software bloat as well. I'm sure someone 
could write some components around jquery to rival the dojo components, 
but including both by default would be a bad idea imho.


is this an issue worth raising with the dojo team? since dojo is the 
chosen javascript platform for tapestry shouldn't we focus on getting it 
up to speed before considering alternatives/compliments?


Jesse Kuhnert wrote:

I'd love to be able to support jquery / others as addition javascript
handlers.  ...Perhaps this is something we can address in the 4.1.3 dev
cycle.



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



Re: dojo dialog to populate portion of form and submit

2007-05-31 Thread Jesse Kuhnert

I can't really piece together what you are doing vs. what is not working as
expected but the Dialog component essentially does nothing other than wrap a
block of html.

Tapestry does maintain form state during ajax requests - so if that's not
happening then something is wrong.  It's possible that the client side
javascript code implementing the dialog moves the html nodes around in such
a way that if you don't have a form within the dialog itself that the nodes
will become separated from the original form and start to break things.  I
have always placed forms within my dialogs even when on pages with one big
form as the placement of the dialog outside of the big form makes no
difference as the html displayed is always centered anyways.

Maybe an example would help but I just am not getting it looking at the
paragraphs of text.

On 5/31/07, Paul Stanton [EMAIL PROTECTED] wrote:


Ok, but I need to populate the form content with ajax. I could edit 1 of
50 elements, and i don't want to load in all of the editable data until
it's selected. The problem as I see it is less that the dialog is
shown/hidden, but that the form components are essentially detached from
the page's form once they are updated via ajax.

FYI I've solved this by reworking my border component so that I can have
more than one form per page. The only drawback is that if I change the
enabled/disabled status of an element (click checkbox), then load the
dialog and save that, my enable/disable change is not registered, as the
page's form is not submitted.

Anyway, I think it's a small price to pay, however it would have been
nice if tapestry could maintain the link with updated form components as
described.

Thanks for the help Miguel.

Miguel Angel Hernández wrote:
 The trick is that the dialog its always inside the Form, as a hidden
 part of
 the dom i,e: visibility='hidden':
 div
id=ognl:contenedorId
jwcid=@Any
style=position:absolute;visibility:hidden;z-index: 555

span jwcid=@RenderBody/
 /div

 Whenever I need such dialog to show(and render or populate its
 bindings) I
 update the @Any component,
 and change the visibility and position via javascript (it has to be done
 with js to paint it right).

 regards,

 Miguel

 On 5/30/07, Paul Stanton [EMAIL PROTECTED] wrote:

 how did you handle population of the dialog form portion?



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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


Re: scrolling window : dojo dialog vs thickbox

2007-05-31 Thread Jesse Kuhnert

I wasn't suggesting having both running together.   More along the lines of
what I implemented in Tacos originally - which supports both prototype and
dojo - not necessarily strictly one or another.

On 5/31/07, Paul Stanton [EMAIL PROTECTED] wrote:


well, there's the issue of software bloat as well. I'm sure someone
could write some components around jquery to rival the dojo components,
but including both by default would be a bad idea imho.

is this an issue worth raising with the dojo team? since dojo is the
chosen javascript platform for tapestry shouldn't we focus on getting it
up to speed before considering alternatives/compliments?

Jesse Kuhnert wrote:
 I'd love to be able to support jquery / others as addition javascript
 handlers.  ...Perhaps this is something we can address in the 4.1.3 dev
 cycle.


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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


RE: T5: when is @Persist necessary and when not...

2007-05-31 Thread Ben Sommerville
The default value that the _person member gets reset to will be 
the Person _instance_ that you assigned in the constructor.

So when the form is submitted that instance will have its members
set based on the form values.  When the page is rendered the 
same instance will be used as the default value  you will see
your submitted values.

Basically default values only work properly when they are immutable.
e.g. strings, 

For a form I'd say the best place to create those compound objects
is in the onPrepare method.  This will be invoked before any processing/
rendering occurs.  (see the Form component subsection of 
http://tapestry.apache.org/tapestry5/tapestry-core/guide/validation.html)

Another option is the pageAttached method (invoked when page
is attached to the request) which is documented at
http://tapestry.apache.org/tapestry5/tapestry-core/guide/lifecycle.html

cheers,
Ben


 
 This is strange. If the _person member variable gets reset to
 the default at the end of each request I would expect not to
 see the values from it on my page after submit in the render
 request.
 
 What I want to achieve is very much the same scenario found in
 the documentation section Form Input and Validation, only I
 have several compound objects like `Person'. Since the form
 accesses members of these objects they need to be created in
 the page class. Since the constructor is obviously not the
 right place for this, which one would you suggest?
 
 Cheers,
 
 Martin
 
 -- 
 --- / http://herbert.the-little-red-haired-girl.org / 
 -
 =+= 
 Was ist ein Cluster?
 Wenn vier Bratscher unisono spielen.
 
 -
 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: scrolling window : dojo dialog vs thickbox

2007-05-31 Thread Jesse Kuhnert

p.s. I don't know for sure yet but think there is a very good chance someone
may be fiddling with things a little here and there soon to make prototype
available as well and eliminate the arbitrary inclusion of js on pages not
needing it.

On 5/31/07, Jesse Kuhnert [EMAIL PROTECTED] wrote:


I wasn't suggesting having both running together.   More along the lines
of what I implemented in Tacos originally - which supports both prototype
and dojo - not necessarily strictly one or another.

On 5/31/07, Paul Stanton [EMAIL PROTECTED] wrote:

 well, there's the issue of software bloat as well. I'm sure someone
 could write some components around jquery to rival the dojo components,
 but including both by default would be a bad idea imho.

 is this an issue worth raising with the dojo team? since dojo is the
 chosen javascript platform for tapestry shouldn't we focus on getting it
 up to speed before considering alternatives/compliments?

 Jesse Kuhnert wrote:
  I'd love to be able to support jquery / others as addition javascript
  handlers.  ...Perhaps this is something we can address in the 4.1.3dev
  cycle.


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




--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


Re: Shipwreck when downloading T5.0.5

2007-05-31 Thread Nick Westgate

adasal wrote:

I can use this to run 5.0.4 as per Daniel Jue but I cannot run 5.0.5.
I have cheated(?) and installed 5.0.4 tapestry-core as 5.0.5-SNAPSHOT then
if I e.g. mvn clean install -U this is the console output. It looks for the
corresponding pom which it doesn't find.
Otherwise, without the cheat, it would ask for the 5.0.5-SNAPSHOT be
downloaded manually. I am very unclear how to do that or if that is what I
should do.
In short I don't get how to grab a snapshot using maven. Any ideas?
Adam


You enable snapshots for a particular repository in the pom. In this case:

repository
  snapshotsenabledtrue/enabled/snapshots
  idtapestry-snapshots/id
  urlhttp://people.apache.org/~hlship/tapestry-snapshot-repository//url
/repository

Cheers,
Nick.


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



Re: T5 - Service injection and ioc

2007-05-31 Thread Joshua Jackson

On 6/1/07, vidrilon [EMAIL PROTECTED] wrote:


Did i understood well?? Could you make it work?

I'm also having the same problem, i have created another module,
UserAuthenticatorModule for validating
a login form, but have the same message:

No service implements the interface org.clinica.bd.pages.UserAuthenticator


Did you bind UserAuthenticator to an implementation in your AppModule?

--
YM!: thejavafreak
Blog: http://www.nagasakti.or.id/roller/joshua/

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



T5: File input component

2007-05-31 Thread Joshua Jackson

Dear all,

Does anybody know where is the component or what is the name for the
component for file input in T5? I've been searching through under the
package org.apache.tapestry.corelib.components but could not find it?
Have I missed on something?

Currently I'm using version 5.0.4. Perhaps it is already available in
the snapshot version?

Thanks in advance :)

--
YM!: thejavafreak
Blog: http://www.nagasakti.or.id/roller/joshua/

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



Re: [T5] Beginning Hibernate with a T5 application

2007-05-31 Thread Eugene Lozovan

Don't know, if it might be helpful - http://www.box.net/shared/1yxqpk0jyband
http://new2java.blogspot.com/2007/05/package-orgexampletsa504servicesuseraut.html

E.L.

On 31/05/07, Daniel Jue [EMAIL PROTECTED] wrote:


Hey there

I am considering using Hibernate for part of my applications db
access.  Before I was hand writing DAOs/daofactories, but now the
impedance mismatch is growing too large and I want to try something
different.  With T4, there are plenty of good tapestry/hibernate
resources.

With T5, we have IOC in tapestry-core, and then there is
tapestry-hibernate which is in snapshot mode, but has been described
as a placeholder only a few months ago.

All I'm looking for is something like the hibernate hello world or
some sample code that gets me to a point equivalent to this:

Session session = getSessionCreator().createSession();

After that point I get the impression that the use of hibernate
features will be the same as in T4.  ( I am referencing the ewdt book
for T4)

Can anyone copy and paste some code that does something simple?  It
doesn't need to be a whole app, or a whole class even.

I have a myobject.hbm.xml in the same directory as myobject.java, and
hibernate.cfg.xml / hibernate.properties in resources/ .
I assume those kinds of fundamentals are the same when using T5-Hibernate.

I have Hibernate 3.2.1ga and tapestry-hibernate (5.0.5-SNAPSHOT) in my
pom.

Thanks for any help you can provide me.

Daniel

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




T5: @OnEvent value

2007-05-31 Thread Joshua Jackson

Dear all,

How do I change the default event type action for @OnEvent?

Let's say I have  @OnEvent( value = refresh )
What do I write in the corresponding html page for value?

I tried:
a t:id=select t:type=actionlink *t:value=refresh*${index}/t:comp


But it didn't work. Can anyone tell me how to change the default value of
event type from action to something else.

Thanks in advance.

--
YM!: thejavafreak
Blog: http://www.nagasakti.or.id/roller/joshua/