Tapestry 5.4 URLs on download page

2013-08-27 Thread Steve Eynon
Hi,

I was just wondering if the the T5.4 URLs on:

http://tapestry.apache.org/download.html

could be updated to point to:

https://repository.apache.org/content/groups/staging

For currently, the alpha1 and alpha2 URLs mentioned don't exist.

Steve.


Re: [OT] T5-IoC in Fantom

2013-08-07 Thread Steve Eynon
 No distributed configuration?

Of course there is! Any module from any pod (jar) can contribute to
services defined in any other module from any other pod. That is
distributed configuration, right? That was built in from the get go!

 Well, I hope you had a chance to address some of the things that are not
perfect in T5 IoC!

I addressed a few (of what I felt were) shortcomings, tidied up the API a
little, and tried to keep the API to 'core' functionality. A couple of
subtle differences include:

 - configuration overrides may themselves be overridden
 - ctor params may be passed into Registry.autobuild()
 - emphasis on annotations (facets) and not naming conventions

I learnt a lot from the project and now certainly appreciate the recursive
complexity involved in maintaining an IoC registry!

Cheers,

Steve.
 --
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 7 August 2013 01:05, Howard Lewis Ship hls...@gmail.com wrote:

 No distributed configuration?


 On Tue, Aug 6, 2013 at 5:04 PM, Howard Lewis Ship hls...@gmail.com
 wrote:

  Well, I hope you had a chance to address some of the things that are not
  perfect in T5 IoC!
 
 
  On Tue, Aug 6, 2013 at 4:23 PM, Steve Eynon 
  steve.ey...@alienfactory.co.uk wrote:
 
  Hello,
 
  If imitation is the sincerest form of flattery then T5-IoC has been
 paid a
  huge compliment...
 
  ...there's an IoC in the language Fantom that bears a striking
 resemblance
  to T5-IoC!
 
  afIoc - http://repo.status302.com/doc/afIoc/#overview
 
  I've been an avid fan of Tapestry since v3, and with the advent of T5
 I've
  learnt to adore T5-IoC - the foundation of all my apps (both desktop and
  web). So much so, as I'm now (slowly) moving away from Java, I couldn't
  bear to leave it behind.
 
  As my new language of choice, Fantom http://fantom.org/ , didn't have
 an
  IoC, I took it upon myself to implement one in the image of T5-IoC,
  bringing with it all the goodness T5-IoC provides!
 
  I realise this post is slightly off topic, but I wanted to give
  acknowledgement and thanks to all those inspiring T5-IoC developers,
 your
  ideas are awesome! So, err, thanks!
 
  Um, I'll get my coat...
 
  Steve.
 
  Oh, for those who don't know Fantom, a reasonable quick overview is
 given
  here:
 
 
 http://zeroturnaround.com/rebellabs/the-adventurous-developers-guide-to-jvm-languages-fantom/
 
 
 
 
  --
  Howard M. Lewis Ship
 
  Creator of Apache Tapestry
 
  The source for Tapestry training, mentoring and support. Contact me to
  learn how I can get you up and productive in Tapestry fast!
 
  (971) 678-5210
  http://howardlewisship.com
 



 --
 Howard M. Lewis Ship

 Creator of Apache Tapestry

 The source for Tapestry training, mentoring and support. Contact me to
 learn how I can get you up and productive in Tapestry fast!

 (971) 678-5210
 http://howardlewisship.com



Re: Conditional wrapping html element

2013-08-07 Thread Steve Eynon
You could create a simple component that optionally renders the div
element. Something like:

public class IfDiv {

@Parameter
private boolean test;

void setupRender(MarkupWriter writer) {
  if (test)
writer.element(div);
}

void afterRender(MarkupWriter writer) {
  if (test)
writer.end();
}

}

Steve.

On 7 August 2013 10:54, Dmitry Gusev dmitry.gu...@gmail.com wrote:

 Or you can use blocks and delegate:

 t:block id=contentBlock
 Your content
 /t:block

 t:if test=condition
 div class=cssclass
 t:delegate to=block:contentBlock /
 /div
 p:else
 t:delegate to=block:contentBlock /
 /p:else
 /t:if

 On Wed, Aug 7, 2013 at 1:47 PM, Lance Java lance.j...@googlemail.com
 wrote:

  You'll have to use the OutputRaw component or MarkupWriter.writeRaw(...)
 
  Note that when passing the value parameter to OutputRaw you will need to
  escape ,  and 
   On 7 Aug 2013 10:33, Nathan Quirynen nat...@pensionarchitects.be
  wrote:
 
   Hi,
  
   I want to add a div that wraps my content based on a condition:
  
   t:if test=test
   div class=cssclass
   /t:if
  
   ... content ...
  
   t:if test=test
   /div
   /t:if
  
  
   This is not possible as it will give following exception:
  
   /org.xml.sax.**SAXParseException/
   /The element type div must be terminated by the matching end-tag
   /div.
  
   /For my use case I can make a property for the css class and base it on
   the condition:
  
   div class=${cssClass}
   ... content ...
   /div
  
   public String getCssClass() {
   return test ? cssclass : ;
   }
  
   But I was just wondering if there is a way of adding a wrapping element
   conditionally as I showed at the top.
  
   Nathan
  
  
 



 --
 Dmitry Gusev

 AnjLab Team
 http://anjlab.com



[OT] T5-IoC in Fantom

2013-08-06 Thread Steve Eynon
Hello,

If imitation is the sincerest form of flattery then T5-IoC has been paid a
huge compliment...

...there's an IoC in the language Fantom that bears a striking resemblance
to T5-IoC!

afIoc - http://repo.status302.com/doc/afIoc/#overview

I've been an avid fan of Tapestry since v3, and with the advent of T5 I've
learnt to adore T5-IoC - the foundation of all my apps (both desktop and
web). So much so, as I'm now (slowly) moving away from Java, I couldn't
bear to leave it behind.

As my new language of choice, Fantom http://fantom.org/ , didn't have an
IoC, I took it upon myself to implement one in the image of T5-IoC,
bringing with it all the goodness T5-IoC provides!

I realise this post is slightly off topic, but I wanted to give
acknowledgement and thanks to all those inspiring T5-IoC developers, your
ideas are awesome! So, err, thanks!

Um, I'll get my coat...

Steve.

Oh, for those who don't know Fantom, a reasonable quick overview is given
here:
http://zeroturnaround.com/rebellabs/the-adventurous-developers-guide-to-jvm-languages-fantom/


Re: TapestryIoC: Is it possible to receive an OrderedConfiguration's ID?

2013-03-17 Thread Steve Eynon
Nothing specific that I know of...

...you could iterate over the ServiceActivities in the
ServiceActivityScoreboard service looking for a matching service
interface and take the ID from there. It's not nice, but as long as
you know the type of the service, it should work.

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



Re: Read only bindings - How do I set their value from a mixin?

2013-03-16 Thread Steve Eynon
Here's the thread where I ran into the problem:

http://tapestry.1045711.n5.nabble.com/How-to-set-the-translate-parameter-tt5719495.html

Luckily, for my use case, I was able to Munky Patch T5.

Steve.

On 16 March 2013 05:25, trsvax trs...@gmail.com wrote:
 I ran into this problem also. I think you might be able to create a different
 binding prefix like default: that is writable and change the default to use
 that prefix. This is still on my todo list because I'd like to do the same
 thing.



 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Read-only-bindings-How-do-I-set-their-value-from-a-mixin-tp5720446p5720486.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: TapestryIoC: Is it possible to receive an OrderedConfiguration's ID?

2013-03-15 Thread Steve Eynon
No, but if your contribution is a service then you can inject the
ServiceId using the @Symbol annotation:

http://tapestry.apache.org/symbols.html#Symbols-InjectingValuesfromSymbols

Steve.


On 15 March 2013 11:26, Eli Doran e...@elidoran.com wrote:
 When using OrderedConfiguration the add method's first argument is an ID.
 Is it possible to inject that ID into the corresponding instance's
 constructor?

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



Re: Read only bindings - How do I set their value from a mixin?

2013-03-14 Thread Steve Eynon
Is there any reason the following doesn't work?

public static void
contributeApplicationDefaults(MappedConfigurationString, String
config) {
config.add(ComponentParameterConstants.GRID_PAGER_POSITION, NONE);
}

From GridPagerPosition:

NONE = Don't show a pager (the application will need to supply its own
navigation mechanism).

Steve.


On 15 March 2013 02:17, Lance Java lance.j...@googlemail.com wrote:
 I'm actually trying to set the rowsPerPage parameter on a grid to Integer.
 MAX_VALUE to effectively disable paging. It might be controversial but what
 if AbstractBinding wrote to a ThreadLocal?


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



Re: Read only bindings - How do I set their value from a mixin?

2013-03-14 Thread Steve Eynon
Okay, add the following to App Defaults then: (!)

config.add(ComponentParameterConstants.GRID_ROWS_PER_PAGE, Integer.MAX_VALUE);

I usually set the number to 500 or some other large number. Big enough
so you rarely see it, but if you do happen to get 1000s of rows, then
your HTML doesn't bloat to several Mb and clog up the browser
renderer!

Steve.

On 15 March 2013 08:04, Lance Java lance.j...@googlemail.com wrote:
 Your suggestion only removes the navigation so I can only assume it would be
 impossible to see the second page of data. I want all the data in a single
 page so that navigation is not required.



 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Read-only-bindings-How-do-I-set-their-value-from-a-mixin-tp5720446p5720465.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Triggering a form submission via JavaScript in 5.4-alpha2

2013-03-10 Thread Steve Eynon
Oh, I see - you have inline javascript in the onchange handler. I
don't think that's going to work - you need to wrap the element in T5s
core DOM which is defined by RequireJS:

http://people.apache.org/~hlship/t5api/coffeescript/t5-core-dom-prototype.html

Do this instead:

/META-INF/modules/formSubmitter.js

define([t5/core/dom], function(t5) {
  return function(selectClientId) {
return t5(selectClientId).on('change', function(e) {
  var form = this.findParent(form);
  return form.trigger(submit);
});
  };
});

Or use CoffeeScript:

/META-INF/modules/formSubmitter.coffee

define [t5/core/dom], (t5) -
return (selectClientId) -
t5(selectClientId).on 'change', (e) -
form = this.findParent(form)
form.trigger submit

Then in a render phase method in your component / page:

jsSupport.require(formSubmitter).with(select.getClientId());

Steve.


On 11 March 2013 02:32, Lenny Primak lpri...@hope.nyc.ny.us wrote:
 In 5.3, you had to do setSubmittingElement().  Not sure if this applies still 
 in 5.4, but if it does,
 it will need to be called.

 On Mar 10, 2013, at 1:39 PM, Lance Java wrote:

 You need to fire the click event on the submit button, not submit.


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



Re: Triggering a form submission via JavaScript in 5.4-alpha2

2013-03-10 Thread Steve Eynon
Yeah, sometimes quick fixes, well, aren't!

But cool. As you're using Zones I'll mention another trick...

If you put the event handler on the document, or some parent element
that doesn't get updated, then you don't have to re-apply the event
handler on every zone / ajax update.

e.g. the following will submit the form on all select change events
and you only ever need to call jsSupport.require() once when the page
loads:

define [t5/core/dom], (t5) -
  return -
t5.onDocument change, select, (e) -
  form = this.findParent(form)
  form.trigger submit

Steve.


On 11 March 2013 09:06, Bob Harner bobhar...@gmail.com wrote:
 Steve,

 Yeah, I hadn't gotten around to switching this code to unobtrusive
 JavaScript yet and was hoping for a quick substitute.

 Your code did the trick, it works perfectly.

 Of course, I'll still need to adjust the module to set up a additional
 event handlers for other events, but I guess I can figure that out
 (i.e. Initialize#invoke(String)) now that you've given me a good
 start.

 Thanks!

 On Sun, Mar 10, 2013 at 8:28 PM, Steve Eynon
 steve.ey...@alienfactory.co.uk wrote:
 Oh, I see - you have inline javascript in the onchange handler. I
 don't think that's going to work - you need to wrap the element in T5s
 core DOM which is defined by RequireJS:

 http://people.apache.org/~hlship/t5api/coffeescript/t5-core-dom-prototype.html

 Do this instead:

 /META-INF/modules/formSubmitter.js

 define([t5/core/dom], function(t5) {
   return function(selectClientId) {
 return t5(selectClientId).on('change', function(e) {
   var form = this.findParent(form);
   return form.trigger(submit);
 });
   };
 });

 Or use CoffeeScript:

 /META-INF/modules/formSubmitter.coffee

 define [t5/core/dom], (t5) -
 return (selectClientId) -
 t5(selectClientId).on 'change', (e) -
 form = this.findParent(form)
 form.trigger submit

 Then in a render phase method in your component / page:

 jsSupport.require(formSubmitter).with(select.getClientId());

 Steve.


 On 11 March 2013 02:32, Lenny Primak lpri...@hope.nyc.ny.us wrote:
 In 5.3, you had to do setSubmittingElement().  Not sure if this applies 
 still in 5.4, but if it does,
 it will need to be called.

 On Mar 10, 2013, at 1:39 PM, Lance Java wrote:

 You need to fire the click event on the submit button, not submit.


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


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


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



Re: Triggering a form submission via JavaScript in 5.4-alpha2

2013-03-09 Thread Steve Eynon
Try this:

  this.form.fire(submit)

I've not tried it, but I was looking at:
http://people.apache.org/~hlship/t5api/coffeescript/forms.html

Steve.
---
If at first you don't succeed,
   so much for skydiving!

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



Re: RadioGroup disable bug(?)

2013-03-05 Thread Steve Eynon
Looking at the RadioGroup code I think you're right. It has a somewhat
unused 'disabled' field and there is no code that prevents
processSubmission() from being called.

Steve.


On 4 March 2013 20:45, Erik Östman erik.ost...@cerion.fi wrote:
 Hey,

 I have a problem with a RadioGroup where the setter is called (with null 
 value) on form submit even though the RadioGroup is disabled.
 This behavior makes the RadioGroup change its value from True to False on 
 submit.

 Seems like the Disable logic is in AbstractField and RadioGroup extends 
 Field, or am I missing something?


 /Erik Östman


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



Re: The tml file is not being rendered properly

2013-03-05 Thread Steve Eynon
Erm... is this not a Velocity question rather than a Tapestry one?


On 5 March 2013 16:07, harishpatarla harishpata...@gmail.com wrote:




 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/The-tml-file-is-not-being-rendered-properly-tp5720336p5720337.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



[T5.4-alpha-2] w jQuery Infrastructure - Checkboxes are always checked

2013-02-14 Thread Steve Eynon
t:checkboxes ... are always submitted as checked. Boils down to a
bug in the value() function in t5-core-dom-prototype.coffee.

The value() function assumes the $.val() function works for all input
elements, which is not the case. See http://api.jquery.com/val/

As a workaround I've patched my value() function with this:

value: (newValue) -
  current = @$.val()

#  MUNKY PATCH 
  if @$.attr(type) == checkbox
current = @$.attr(checked)
#  MUNKY PATCH 

  if arguments.length  0
@$.val newValue

  return current

There's probably a better way to do with $ selectors, but not being a
jQuery expert I don't know how to extend the current selected object.

Steve.

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



Re: Tapestry-5.4-alpha-2 css overriding

2013-02-09 Thread Steve Eynon
There are few T5.4-a2 components (that I seem to use) that pull in the
core stack which then imports the bootstrap.css. Alerts is one of
them, which I've Munky Patched not to. You're then free to import
whatever CSS you want in whatever order as per usual.

Another option (which I also do to keep the exception screens looking
pretty) is to define your own Bootstrap asset dir:

@Contribute(SymbolProvider.class) @ApplicationDefaults
public static void
contributeApplicationDefaults(MappedConfigurationString, String
config) {
// use a newer version of bootstrap
config.add(SymbolConstants.BOOTSTRAP_ROOT,
classpath:/META-INF/assets/bootstrap-2.2.2);
}

Steve.



On 9 February 2013 20:54, Lance Java lance.j...@googlemail.com wrote:
 If I was to take a guess, it would be the new usage of require.js in tapestry
 5.4. Tapestry has defined a bootstrap module. You might need to define a
 module which depends on the bootstrap module to guarantee that yours is
 loaded after bootstrap.

 As I said, this is a guess... I've not yet dug too far in this area yet
 myself.



 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Tapestry-5-4-alpha-2-css-overriding-tp5719856p5719904.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



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

2013-02-05 Thread Steve Eynon
Assuming the SettingsService resides in the same module, try this:

public static void contributeApplicationDefaults(MappedConfiguration
configuration, @Local SettingsService settings) {
settings.getString(UISymbolConstants.SUPPORTED_LOCALES, de,en));
}

the @Local annotation tells T5 not to look elsewhere for the service definition.

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!

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



Re: Disable operations caused due to back and forward buttons

2013-01-31 Thread Steve Eynon
As it's a server side process you're trying to protect, store a flag
in the session when the user has clicked Run. Then before you kick
off the process again, check the status of the flag.

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



Re: [T5.4-alpha-2] Ajax alerts not rendered after a call to dismissAll()

2013-01-31 Thread Steve Eynon
 Can you please open an issue and attach the patch there?

https://issues.apache.org/jira/browse/TAP5-2062

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



[T5.4-alpha-2] Ajax alerts not rendered after a call to dismissAll()

2013-01-30 Thread Steve Eynon
When first rendered via a call to setupUI the alerts HTML looks like:

div data-container-type=alerts
  div class=well
div data-container-type=inner
  ... alerts ...
/div
  /div
/div

After a call to dismissAll() the HTML looks like:

div data-container-type=alerts
/div

With the inner container nowhere to be found. So when an attempt is
next made to show an alert after an ajax call:

(t5/core/alert.coffee)

alert = (data) -
  container = findInnerContainer()
  return unless container
  ...

Eeek! No container! So alert() just exits.

Should I raise a JIRA?

While someone is on the alert.coffee code, could you add a warn
class to the severityToClass object... pretty please!

Steve.

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



Re: parameter in tml page?

2013-01-29 Thread Steve Eynon
Okay, I getcha. You can use String literals if that helps...

e.g. ${getObject('bob')}

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



Re: 5.4 - Javascript best practices

2013-01-29 Thread Steve Eynon
I've just noticed that @Import now has a module parameter, that can
be used for modules  methods that take no parameters.

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



Re: tapestry jQuery theme

2013-01-28 Thread Steve Eynon
I'm assuming you know that, by default, T.3 doesn't use jQuery - so
which library are you using to import jQuery.

Could you be more specific with your question?

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



Re: How to get code coverage of Integration Test ?

2013-01-28 Thread Steve Eynon
T5 instruments pages and components itself and uses it's own class
loader to reload them, so it's very unlikely Sonar is able to hook
that. (Not that I know anything of Sonar.)

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



Re: 5.4 - Javascript best practices

2013-01-27 Thread Steve Eynon
Good questions - I had to work this out myself when moving to T5.4!

Yes, I personally consider @Import'ing JS deprecated - though it is
still valid if you don't wish to use RequireJS.

In your component put:

JSONObject params = new JSONObject();
jsSupport.require(alienfactory/stuff).with(params);

then create the JS file:
/META-INF/modules/alienfactory/stuff.js

define([jquery, t5/core/console, bootstrap], function($, console) {
  return function(params) {
console.warn(jQuery version:  + $().jquery);
  };
});

The above will give you access to jQuery (assuming you've chosen it as
your SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER), will also
inject the T5 logger and ensure the bootstrap module is loaded and
initialised before calling your function.

If you want multiple functions, i.e.

jsSupport.require(alienfactory/stuff).invoke(f2);

then your JS module looks more like:

define([jquery, t5/core/console, bootstrap], function($, console) {
  return {
f1: function() { .. }
f2: function() { .. }
  };
});

CoffeeScript, if you wanna get into it, makes everything look a lot neater!

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 27 January 2013 20:30, Lance Java lance.j...@googlemail.com wrote:
 I'm using the new 5.4-alpha-2 and I'm not 100% sure how I should be managing
 my javascript. I'm a require.js newbie and I've got a few questions:

 1. Are @Import(library=x) and JavascriptSupport.importJavaScriptLibrary(x)
 now considered deprecated or are there still valid use cases?

 2. What would a best-practice hello world component look like if it
 requires one of the existing modules (eg bootstrap.js)

 3. What would a best-practice hello world component look like if it does
 not require any other modules.

 Thanks,
 Lance.



 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/5-4-Javascript-best-practices-tp5719568.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: 5.4 - Javascript best practices

2013-01-27 Thread Steve Eynon
My last email assumes your RequireJS modules live in the
/META-INF/modules/ dir and follow the same naming convention. If
that's not the case then you can 'Alias' your module.

define([highcharts], function(highcharts) { ... }

If 'highcharts' lives elsewhere I can re-route the call to
/META-INF/modules/highcharts like this:

@Contribute(ModuleManager.class)
public static void
configureHighchartModule(MappedConfigurationString, Object config,
AssetSource assetSource) {
// injecting @Path(classpath:/) Resource context gives a service
// recursion error during tests - so we use AssetSource instead
Resource classpath = assetSource.resourceForPath(classpath:/);

Resource highcharts =
classpath.forFile(/META-INF/assets/highcharts-2.3.5/highcharts.js);
config.add(highcharts, new
JavaScriptModuleConfiguration(highcharts).exports(Highcharts));
}

Steve.



On 27 January 2013 23:13, Steve Eynon steve.ey...@alienfactory.co.uk wrote:
 Good questions - I had to work this out myself when moving to T5.4!

 Yes, I personally consider @Import'ing JS deprecated - though it is
 still valid if you don't wish to use RequireJS.

 In your component put:

 JSONObject params = new JSONObject();
 jsSupport.require(alienfactory/stuff).with(params);

 then create the JS file:
 /META-INF/modules/alienfactory/stuff.js

 define([jquery, t5/core/console, bootstrap], function($, console) {
   return function(params) {
 console.warn(jQuery version:  + $().jquery);
   };
 });

 The above will give you access to jQuery (assuming you've chosen it as
 your SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER), will also
 inject the T5 logger and ensure the bootstrap module is loaded and
 initialised before calling your function.

 If you want multiple functions, i.e.

 jsSupport.require(alienfactory/stuff).invoke(f2);

 then your JS module looks more like:

 define([jquery, t5/core/console, bootstrap], function($, console) {
   return {
 f1: function() { .. }
 f2: function() { .. }
   };
 });

 CoffeeScript, if you wanna get into it, makes everything look a lot neater!

 Steve.
 --
 Steve Eynon
 ---
 If at first you don't succeed,
so much for skydiving!



 On 27 January 2013 20:30, Lance Java lance.j...@googlemail.com wrote:
 I'm using the new 5.4-alpha-2 and I'm not 100% sure how I should be managing
 my javascript. I'm a require.js newbie and I've got a few questions:

 1. Are @Import(library=x) and JavascriptSupport.importJavaScriptLibrary(x)
 now considered deprecated or are there still valid use cases?

 2. What would a best-practice hello world component look like if it
 requires one of the existing modules (eg bootstrap.js)

 3. What would a best-practice hello world component look like if it does
 not require any other modules.

 Thanks,
 Lance.



 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/5-4-Javascript-best-practices-tp5719568.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: parameter in tml page?

2013-01-27 Thread Steve Eynon
Could you use:

ComponentResources.getInformalParameter(String name, ClassT type);

???

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 27 January 2013 22:18, sommeralex alexander.som...@gmail.com wrote:
 i dont wont a page property, i want to define the parameter dynamically in
 the TML page itself.

 but it seems that this is not possible.






 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/parameter-in-tml-page-tp5719561p5719574.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: 5.4 - Javascript best practices

2013-01-27 Thread Steve Eynon
Yup. That's right.


On 28 January 2013 00:00, Lance Java lance.j...@googlemail.com wrote:
 Thanks Steve, I've lost a few hours trying to figure this out.

 So I only need to contribute to ModuleManager if I don't follow the
 convention? (ie module foo is located at /META-INF/modules/foo.js).



 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/5-4-Javascript-best-practices-tp5719568p5719579.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Tapestry 5 book is here

2013-01-25 Thread Steve Eynon
Nice! You get even your own personalised PDF copy!

Sweet!
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 25 January 2013 17:20, Igor Drobiazko igor.drobia...@gmail.com wrote:
 Dear Tapestry community,

 I'm glad to announce that the long awaited Tapestry 5 book is now available
 for purchase as paperback:

 http://blog.tapestry5.de/index.php/2013/01/25/tapestry-5-book-is-here/

 Enjoy reading

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



[T5.4-alpha-2] Alerts CSS BootStrap Styling

2013-01-24 Thread Steve Eynon
Hiya,

When I use the t:alerts component, it @Imports the core stack, which
has the side effect of bringing in the bootstrap.css - which
*radically* alters the layout of my page!

Bringing in the massive bootstrap.css for whole T5 pages such as the
exception page is great, but for components, would we not want to tone
it down a bit?

In this instance, where alert styling is part of a bigger visual
scheme, I'm not sure if it's possible to only have an alerts CSS
subset that's meaningful without the rest. Maybe have a means for
components to opt in / out of pulling in their CSS?

(By the way, I have a workaround, I'm just pointing stuff out for discussion.)

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!

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



Re: [T5.4-alpha-2] Alerts CSS BootStrap Styling

2013-01-24 Thread Steve Eynon
Oh, and could:

severityToClass =
  info: alert alert-info

be added to the t5/core/alert module to add some styling for info alerts.

Cheers.

On 24 January 2013 20:04, Steve Eynon steve.ey...@alienfactory.co.uk wrote:
 Hiya,

 When I use the t:alerts component, it @Imports the core stack, which
 has the side effect of bringing in the bootstrap.css - which
 *radically* alters the layout of my page!

 Bringing in the massive bootstrap.css for whole T5 pages such as the
 exception page is great, but for components, would we not want to tone
 it down a bit?

 In this instance, where alert styling is part of a bigger visual
 scheme, I'm not sure if it's possible to only have an alerts CSS
 subset that's meaningful without the rest. Maybe have a means for
 components to opt in / out of pulling in their CSS?

 (By the way, I have a workaround, I'm just pointing stuff out for discussion.)

 Steve.
 --
 Steve Eynon
 ---
 If at first you don't succeed,
so much for skydiving!

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



How to set the translate parameter?

2013-01-24 Thread Steve Eynon
Here's a puzzler...

I've extended AbstractTextField and I want to set the translate
@Parameter from within my subclass. Given this parameter is private in
the superclass, how may I do it?

I went as far as making a mixin to set a bound translate parameter on
setupRender, e.g.

@BindParameter
private FieldTranslatorObject translate;

But that gave this error:

Failure writing parameter 'translate' of component
Binding InvariantBinding[default translator, parameter value is read-only.

Due to the defaultTranslate in AbstractTextField being a Binding.

final Binding defaultTranslate() {...}

Anyone any ideas?

Steve.

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



Re: [5.4-alpha-2] Environment cloaked during ajax component event

2013-01-24 Thread Steve Eynon
This came in around T5.3, I believe the cloak / de-cloak was put in
for Ajax requests so the environment used in the action phase didn't
leak into the render phase.

Steve.

On 25 January 2013 01:31, Lance Java lance.j...@googlemail.com wrote:
 Considering the simplified example below, can someone please tell me why the
 environmental peekable for a page render request but not peekable for an
 ajax event? Upon debugging, I have found that if I decloak() the
 environment, I can then peek() the model.

 Page.tml
 ==
 t:myComponent
t:subComponent /
 /t:myComponent

 MyComponent.tml
 =
 t:zone t:id=zone


t:delegate to=componentResources.body /

t:eventlink event=doIt zone=^Do It/t:eventlink
 /t:zone

 MyComponent.java
 ==
@Inject Environment environment;
@InjectComponent Zone zone;
void onActivate() {
   environment.push(SomeModel.class, new SomeModelImpl());
}

Block onDoIt() {
   environment.push(SomeModel.class, new SomeModelImpl());
   return zone.getBody();
}

 MySubComponent.java
 =
@Inject Environment environment;

void setupRender() {
   SomeModel model = environment.peek(SomeModel.class); // this works for
 the non-ajax request
   if (model == null) { // model is null for my ajax event
  environment.decloak(); // this causes all sorts of problems further
 down the line
  model = environment.peek(SomeModel.class); // this returns my model
 for the ajax event
   }
}




 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/5-4-alpha-2-Environment-cloaked-during-ajax-component-event-tp5719496.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Tapestry Session Service

2013-01-24 Thread Steve Eynon
I'm guessing the reason why you can't inject the Session is exactly
for the reason you stated - how do you inject it if you don't want it
to be created?

Can't say I've ever explicitly needed the Session obj myself - see here:
http://tapestry.apache.org/session-storage.html

As to why it's in the service package - well, I could ask the same of
the @Traditional and @Core annotations. I guess because they relate to
services if not actually a T5 service themselves.

Steve.



On 25 January 2013 00:03, Matías Blasi matias.bl...@gmail.com wrote:
 Hi all!

 I'm a little stuck with trying to inject the Tapestry Session Service
 (org.apache.tapestry.services.Session)

 I simply added in my page:

 @Inject
 private Session session;

 I'm getting:

 Caused by: java.lang.RuntimeException: No service implements the interface
 org.apache.tapestry5.services.Session.
 at
 org.apache.tapestry5.ioc.internal.RegistryImpl.getServiceByTypeAlone(RegistryImpl.java:664)
 at
 org.apache.tapestry5.ioc.internal.RegistryImpl.getServiceByTypeAndMarkers(RegistryImpl.java:684)
 at
 org.apache.tapestry5.ioc.internal.RegistryImpl.getService(RegistryImpl.java:643)
 at
 org.apache.tapestry5.ioc.internal.ObjectLocatorImpl.getService(ObjectLocatorImpl.java:47)
 at
 org.apache.tapestry5.internal.services.ServiceInjectionProvider.provideInjection(ServiceInjectionProvider.java:43)
 at $InjectionProvider2_ac1a0adc404.provideInjection(Unknown Source)
 at $InjectionProvider2_ac1a0adc3d0.provideInjection(Unknown Source)
 at
 org.apache.tapestry5.internal.transform.InjectWorker$2.run(InjectWorker.java:73)
 ... 127 more

 Is there any particular thing with the session service?

 I was able to get it by injecting the Request service, and asking for the
 session through it (with no forced creation), and it worked! I browsed into
 the code, and it is asking for the session to the TapestrySessionFactory
 service...

 If we cannot @Inject the Session, should it be in the .services interfaces
 package?

 Regards,
 Matias.

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



Re: How to set the translate parameter?

2013-01-24 Thread Steve Eynon
I got round this by Munky Patching AbstractTextField so that

final Binding defaultTranslate() {...}

becomes

protected Binding defaultTranslate() {...}

and overriding it in my subclass:

@Override
protected Binding defaultTranslate() {
String description = String.format(default translator,
'teacherKey' of %s, resources.getCompleteId());
return new InvariantBinding(resources.getLocation(),
FieldTranslator.class, description) {
@Override
public Object get() {
return fieldTranslatorSource.createTranslator(resources,
teacherKey);
}
};
}

Is there any reason for the default translate to be package protected
AND final??

is it okay if I make a JIRA asking for it to be protected scope and
non-final? (It's a 9 character change!)

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 25 January 2013 01:26, Steve Eynon steve.ey...@alienfactory.co.uk wrote:
 Here's a puzzler...

 I've extended AbstractTextField and I want to set the translate
 @Parameter from within my subclass. Given this parameter is private in
 the superclass, how may I do it?

 I went as far as making a mixin to set a bound translate parameter on
 setupRender, e.g.

 @BindParameter
 private FieldTranslatorObject translate;

 But that gave this error:

 Failure writing parameter 'translate' of component
 Binding InvariantBinding[default translator, parameter value is read-only.

 Due to the defaultTranslate in AbstractTextField being a Binding.

 final Binding defaultTranslate() {...}

 Anyone any ideas?

 Steve.

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



Re: T5.4-alpha-2: Module Initialization Priority / Order

2013-01-18 Thread Steve Eynon
The priority ordering is lost when the call is handed over to
RequireJS from pageinit:invokeInitializer().

There's a shed load of code on the server side to ensure the priority
ordering is kept.
The generated page init JSON is in the correct order.
The initialisation code is called in the correct order.
But pageinit:invokeInitializer() doesn't actually invoke the
initializer. It calls require() which seems to store a callback to be
executed sometime later.

I'm guessing the random execution order is due to the async nature of
the modules being loaded.

Being new to AMD and RequireJS I don't know how to go about fixing
this. Should I raise a JIRA?

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 17 January 2013 13:32, Steve Eynon steve.ey...@alienfactory.co.uk wrote:
 Hiya,

 I have the following in a component:

 void setupRender() {
 
 jsSupport.require(af/highcharts/theme/darkGreen).priority(InitializationPriority.EARLY);
 jsSupport.require(af/highcharts/lineChart).with(params);
 }

 and yet the theme module is still called *after* the lineChart. From
 Firefox console:

 Invoking af/highcharts/lineChart({ ... })
 Invoking af/highcharts/theme/darkGreen()

 Is this because one module is invoked with params and the other
 without? The component is used several times on the same page,
 resulting in many calls to require the same modules.

 Steve.
 P.S. So far I'm liking the use of RequireJS - I get a cosy feeling
 from having my dependencies injected into my JS modules, it's like an
 IoC for JS!
 --
 Steve Eynon
 ---
 If at first you don't succeed,
so much for skydiving!

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



Re: T5.4-alpha-2: Module Initialization Priority / Order

2013-01-18 Thread Steve Eynon
 If possible, change your module to not care about order.

Hmm... that reminds me of:

Patient: Doctor, doctor! It hurts when I do this
Doctor: Well don't do it then!

After realising this has to be a common issue with RequireJS, I
figured it must have been already solved. And in some way it is, via
the depends / define mechanism:

If module B needs to run after module A, then module B depends on
module A. If you update your module B definition to:

define [jquery, A], ($) - # note A is not even given a
variable declaration

then it seems all calls to module A are executed before module B.

Note it doesn't matter what dependencies I declare in my
JavaScriptModuleConfigurations, the only change that makes a
difference is in the JS define signature. (Which does lead me to ask
why I need to declare my dependencies in two different places - in the
JS and the TapestryModule.)

While this works well, it is not idea for my use case; which is
optionally loading skins for a charting framework. Each skin is a
separate module / file and I make a call to initialise the one being
used. But because the modules are static files, I now need to depend
on / and download ALL the skins before initialising the one in use.

I guess I'm after some kind of dynamic / runtime dependency, which is
what the InitialisationPriority gave me.

 However, I'm thinking about scanning the inits and doing a pre-load pass,
 where it artifically forces all the dependencies to be loaded before
 invoking any inits

While that would work, surely you'd loose some of the speed benefits
of using AMD? As waiting for everything to download first is
technically not much better than a window.load mechanism.

You could do a pre-load pass for each of the InitialisationPriorites
(early, norm  late) but then I feel you'd be fighting the RequireJS
way of things.

I think what is in place is good, only the InitialisationPriority
should probably be scrapped (it always seemed like a course grained
cludge to me anyway) and the depends mechanism probably needs a little
more thought / love.

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 19 January 2013 01:51, Howard Lewis Ship hls...@gmail.com wrote:
 Yes, lots of async going on, so the dependencies of the modules may cause
 the module's exporting function (the thing you pass to define() as the
 second parameter) to occur in an unpredictable order.

 If possible, change your module to not care about order.

 However, I'm thinking about scanning the inits and doing a pre-load pass,
 where it artifically forces all the dependencies to be loaded before
 invoking any inits. Still thinking about that ... as in, should it be
 necessary?  Are the modules and logic broken if such a phase is necessary?

 On Fri, Jan 18, 2013 at 12:19 AM, Steve Eynon 
 steve.ey...@alienfactory.co.uk wrote:

 The priority ordering is lost when the call is handed over to
 RequireJS from pageinit:invokeInitializer().

 There's a shed load of code on the server side to ensure the priority
 ordering is kept.
 The generated page init JSON is in the correct order.
 The initialisation code is called in the correct order.
 But pageinit:invokeInitializer() doesn't actually invoke the
 initializer. It calls require() which seems to store a callback to be
 executed sometime later.

 I'm guessing the random execution order is due to the async nature of
 the modules being loaded.

 Being new to AMD and RequireJS I don't know how to go about fixing
 this. Should I raise a JIRA?

 Steve.
 --
 Steve Eynon
 ---
 If at first you don't succeed,
so much for skydiving!



 On 17 January 2013 13:32, Steve Eynon steve.ey...@alienfactory.co.uk
 wrote:
  Hiya,
 
  I have the following in a component:
 
  void setupRender() {
 
 jsSupport.require(af/highcharts/theme/darkGreen).priority(InitializationPriority.EARLY);
  jsSupport.require(af/highcharts/lineChart).with(params);
  }
 
  and yet the theme module is still called *after* the lineChart. From
  Firefox console:
 
  Invoking af/highcharts/lineChart({ ... })
  Invoking af/highcharts/theme/darkGreen()
 
  Is this because one module is invoked with params and the other
  without? The component is used several times on the same page,
  resulting in many calls to require the same modules.
 
  Steve.
  P.S. So far I'm liking the use of RequireJS - I get a cosy feeling
  from having my dependencies injected into my JS modules, it's like an
  IoC for JS!
  --
  Steve Eynon
  ---
  If at first you don't succeed,
 so much for skydiving!

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




 --
 Howard M. Lewis Ship

 Creator of Apache Tapestry

 The source for Tapestry training, mentoring and support. Contact me to
 learn how I can

Re: 5.4-alpha-2 Render queue error in BeginRender

2013-01-17 Thread Steve Eynon
Works fine for me (T5.4-alpha-2) - could it be something to do with
your layout component?

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 18 January 2013 00:41, sthomps stho...@gmail.com wrote:
 Trying to get forms working with 5.4.

 Here's my Page



 Here's my markup



 Here's the stacktrace





 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/5-4-alpha-2-Render-queue-error-in-BeginRender-tp5719363.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: 5.4-alpha-2 quickstart

2013-01-17 Thread Steve Eynon
I had a current project using T5.3 (built by gradle). For that I
simply changed the version to 5.4-alpha-2 and added the following to
my list of repositories:

// for T5.4-alpha-2
mavenRepo url: 
'https://repository.apache.org/content/repositories/orgapachetapestry-096/'

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 11 January 2013 04:48, sthomps stho...@gmail.com wrote:
 And as soon as I reply, I find the classes in the annotations jar - packaging
 ioc. threw me off on these two.

 Question still stands though on instructions to get these alphas up and
 running quickly.

 Thanks



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

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


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



Re: 5.4-alpha-2 Render queue error in BeginRender

2013-01-17 Thread Steve Eynon
As long as your custom client side component library plays nicely when
jQuery is in noConflictMode, then there are no issues using T5 /
Prototype and jQuery together.



On 18 January 2013 01:25, sthomps stho...@gmail.com wrote:
 The problem is we have a custom client side component library that includes
 jquery.  It was not playing nice with the default prototype support in 5.3
 so with the 5.4 changes, I wanted to explore this route.

 If no one has an idea on the stacktrace, I'll go back to 5.3 and try this
 out

 http://tapestry5-jquery.com/





 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/5-4-alpha-2-Render-queue-error-in-BeginRender-tp5719363p5719370.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



T5.4-alpha-2: Module Initialization Priority / Order

2013-01-16 Thread Steve Eynon
Hiya,

I have the following in a component:

void setupRender() {

jsSupport.require(af/highcharts/theme/darkGreen).priority(InitializationPriority.EARLY);
jsSupport.require(af/highcharts/lineChart).with(params);
}

and yet the theme module is still called *after* the lineChart. From
Firefox console:

Invoking af/highcharts/lineChart({ ... })
Invoking af/highcharts/theme/darkGreen()

Is this because one module is invoked with params and the other
without? The component is used several times on the same page,
resulting in many calls to require the same modules.

Steve.
P.S. So far I'm liking the use of RequireJS - I get a cosy feeling
from having my dependencies injected into my JS modules, it's like an
IoC for JS!
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!

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



Re: Ioc Ordering Contraints

2012-09-10 Thread Steve Eynon
Hi Robert,

I had previously tried before:UnclaimedField, after:* - but
doesn't matter which way round the constraints go, I still get:

Unable to add 'ContextNotRequiredWorker' as a dependency of
'UnclaimedField', as that forms a dependency cycle ('UnclaimedField'
depends on itself via 'ContextNotRequiredWorker'). The dependency has
been ignored.

Steve.

On 10 September 2012 19:37, Robert Zeigler robert.zeig...@roxanemy.com wrote:
 Hi Steve, have you tried specifying after:*, before:UnclaimedField?

 Robert

 On Sep 9, 2012, at 9/99:33 PM , Steve Eynon wrote:

 Hi Michael,

 just specify as many as are important to you.

 I kinda want mine to run last, because I need make sure no other
 workers (in T5 or other modules) add a onActivate() method. The issue
 here is that both my 'ContextNotRequiredWorker' and T5's
 'UnclaimedField' want to run last - which isn't allowed.

 the trick is to specify multiple constraints

 I could specify many after clauses for T5 workers as you mention,
 but that then won't (be guaranteed to) work if some other another
 module adds an onActivate() method.

 Stumpted,

 Steve.
 --
 Steve Eynon
 ---
 If at first you don't succeed,
   so much for skydiving!



 On 10 September 2012 10:13, Michael Prescott
 michael.r.presc...@gmail.com wrote:
 Michael

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



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


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



Re: Ioc Ordering Contraints

2012-09-10 Thread Steve Eynon
 I think you are looking for the ultimate solution here that doesn't exist.

Yeah, maybe. Sigh. :`(

I guess I was jus' hoping I'd overlooked something.

Nevermind, I'll live! :)

Cheers to all for the suggestions.

Steve.

On 10 September 2012 23:27, Lenny Primak lpri...@hope.nyc.ny.us wrote:
 Hey, Steve,

 I think you are looking for the ultimate solution here that doesn't exist.
 I don't think you can make it work in all cases and all configurations.
 I think you need to find the last service that's really there and the one you
 need to be after, and put that in the constraints.
 Since you know what you actually are putting in your app, that will never 
 change
 until you add more modules.

 On Sep 10, 2012, at 10:46 AM, Steve Eynon steve.ey...@alienfactory.co.uk 
 wrote:

 Hi Robert,

 I had previously tried before:UnclaimedField, after:* - but
 doesn't matter which way round the constraints go, I still get:

 Unable to add 'ContextNotRequiredWorker' as a dependency of
 'UnclaimedField', as that forms a dependency cycle ('UnclaimedField'
 depends on itself via 'ContextNotRequiredWorker'). The dependency has
 been ignored.

 Steve.

 On 10 September 2012 19:37, Robert Zeigler robert.zeig...@roxanemy.com 
 wrote:
 Hi Steve, have you tried specifying after:*, before:UnclaimedField?

 Robert

 On Sep 9, 2012, at 9/99:33 PM , Steve Eynon wrote:

 Hi Michael,

 just specify as many as are important to you.

 I kinda want mine to run last, because I need make sure no other
 workers (in T5 or other modules) add a onActivate() method. The issue
 here is that both my 'ContextNotRequiredWorker' and T5's
 'UnclaimedField' want to run last - which isn't allowed.

 the trick is to specify multiple constraints

 I could specify many after clauses for T5 workers as you mention,
 but that then won't (be guaranteed to) work if some other another
 module adds an onActivate() method.

 Stumpted,

 Steve.
 --
 Steve Eynon
 ---
 If at first you don't succeed,
  so much for skydiving!



 On 10 September 2012 10:13, Michael Prescott
 michael.r.presc...@gmail.com wrote:
 Michael

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



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


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


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


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



Ioc Ordering Contraints

2012-09-09 Thread Steve Eynon

Hi,

I have a transform worker which I want to run after everything else (it 
checks for the existence of an onActive() method) so I have the 
following Module method, note the after:*


@Contribute(ComponentClassTransformWorker2.class)
@Primary
public static void provideTransformWorkers(
  OrderedConfigurationComponentClassTransformWorker2 configuration) {

  configuration.addInstance(
ContextNotRequiredWorker,
NotRequiredWorker.class,
after:*);
}

But then I get the following warning:

WARN  : ConentClassTransformWorker - Unable to add 'UnclaimedField' as a 
dependency of 'ContextNotRequiredWorker', as that forms a dependency 
cycle ('ContextNotRequiredWorker' depends on itself via 
'UnclaimedField'). The dependency has been ignored.


because T5 defines UnclaimedField to also be after:*. How can I define 
my config to be after:* except UnclaimedField, or 
before:UnclaimedField but after:everthing else?


Or does anyone know how else may I resolve my ordering problem?

Cheers,

Steve.

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



Re: Ioc Ordering Contraints

2012-09-09 Thread Steve Eynon
Hi Michael,

 just specify as many as are important to you.

I kinda want mine to run last, because I need make sure no other
workers (in T5 or other modules) add a onActivate() method. The issue
here is that both my 'ContextNotRequiredWorker' and T5's
'UnclaimedField' want to run last - which isn't allowed.

  the trick is to specify multiple constraints

I could specify many after clauses for T5 workers as you mention,
but that then won't (be guaranteed to) work if some other another
module adds an onActivate() method.

Stumpted,

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 10 September 2012 10:13, Michael Prescott
michael.r.presc...@gmail.com wrote:
 Michael

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



How to return HTTP 404 for in-exact URL requests

2012-08-29 Thread Steve Eynon
()));
  }
}
  });
}
  }

--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!

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



Re: How to return HTTP 404 for in-exact URL requests

2012-08-29 Thread Steve Eynon
If T5 could throw more specific exceptions, as oppose the generic ones
that it does, then it'd be a simple exception handling matter for the
user to decide what to do. (As mentioned above.)

I rose a JIRA about this last year:

Throw bespoke exceptions so they may be more easily identified by Error Handlers
https://issues.apache.org/jira/browse/TAP5-1733

Steve.



On 29 August 2012 19:20, Lance Java lance.j...@googlemail.com wrote:
 It sounds like you are fixing something that really should be handled by
 tapestry. I agree that a 404 is much better than a 500 in these cases and I
 think it should be the default behavior.



 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/How-to-return-HTTP-404-for-in-exact-URL-requests-tp5715875p5715876.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: BigDecimal on Tapestry pages

2012-08-14 Thread Steve Eynon
In your module class, if you add:

public static void
contributeApplicationDefaults(MappedConfigurationString, String
config) {
config.add(SymbolConstants.SUPPORTED_LOCALES, en);
}

then T5 should only support English, meaning only full stops should be
used as decimal separators. See
org.apache.tapestry5.services.LocalizationSetter for more details.

Steve.

--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 14 August 2012 06:41, arterzatij arterza...@gmail.com wrote:
 Hi,

 Currently I tested with 'en' locale and it works well, so bigdecimal is not
 the problem. But when I changed to 'es' locale (I live in Mexico), it gets
 the decimal separator as ',' ,on my regional settings of OS and browser are
 configured to handle '.' as decimal separator. Any suggestions?

 Thanks!



 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/BigDecimal-on-Tapestry-pages-tp5714260p5715370.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Conditionally (IE) including javascript

2012-08-12 Thread Steve Eynon
I use this little component:

import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.annotations.Parameter;

public class IfIe {

@Parameter(required=true, defaultPrefix=literal)
private String test;

public void beginRender(MarkupWriter writer) {
// write out a dummy tag to prevent T5 from writing it's
script tags 'inside' the IE comment!
writer.element(script, type, text/javascript);
writer.end();

writer.writeRaw(\n!--[if );
writer.writeRaw(test);
writer.writeRaw(]\n);
}

public void afterRender(MarkupWriter writer) {
writer.writeRaw(\n![endif]--\n);
}
}

html
head
titleFeel The Pain/title
t:ifIe test=lt IE 9
script type=text/javascript
src=${asset:context:/javascript/html5shiv-rc1.js}/script
/t:ifIe
/head
  ...

--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 19 July 2012 09:10, Alex Kotchnev akoch...@gmail.com wrote:
 I'll give George's suggestion a go tomorrow. It seems like I should be able
 to do this from the layout components that pages use, so that I don't have
 to add the code to each page.

 Cheers,

 Alex K
 On Wed, Jul 18, 2012 at 4:51 PM, trsvax trs...@gmail.com wrote:

 For this particular case I suspect you just want this on every page in the
 site.

 If so the simplest way would be just include the following in your
 layout.tml file

 lt;!--[if lt IE 9]gt;

  lt;![endif]--gt;

 --
 View this message in context:
 http://tapestry.1045711.n5.nabble.com/Conditionally-IE-including-javascript-tp5714506p5714581.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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



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



Re: linksubmit t:mode=CANCEL and t:errors

2012-07-23 Thread Steve Eynon
Yeah, this is kind of a known and, I think, not really ideal.

The Cancel mode mainly bypasses client side validation. On the server
you still have to clear the validation errors via the environmental
ValidationTracker.

I waited in anticipation for ages for the Cancel Mode, but when it
finally arrived I decided it was too much bother to use. Now I just
use a eventLink to refresh the page instead.

Steve.

On 23 July 2012 16:48, LanceWhite groli...@gmail.com wrote:
 I'm not sure if this is deliberate or not, but here goes...

 I've got a form with some fields that have client side validation. I've also
 got a linksubmit button for cancelling the  action if wanted, with the flag
 t:mode=cancel.

 In itself, this is working fine, *but* I've also got the t:errors component
 in the form to show validation errors, and this is always getting shown with
 the validation errors, whether the submit is acting on the validation or
 not.

 An example of this is shown in the JumpStart page -
 http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formsinaloopwithdeh
 Ajax Forms in a Loop (With Deleted Entity Handling)

 Pick any of the rows and click the Edit button. Clear the First Name on the
 row, and then press Cancel. The row goes back to its original state, so the
 validation hasn't activated, but you still see the error message 'You must
 provide a value for First Name.'

 Surely this component display should not be rendered if the validation is
 not required?


 Cheers

 Lance



 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/linksubmit-t-mode-CANCEL-and-t-errors-tp5714696.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Tapestry 5.3.4

2012-07-17 Thread Steve Eynon
Just to say the 'Release Notes' link on Announcing Tapestry 5.3.4
links to 5.3.3 and not 5.3.4.

Steve.


On 18 July 2012 00:09, Howard Lewis Ship hls...@gmail.com wrote:
 Following a successful vote, we're happy to announce the release of
 Tapestry 5.3.4.

 5.3.4 includes further performance improvements for heavily loaded
 servers, as well as a few other minor annoyances.  Internally,
 Tapestry has switched its bytecode library from ASM 3.3 to ASM 4.0,
 which should keep it compatible with JDK 1.7.

 More details in the announcement:
 http://tapestry.apache.org/2012/07/16/announcing-tapestry-534.html


 --
 Howard M. Lewis Ship

 Creator of Apache Tapestry

 The source for Tapestry training, mentoring and support. Contact me to
 learn how I can get you up and productive in Tapestry fast!

 (971) 678-5210
 http://howardlewisship.com

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


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



Re: Tapestry 5.3.4

2012-07-17 Thread Steve Eynon
The Release Notes say:

Breaking Features

Tapestry's use of the Javassist bytecode library has been completely
removed, along with many related services, such as ClassFactory, that
were deprecated in 5.3. Use PlasticProxyFactory instead.



On 18 July 2012 00:34, Kalle Korhonen kalle.o.korho...@gmail.com wrote:
 On Tue, Jul 17, 2012 at 9:26 AM, Lenny Primak lpri...@hope.nyc.ny.us wrote:
 Congratulations!
 Is javassist dependency removed in this release?

 No, still a dependency of tapestry-ioc.

 Kalle


 On Jul 17, 2012, at 11:09 AM, Howard Lewis Ship hls...@gmail.com wrote:

 Following a successful vote, we're happy to announce the release of
 Tapestry 5.3.4.

 5.3.4 includes further performance improvements for heavily loaded
 servers, as well as a few other minor annoyances.  Internally,
 Tapestry has switched its bytecode library from ASM 3.3 to ASM 4.0,
 which should keep it compatible with JDK 1.7.

 More details in the announcement:
 http://tapestry.apache.org/2012/07/16/announcing-tapestry-534.html


 --
 Howard M. Lewis Ship

 Creator of Apache Tapestry

 The source for Tapestry training, mentoring and support. Contact me to
 learn how I can get you up and productive in Tapestry fast!

 (971) 678-5210
 http://howardlewisship.com

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


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


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


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



Re: Inheritance and the order of loaded JS

2012-07-12 Thread Steve Eynon
I would imagine, similar to specifying the order of CSS, the scripts
that get added in the later render methods get added later.

e.g. scripts added in setupRender() will appear before scripts added
in afterRender()



On 12 July 2012 21:40, mem memcacher+tapes...@gmail.com wrote:
 Hello,

 i've two Tapestry components where one inherits from the other one. The same
 dependency exists in their JS which is realized by using the jQuery UI
 Widget Factory.
 The problem i have is the order in which the @Import loads the JS, first the
 JS of the child class, which relies on the availability of the parent JS,
 gets called, and this of course breaks the execution. I'd like to omit
 specifying the same JS files in both classes. I understand the worker adds
 the import to the setupRender of the components, i was debugging the
 ImportWorker and saw that JSSupport actually imports the parent class JS
 twice, for the child class it first uses the child JS, then the parent JS,
 and right after the setupRender of the child got called the JS of the parent
 gets imported again, event duplicate imports are ignored further then. Still
 the problem is that the child JS gets imported before the parent JS.
 Is this a bug or is it the known, wanted behavior. If so, what's the
 intention behind this?
 Can i somehow work around this or do i have to specify the JS multiple times
 and in the correct order?

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Inheritance-and-the-order-of-loaded-JS-tp5714430.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Inheritance and the order of loaded JS

2012-07-12 Thread Steve Eynon
 wouldn't it be generally better if the @Import obeys the parent child order

Possibly, but I believe it's quite an edge case you have there.

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



Re: Async process ComponentRequestHandler and JavaScriptSupport

2012-07-10 Thread Steve Eynon
Check that your Environment hasn't been cloaked().

During an Ajax call, when the phase switches from the action phase to
a render phase, the Env is `cloaked` effectively hiding all the stuff
previously put into the Env. This is new in 5.3 - quite annoying
really!

I added some hacky code to one project which, if pop() or peek()
returned null, I'd recursively decloak the Env until I found it. Then
re-cloak!

This may or may not be what you're running into.

Steve.

On 11 July 2012 04:18, Lance Java lance.j...@googlemail.com wrote:
 I'm doing some very non standard stuff in tapestry-cometd where I need to
 invoke tapestry's templating in an async thread. I do this by creating a
 spoof request and response and setting RequestGlobals before invoking
 ComponentRequestHandler.handleComponentEvent(ComponentEventRequestParameters).
 This works well and I'm able to get a JSONObject with a content which
 contains the html.

 I'm now trying to support executing scripts added via JavaScriptSupport and
 I'm running into troubles where a JavaScriptSupport instance is not
 available in the Environment.

 I was hoping that everything would just work but apparently I need to setup
 the environment. Can any tapestry experts out there give me some advice on
 what I'm missing and where I should copy / paste from? I'm hoping to get a
 JSONObject with a scripts property that contains the scripts added via
 JavaScriptSupport.

 The service which does the magic is here
 https://github.com/uklance/tapestry-cometd/blob/master/src/main/java/org/lazan/t5/cometd/services/internal/ComponentJsonRendererImpl.java

 Cheers,
 Lance.

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Async-process-ComponentRequestHandler-and-JavaScriptSupport-tp5714401.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: BigDecimal on Tapestry pages

2012-07-04 Thread Steve Eynon
As I'm aware, BigDecimal's are not treated any differently to other
Java Number objects.

It's the NumericTranslator that handles the conversion, which palms
most of it's work to NumericTranslatorSupportImpl which sets the
following JavaScript symbols (your values may be different) which are
used by the formatLocalizedNumber() JavaScript func in Tapestry.js.

Tapestry.decimalFormatSymbols = {
minusSign : -,
groupingSeparator : ,,
decimalSeparator : .
};

I would try using Floats (just for now) to see if they work correctly.

Depending on where you're logging and how you're saving, the problem
could be with your Database mapping. e.g. By default Hibernate doesn't
preserve the BigDecimal scale.

Steve.

(Side note: Urgh! BigDecimals are horrid horrid things! But yeah, for
monetary values there's nothing else to use by default in Java. Sigh.)

--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 4 July 2012 07:40, arterzatij arterza...@gmail.com wrote:
 Hello,

 I am using a property of my entity as BigDecimal to manage prices in my
 app.



 When filled with data, I provide a number with point as decimal
 separator, such as this 12.35. By submitting the information and
 displaying the information in the logger, I am getting the following number
 1235, if I try to send a new number with a comma, the validator tells me
 that 12.35 is not a number ...

 Looking at the API I can not find where to configure the type of decimal
 separator ...

 My server is configured to recognize the decimal separator.
 Spanish as a language.

 Any suggestions with this behavior among ... BigDecimal = tapestry

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/BigDecimal-on-Tapestry-pages-tp5714260.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: BigDecimal on Tapestry pages

2012-07-04 Thread Steve Eynon
 tapestry js are handling decimalSeparator as coma
 So, how I can change this?

That's set from
NumericTranslatorSupportImpl#createJSONDecimalFormatSymbols() which
looks it up from the Locale of the browser.

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



Re: Setting up selenium and testng

2012-06-30 Thread Steve Eynon
I don't know what your setup is, but no, I've never had to duplicate
code or resources when using T5 and Selenium. Whatever runs your
tests, just ensure the path / classpath is setup correctly.

Steve.

On 30 June 2012 03:12, George Christman gchrist...@cardaddy.com wrote:
 Hello, I'm pretty new to Tapestry Selenium and TestNG, I was first wondering
 if there was any documentation on how to setup your pom and packages for
 running the testing. I also wanted to know if you need to mirror your src
 and resources in the test packages with the exception of having to add the
 test class? Seems silly to have to duplicate your code, but then again I'm
 very new to this. Thanks

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Setting-up-selenium-and-testng-tp5714191.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Using ajaxformloop to add a label and a textfield

2012-06-30 Thread Steve Eynon
The AjaxFormLoop is complicated to get working correctly. So I would
either first work through the T5 tutorial to get a better
understanding of T5 (
http://tapestry.apache.org/tapestry-tutorial.html ) or get the Double
Negative example working in your project, then trim down the code
until it does what you want.

Steve.

On 29 June 2012 21:59, sid emna...@live.com wrote:
 Hi !
 I am a beginner with tapestry and I want to use the component ajaxformloop
 in a formular . I have to add 10 (maximum) textfields and labels. I read 2
 examples
 http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/AjaxFormLoop.html
 example 1
 http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formloop1
 example2  .
 The problem is that they are complicated for me . there is too mach java
 classes and I'm lost
 Can you please give me the main steps that I must follow to have a simple
 result.
 Thanks in advance

 Regards

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Using-ajaxformloop-to-add-a-label-and-a-textfield-tp5714182.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Breaking auto realding feature with embeded classes

2012-06-30 Thread Steve Eynon
Correct, the Enum class has to reside outside of the special packages.

Otherwise, as observed, once the Enum class is reloaded, it's a
totally different class, incompatible with any previous references. T5
cannot replace these references as a) they're not injected b) may be
used in non-T5 classes.

Steve.

On 30 June 2012 19:35, bhorvat horvat.z.bo...@gmail.com wrote:
 So one of my favourite features is the fact that once I change some piece of
 the code, I dont have to restart the application, all I have to do is let
 auto reloading work its magic. Sadly I have found a way to break that
 feature :(

 I have a page that has a bunch of block, so in order to keep things simple I
 am using the embeded Enum class to map which block should be displayed.
 However once I change something I get the following exception


 com.bomahabo.flow.tapestry.pages.Scenes$ShotView cannot be cast to
 com.bomahabo.flow.tapestry.pages.Scenes$ShotView

 I take it that I can move the embeded class outside and that it wont cause
 the problems but since this class is only used in here I would like to keep
 it there. Any suggestion about this? Also if someone from dev team is
 reading this, are you aware of this problem.

 Cheers

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Breaking-auto-realding-feature-with-embeded-classes-tp5714201.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Breaking auto realding feature with embeded classes

2012-06-30 Thread Steve Eynon
Alas no. All classes inside those packages (and sub packages) are
transformed (re-loaded) by T5. I either stick it in the services
package or create a separate package called util or entity.

com.myapp.components
com.myapp.pages
com.myapp.services -- here
com.myapp.entities  -- or here
com.myapp.util-- or here

Steve.



On 30 June 2012 20:22, bhorvat horvat.z.bo...@gmail.com wrote:
 I see, well that makes sense. Can I place that class then inside a components
 page, or better yet components subpackage?

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Breaking-auto-realding-feature-with-embeded-classes-tp5714201p5714206.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: @Symbol and web context-params

2012-06-21 Thread Steve Eynon
 because i need multiple apps running side by side.

Err...

http://tapestry.apache.org/configuration.html#Configuration-SegregatingApplicationsIntoFolders
says, At this time, it is still not possible to run multiple Tapestry
5 applications within the same web application.

Other than that there's a ServletContextSymbolProvider which makes
ServletContext init-parameters accessible as symbols. If that's no
use, you could write your own SymbolProvider based on the above -
which is only around 6 lines of code.

Steve.


On 22 June 2012 01:43, Michael Prescott michael.r.presc...@gmail.com wrote:
 I'm hoping to use tapestry-hibernate, and also flyway to do db migrations,
 and I'm having trouble injecting the data source from the servlet container
 into each of these.

 With tapestry-spring, I was able to have spring read web context params,
 and go from there.  But in my tapestry module, @Symbol doesn't appear to
 read context params.

 Is there an orthodox way to go about this?

 I don't want to hard-code the data source name in, say, a
 hibernate.cfg.xml, because i need multiple apps running side by side.

 Gratefully,

 Michael

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



Re: JSON issue when upgrading to 5.3.3 from 5.2.6

2012-06-20 Thread Steve Eynon
See below for more details:

http://tapestry.apache.org/how-to-upgrade.html

http://tapestry.apache.org/configuration.html#Configuration-tapestry.applicationversion

http://tapestry.apache.org/templating-and-markup-faq.html#TemplatingandMarkupFAQ-WhydomyimagesandstylesheetsendupwithaweirdURLslike%7B%7B%2Fassets%2Feea17aee26bc0cae%2Fctx%2Flayout%2Flayout.css%7D%7D%3F

http://tapestry.apache.org/assets.html#Assets-AssetURLs

Steve.


On 20 June 2012 06:20, Howard Lewis Ship hls...@gmail.com wrote:
 Change your application version number.

 On Tue, Jun 19, 2012 at 3:00 PM, Dongmei Cao dongmei@icann.org wrote:

 Hi,

 After upgrading  the Tapestry to 5.3.3 from 5.2.6, we have been getting
 the following exceptions. I know that it is because the client has the old
 JavaScript in the browser cache. My question is whether there is an elegant
 way to force the browsers to reload the JavaScript before the exception
 happens. Thanks in advance!

 *org.apache.tapestry5.ioc.internal.OperationException: A JSONArray text
 must start with '[' at character 1 of goButton [] *
 *     at
 org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:121)
 *
 *     at
 org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:88)
 *
 *     at
 org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
 *
 *     at
 org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1121)
 *


 Dongmei




 --
 Howard M. Lewis Ship

 Creator of Apache Tapestry

 The source for Tapestry training, mentoring and support. Contact me to
 learn how I can get you up and productive in Tapestry fast!

 (971) 678-5210
 http://howardlewisship.com

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



Re: AppModule: using injected service in ContributeWebSecurityManager

2012-06-20 Thread Steve Eynon
Hi!

I'm pretty sure your dataSource is being injected, otherwise you'd
receive a different error and not an NPE.

This looks wrong to me:
binder.bind(DataSource.class,
AppModule.getJndiDataSource().getClass()).withId(blog.dataSource);

Specifically the:
AppModule.getJndiDataSource().getClass()

Do you not know what the class is at compile time? Rather than
binding, you may want a use Builder method.

Also, the binding gives an ID of blog.dataSource but you're
injecting myDataSource...?


As an aside, I usually inject services in my Module with this:

  public void contributeWebSecurityManager(
final ConfigurationRealm configuration
@Local DataSource dataSource) {
...
}

No need for @InjectService.

The @Local tells T5-IoC to look for a service defined in *that* module
class. Because DataSource is a popular interface, it could be defined
in other modules. The annotation helps to dis-ambiguate between them.

Steve.

On 20 June 2012 20:47, cablepuff cablep...@gmail.com wrote:
 Hi i have the following problem. I have set the following code.

          public void contributeWebSecurityManager(
                        final ConfigurationRealm configuration
                        //, @InjectService(myDataSource)final DataSource
 dataSource
                ) {
                final JdbcRealm realm = new JdbcSaltedRealm();
                realm.setDataSource(getJndiDataSource());
                // realm.setDataSource(dataSource);  -- does not work
                realm.setAuthenticationQuery(AppModule.AUTHENTICATION_QUERY);
                realm.setUserRolesQuery(AppModule.USER_ROLES_QUERY);
                realm.setPermissionsQuery(AppModule.PERMISSION_QUERY);
                realm.setPermissionsLookupEnabled(true);
                realm.setCredentialsMatcher(this.credentialsMatcher);
                configuration.add(realm);
        }

 In the same AppModule class I  have this

       public static void bind(final ServiceBinder binder) {
              binder.bind(DataSource.class,
 AppModule.getJndiDataSource().getClass())
                                .withId(blog.dataSource);
       }

 When i run my app it seems the datasource is not injected. How am I able to
 inject the datasource binded into ContributeWebSecurityManager.

 This is error i am getting when using service injection instead of just
 manually getting the datasource.

 NFO: Cannot create JDBC driver of class '' for connect URL 'null'
 java.lang.NullPointerException
        at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:524)
        at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:493)
        at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307)
        at java.sql.DriverManager.getDriver(DriverManager.java:273)
        at
 org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1437)
        at
 org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
        at
 org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
        at $DataSource_210503fddf1.getConnection(Unknown Source)
        at
 org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
        at
 org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
        at
 org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:573)
        at 
 org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:637)
        at 
 org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:666)
        at 
 org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:674)
        at
 org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:729)
        at
 org.apache.shiro.realm.JdbcSaltedRealm.getPasswordForUser(JdbcSaltedRealm.java:242)
        at
 org.apache.shiro.realm.JdbcSaltedRealm.doGetAuthenticationInfo(JdbcSaltedRealm.java:170)
        at
 org.apache.shiro.realm.JdbcSaltedRealm.doGetAuthenticationInfo(JdbcSaltedRealm.java:61)

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/AppModule-using-injected-service-in-ContributeWebSecurityManager-tp5713989.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: T.5.2.6 recordError on FormAjaxLoop

2012-06-20 Thread Steve Eynon
I don't think it is. The default implementation of the
ValidationTracker records errors against individual fields, of which
in the loop there is only one. (Caveat: I've not looked at the
FormAjaxLoop specifically.)

In a standard loop, this implementation helps - you may be able to
adjust for a FormAjaxLoop
http://tapestry.1045711.n5.nabble.com/Validating-forms-inside-a-loop-td2426980.html

Steve.

On 20 June 2012 21:41, resign sergejb...@yahoo.de wrote:
 hi,
 is it possible to record an error to single field of FormAjaxLoop?
 The requirement is:
  i want to make a form with several email fields.
  Field one contains good data
  Field two contains bad data.
  So i have to mark field two as wrong.

 At the moment i validate the data in onAfterSubmit, on error case i call
 Form.recordError(String).

 How can i make it on more elegance way?

 greetings
 resign

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/T-5-2-6-recordError-on-FormAjaxLoop-tp5713991.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Difference between renderSupport.addScript and JSON addInit(function, JSON Object)

2012-06-20 Thread Steve Eynon
in address.js remove the last call to loadAddresse. i.e. just have

Tapestry.Initializer.loadAddresse = function loadAddresse(jsonObject){
...
}

it is probably that last surplus : loadAddresse(jsonObject); that
caused the JS error ('cos there is no global function called
loadAddresse) which then disabled JavaScript for the rest of the page
load.

Steve.




On 20 June 2012 15:56, baptiste baptiste.toll...@atos.net wrote:
 It doesn't work for me.

 In java :
   @IncludeJavaScriptLibrary({ context:static/javascript/address.js })

   @Environmental
    private RenderSupport renderSupport;

    @BeginRender
    void addJsLibs() {
        log.debug(BEGIN addJsLibs);
        JSONObject jsonObject = new JSONObject();
        jsonObject.put(m1, messages.get(new_delivery_address));
        jsonObject.put(m2, messages.get(js.error.address.empty));
        jsonObject.put(m3, messages.get(js.error.receiving.person.empty));
        jsonObject.put(m4, messages.get(js.error.street.empty));
        jsonObject.put(m5, messages.get(js.error.house.empty));
        jsonObject.put(m6, messages.get(js.error.postcode.empty));
        jsonObject.put(m7, messages.get(js.error.postcode.wrong));
        jsonObject.put(m8, messages.get(js.error.city.empty));
        jsonObject.put(m9, 
 messages.get(js.error.special.chars.not_accepted));
        jsonObject.put(m10, messages.get(js.error.floor.empty));
        jsonObject.put(m11, messages.get(js.error.floor.wrong));
        jsonObject.put(m12, messages.get(js.error.elevator.empty));
        renderSupport.addInit(loadAddresse, jsonObject);
        log.debug(END addJsLibs);
    }

 in address.js:
 Tapestry.Initializer.loadAddresse = function loadAddresse(jsonObject){
 ...
 }
 loadAddresse(jsonObject);

 In browser console:
 loadAddresse is not defined
 and method in loadAddresse can never be called

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Difference-between-renderSupport-addScript-and-JSON-addInit-function-JSON-Object-tp5105620p5713987.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: PageTester cant handle querystring ?

2012-06-19 Thread Steve Eynon
A colleague already filed this JIRA last year:

PageTester causes StringIndexOutOfBoundsException with query parameter
https://issues.apache.org/jira/browse/TAP5-1770

While you're at it, you may also wish to patch TestableRequestImpl
with the following:

@Override
public TestableRequest clear() {
parameters.clear();

/*  MUNKY PATCH 
 */
// Fudge for T5 PageTester not clearing down Request Attributes
// Needed to clear the OpenSpringSessionInViewFilter.FILTERED flag
attributes.clear();
/*  MUNKY PATCH 
 */

return this;
}

@Override
public TestableRequest setPath(String path) {
/*  MUNKY PATCH 
 */
// strip any anchor information off the path URL 'cos
//  1. it's not supposed to be there
//  2. T5 throws up if it finds it!
if (path.contains(#)) {
path = path.substring(0, path.indexOf('#'));
}
/*  MUNKY PATCH 
 */
this.path = path;
return this;
}

--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 19 June 2012 06:47, Karan Rajanayagam karan.rajanaya...@dossier.no wrote:

 PageTester cant handle query string.. for ex. an link like:
  admin/clazz/edit?schoolYearId=0


 Im getting StringIndexOutOfBounds because an error in PageTester class.,


 PageTester class we have:

 /  private void setupRequestFromURI(String URI)
    {
        String linkPath = stripContextFromPath(URI);

        int comma = linkPath.indexOf('?');

        String path = comma  0 ? linkPath : linkPath.substring(0, comma);

        request.clear().setPath(path);

        if (comma  0)
 *            decodeParametersIntoRequest(path.substring(comma + 1));*
    }
 /
 Last line should rather be:
 *  decodeParametersIntoRequest(*linkPath*.substring(comma + 1));*

 Shall i fire a bug ?
 --
  Kind regards
 *Karan Rajanayagam*

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



Re: Getting Error when do any action in my page

2012-06-19 Thread Steve Eynon
Still...

 Servlet.service() for servlet ices threw exception

...sounds like a servlet is being invoked which is causing the NPE. T5
is a servlet filter, no servlet should be being called.

Depending on your setup - have you read this?:

http://tapestry.apache.org/configuration.html#Configuration-SegregatingApplicationsIntoFolders

Steve.


On 19 June 2012 17:00, karthick nk.karth...@gmail.com wrote:
 Hi ,

 Thanks for your reply.

 Ices is context path my application.

 http://localhost:8080/ices/app

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Getting-Error-when-do-any-action-in-my-page-tp5713876p5713971.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: PageTester cant handle querystring ?

2012-06-19 Thread Steve Eynon
There is also a duplicate JIRA for the PageTester bug and a patch file here:

REOPEN TAP5-698 - PageTester's setupRequestFromURI incorrectly uses
substring twice on same string
https://issues.apache.org/jira/browse/TAP5-1936

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 19 June 2012 17:37, Steve Eynon steve.ey...@alienfactory.co.uk wrote:
 A colleague already filed this JIRA last year:

 PageTester causes StringIndexOutOfBoundsException with query parameter
 https://issues.apache.org/jira/browse/TAP5-1770

 While you're at it, you may also wish to patch TestableRequestImpl
 with the following:

 @Override
 public TestableRequest clear() {
        parameters.clear();

        /*  MUNKY PATCH 
  */
        // Fudge for T5 PageTester not clearing down Request Attributes
        // Needed to clear the OpenSpringSessionInViewFilter.FILTERED flag
        attributes.clear();
        /*  MUNKY PATCH 
  */

        return this;
 }

 @Override
 public TestableRequest setPath(String path) {
        /*  MUNKY PATCH 
  */
        // strip any anchor information off the path URL 'cos
        //  1. it's not supposed to be there
        //  2. T5 throws up if it finds it!
        if (path.contains(#)) {
                path = path.substring(0, path.indexOf('#'));
        }
        /*  MUNKY PATCH 
  */
        this.path = path;
        return this;
 }

 --
 Steve Eynon
 ---
 If at first you don't succeed,
    so much for skydiving!



 On 19 June 2012 06:47, Karan Rajanayagam karan.rajanaya...@dossier.no wrote:

 PageTester cant handle query string.. for ex. an link like:
  admin/clazz/edit?schoolYearId=0


 Im getting StringIndexOutOfBounds because an error in PageTester class.,


 PageTester class we have:

 /  private void setupRequestFromURI(String URI)
    {
        String linkPath = stripContextFromPath(URI);

        int comma = linkPath.indexOf('?');

        String path = comma  0 ? linkPath : linkPath.substring(0, comma);

        request.clear().setPath(path);

        if (comma  0)
 *            decodeParametersIntoRequest(path.substring(comma + 1));*
    }
 /
 Last line should rather be:
 *  decodeParametersIntoRequest(*linkPath*.substring(comma + 1));*

 Shall i fire a bug ?
 --
  Kind regards
 *Karan Rajanayagam*

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



Re: How to tap into live class realoading

2012-06-16 Thread Steve Eynon
From a quick peek...

The ReloadableObjectCreatorSource creates the proxies
(ReloadableServiceImplementationObjectCreator) which create the
Service. Each ReloadableServiceImplementationObjectCreator implements
UpdateListener which is called when it should check for changes /
updates.

But you are aware live class reloading is only enabled during development right?

Steve.


On 16 June 2012 22:55, Thiago H de Paula Figueiredo thiag...@gmail.com wrote:
 On Sat, 16 Jun 2012 10:56:10 -0300, Thim Anneessens thimw...@gmail.com
 wrote:

 Hello,


 Hi!


 Singleton service reloading is unfortunatly not suffisiant for my purposes


 Could you be a little more specific? This would help us to provide help to
 you.


 so I was wondering if anyone could give me some insight on how Tapestry
 live class reloading works (whish are the classes involved in that process
 for instance).


 I don't know the internals, but basically Tapestry-IoC (for services,
 Tapestry-Core, the web framework, isn't involved) uses a proxy for every
 single which is defined by an interface. For pages, components and mixins,
 Tapestry-Core uses its own classloader.

 --
 Thiago H. de Paula Figueiredo


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


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



Re: Disable clientside x on serverside validation

2012-06-15 Thread Steve Eynon
That's not a server class, that's done in JavaScript. Look at the
createUI() function in Tapestry.ErrorPopup around line 1300 in
tapestry.js

You may have to monkey patch the JS with your own function(s) / class.

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 15 June 2012 22:08, George Christman gchrist...@cardaddy.com wrote:
 Steven, do you happen to know what class handles the tjq-error-popup div?
 After looking at this closely, it might make better sense to create a new
 Validation Decorator, I was using css to alter the x img to a V pointer from
 the bubble to the field. Might be easier to just include that with the
 tjq-error-popup div and remove the x img.

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Disable-clientside-x-on-serverside-validation-tp5713893p5713927.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Getting Error when do any action in my page

2012-06-14 Thread Steve Eynon
On 14 June 2012 21:20, karthick nk.karth...@gmail.com wrote:

 Servlet.service() for servlet ices threw exception

What's the ices servlet and why is it being called?

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



Re: How to use StyleSheetOptions with condition

2012-06-14 Thread Steve Eynon
The clue is in StylesheetLink#add. Try this:

void afterRender() {
    js.importStylesheet(new StylesheetLink(ieOnlyStylesheet,
new StylesheetOptions(null).withCondition((IE 7)|(IE 8))) );
}

Only the constructor and getter are deprecated.

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 14 June 2012 23:41, George Christman gchrist...@cardaddy.com wrote:
 Hello, I'm not finding a clear example how to use StylesheetOptions with a
 condition. I seen an example here,

 http://tapestry.apache.org/css.html

 But this has been deprecated in 5.3

 Could someone please help me figure out how to use the condition. I only
 want to display a style sheet if it's either ie7/ie8

 Current code

    @Inject @Path(context:layout/ie-only.css)
    private Asset ieOnlyStylesheet;

    @Environmental
    private JavaScriptSupport js;

    // add an IE-only style sheet if browser is IE
    void afterRender() {
        js.importStylesheet(new StylesheetLink(ieOnlyStylesheet, new
                            StylesheetOptions(null)) );
    }

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/How-to-use-StyleSheetOptions-with-condition-tp5713879.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Problem injecting a Logger

2012-06-14 Thread Steve Eynon
Yeah, this isn't a T5 thing - it's Java!

   @Inject
   private Logger log;

   public My() {
   log.info(Logger injected in service using @javax.inject.Inject);
   }

T5 can't do field injection until it's constructed the class. But when
T5 constructs the class you access the field -- NPE!

Steve.


On 15 June 2012 00:11, Taha Siddiqi tawus.tapes...@gmail.com wrote:
 I don't think you can use @Injected value in the constructor.

 The constructor is called first and then injection is done. As you are 
 accessing the service in constructor, at this point the field injection has 
 not been done. And as Logger has not been build by the registry, you get 
 Service not implemented error..

 regards
 Taha

 On Jun 14, 2012, at 9:25 PM, Muhammad Gelbana wrote:

 TapestryLogging.zip


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



Re: How to use StyleSheetOptions with condition

2012-06-14 Thread Steve Eynon
To be honest I've never tried it, but it says here it should be okay:

http://en.wikipedia.org/wiki/Conditional_comment

Steve.



On 15 June 2012 00:13, George Christman gchrist...@cardaddy.com wrote:
 Thanks Steven, nice to know the condition argument can handle multiple
 conditions.

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/How-to-use-StyleSheetOptions-with-condition-tp5713879p5713885.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Problem injecting a Logger

2012-06-14 Thread Steve Eynon
 org.slf4j.Logger.
 2012-06-14 18:55:47.604:WARN::Failed startup of context
 org.mortbay.jetty.webapp.WebAppContext@135f0a
 {/,E:\Workspace\Eclipse\TapestryLogging\src\main\webapp}
 java.lang.RuntimeException: Exception constructing service
 'RegistryStartup': Error invoking service contribution method
 com.t5logging.services.AppModule.contributeRegistryStartup(OrderedConfiguration,
 Logger): No service implements the interface org.slf4j.Logger.
 at
 org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:75)
 at
 org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:54)
 at $Runnable_452bb13e0afc.delegate(Unknown Source)
 at $Runnable_452bb13e0afc.run(Unknown Source)
 at
 org.apache.tapestry5.ioc.internal.RegistryImpl.performRegistryStartup(RegistryImpl.java:322)
 at
 org.apache.tapestry5.ioc.internal.RegistryWrapper.performRegistryStartup(RegistryWrapper.java:80)
 at org.apache.tapestry5.TapestryFilter.init(TapestryFilter.java:118)
 at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
 at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
 at
 org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:713)
 at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
 at
 org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282)
 at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)
 at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
 at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
 at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
 at org.mortbay.jetty.Server.doStart(Server.java:224)
 at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
 at runjettyrun.Bootstrap.main(Bootstrap.java:82)
 2012-06-14 18:55:47.637:INFO::Started SelectChannelConnector@0.0.0.0:80


 On Thu, Jun 14, 2012 at 6:26 PM, Steve Eynon steve.ey...@alienfactory.co.uk
 wrote:

 Yeah, this isn't a T5 thing - it's Java!

   @Inject
   private Logger log;

   public My() {
        log.info(Logger injected in service using @javax.inject.Inject);
   }

 T5 can't do field injection until it's constructed the class. But when
 T5 constructs the class you access the field -- NPE!

 Steve.


 On 15 June 2012 00:11, Taha Siddiqi tawus.tapes...@gmail.com wrote:
  I don't think you can use @Injected value in the constructor.
 
  The constructor is called first and then injection is done. As you are
 accessing the service in constructor, at this point the field injection has
 not been done. And as Logger has not been build by the registry, you get
 Service not implemented error..
 
  regards
  Taha
 
  On Jun 14, 2012, at 9:25 PM, Muhammad Gelbana wrote:
 
  TapestryLogging.zip
 

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




 --
 *Regards,*
 *Muhammad Gelbana
 Java Developer*

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



Re: Disable clientside x on serverside validation

2012-06-14 Thread Steve Eynon
This is only easily done in the later T5.3.x releases. You need to
override the ValidationDecoratorFactory with your local service:

  public static void bind(ServiceBinder binder) {
binder.bind(ValidationDecoratorFactory.class,
MyValidationDecoratorFactory.class).withSimpleId();
}

  public static void
contributeServiceOverride(MappedConfigurationClass?, Object
config, @Local ValidationDecoratorFactory factory) {
config.add(ValidationDecoratorFactory.class, factory);
  }

Then have your Factory return your own instance of ValidationDecorator
- I'd base it on, or extend, T5's default BaseValidationDecorator.

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 15 June 2012 01:07, George Christman gchrist...@cardaddy.com wrote:
 Is there a way to disable the clientside x from appearing when a server side
 error returns. I use it for clientside validation, so I don't want to
 completely disable it with css.

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Disable-clientside-x-on-serverside-validation-tp5713893.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Problem injecting a Logger

2012-06-14 Thread Steve Eynon
My mistake, the @Inject in the My class needs to be a

org.apache.tapestry5.ioc.annotations.Inject;
or
org.apache.tapestry5.ioc.annotations.InjectResource;

Probably as (already stated - I think), the T5 @Inject uses a
MasterObjectProvider whereas the javax @Inject just looks up Services
- which the Logger isn't... ???

Steve.

On 15 June 2012 01:14, Steve Eynon steve.ey...@alienfactory.co.uk wrote:
 Just tried it on T5.3.3 and it worked fine with both @Inject annotations...

 Though I wouldn't advise injecting services into your module - that
 just seems... well, weird!

 Steve.


 On 15 June 2012 01:00, Muhammad Gelbana m.gelb...@gmail.com wrote:
 Well thanks, that was my mistake !
 Although now I tried calling the logger in a method called in the
 contribute registry startup static method and still tapestry didn't resolve
 it:

 public class *AppModule* {

 @Inject
 private IMy my;
 public static void bind(ServiceBinder binder) {
 binder.bind(IMy.class, My.class);
 }

 public void contributeRegistryStartup(OrderedConfigurationRunnable
 configuration, final Logger log) {
 my.a();
 }
 }

 package com.t5logging.services;
 import javax.inject.Inject;
 import org.slf4j.Logger;

 public class My implements IMy {

 @Inject
 private Logger log;

 public My() {
 }

 public void a() {
 System.out.println(log);
 log.info(Logging again);
 }
 }

 This still throws a service not implemented exception:
 Running Jetty 6.1.26
 .
 //Saving some time
 .
 [DEBUG] AppModule.IMy Creating proxy for service IMy
 [DEBUG] AppModule.IMy Loading class com.t5logging.services.My.
 [DEBUG] AppModule.IMy Marking class com.t5logging.services.My to be
 (re-)loaded
 [DEBUG] AppModule.IMy BEGIN Analyzing com.t5logging.services.My
 [DEBUG] AppModule.IMy   END Analyzing com.t5logging.services.My
 [ERROR] ioc.Registry No service implements the interface org.slf4j.Logger.
 [ERROR] ioc.Registry Operations trace:
 [ERROR] ioc.Registry [ 1] Realizing service RegistryStartup
 [ERROR] ioc.Registry [ 2] Instantiating service RegistryStartup
 implementation via
 org.apache.tapestry5.ioc.internal.services.RegistryStartup(Logger, List)
 (at RegistryStartup.java:36) via
 org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at
 TapestryIOCModule.java:49)
 [ERROR] ioc.Registry [ 3] Creating plan to instantiate
 org.apache.tapestry5.ioc.internal.services.RegistryStartup via public
 org.apache.tapestry5.ioc.internal.services.RegistryStartup(org.slf4j.Logger,java.util.List)
 [ERROR] ioc.Registry [ 4] Determining injection value for parameter #2
 (java.util.List)
 [ERROR] ioc.Registry [ 5] Collecting ordered configuration for service
 RegistryStartup
 [ERROR] ioc.Registry [ 6] Invoking
 com.t5logging.services.AppModule.contributeRegistryStartup(OrderedConfiguration,
 Logger) (at AppModule.java:39)
 [ERROR] ioc.Registry [ 7] Reloading class com.t5logging.services.My.
 [ERROR] ioc.Registry [ 8] Creating plan to instantiate
 com.t5logging.services.My via public com.t5logging.services.My()
 [ERROR] ioc.Registry [ 9] Calculating possible injection value for field
 com.t5logging.services.My.log (org.slf4j.Logger)
 [ERROR] ioc.Registry [10] Resolving object of type org.slf4j.Logger using
 MasterObjectProvider
 [ERROR] TapestryIOCModule.RegistryStartup Construction of service
 RegistryStartup failed: Error invoking service contribution method
 com.t5logging.services.AppModule.contributeRegistryStartup(OrderedConfiguration,
 Logger): No service implements the interface org.slf4j.Logger.
 java.lang.RuntimeException: Error invoking service contribution method
 com.t5logging.services.AppModule.contributeRegistryStartup(OrderedConfiguration,
 Logger): No service implements the interface org.slf4j.Logger.
 at
 org.apache.tapestry5.ioc.internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java:130)
 at
 org.apache.tapestry5.ioc.internal.ContributionDefImpl.contribute(ContributionDefImpl.java:80)
 at
 org.apache.tapestry5.ioc.internal.RegistryImpl$9.run(RegistryImpl.java:630)
 at
 org.apache.tapestry5.ioc.internal.OperationTrackerImpl$1.invoke(OperationTrackerImpl.java:51)
 at
 org.apache.tapestry5.ioc.internal.OperationTrackerImpl$1.invoke(OperationTrackerImpl.java:48)
 at
 org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
 at
 org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:47)
 at
 org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.run(PerThreadOperationTracker.java:76)
 at
 org.apache.tapestry5.ioc.internal.RegistryImpl.addToOrderedConfiguration(RegistryImpl.java:626)
 at
 org.apache.tapestry5.ioc.internal.RegistryImpl.getOrderedConfiguration(RegistryImpl.java:480)
 at
 org.apache.tapestry5.ioc.internal.ServiceResourcesImpl$2.invoke(ServiceResourcesImpl.java:110)
 at
 org.apache.tapestry5.ioc.internal.ServiceResourcesImpl$2.invoke(ServiceResourcesImpl.java:107)
 at
 org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74

Re: HowTo break out of a Tapestry loop?

2012-06-06 Thread Steve Eynon
There is no 'break' in the loop component, but you can wrap your inner
loops in a conditional t:if test=.. component.

Steve.

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



Re: Javascript in Tapesytry

2012-06-03 Thread Steve Eynon
Could you not use a t:outputRaw / component and put the JS in a java string?


On 4 June 2012 00:32, Felix Gonschorek fe...@netzgut.net wrote:
 okay, last one ;)

 or you could do:

 if ([xhr2.readyState, xhr2.status].join( ) == 4 200) {

 }

 (typesafe check gets lost, though...)




 Am 03.06.2012 18:25, schrieb Felix Gonschorek:
 or nested if statements?

 if (opt1) {
  if (opt2) {

  }
 }
 Am 03.06.2012 18:13, schrieb Felix Gonschorek:

 Am 03.06.2012 00:00, schrieb TG:
 If I would not want to put my codes in external file, what option do I 
 have?
 :]

 what about that:

 function and(opt1, opt2) {
  if (!opt1) return false;
  if (!opt2) return false;
  return true;
 }

 if (and(xhr2.readyState === 4, xhr2.status === 200)) {

 }

 --
 Netzgut Unternehmergesellschaft (haftungsbeschränkt)

 Kirchstr. 18
 69115 Heidelberg

 Telefon:
 +49 6221 39298 51

 Telefax:
 +49 6221 39298 59

 E-Mail:
 fe...@netzgut.net

 Handelsregister: Amtsgericht Mannheim, HRB 709833
 Sitz der Gesellschaft: Heidelberg
 Geschäftsführer: Felix Gonschorek
 Ust-IdNr.: DE272871752

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


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



Re: Tapestry Transactions

2012-05-31 Thread Steve Eynon
This now is all in the realm of Spring so I don't want to say too much...

Essentially, it doesn't matter how many 'nested' method calls you
make, [with PROPAGATION_REQUIRED] the transaction will rollback to
(and commit at) where the annotation was first encountered.

See the Spring docs for more:
http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/transaction.html#tx-propagation

@Transactional just gives you finer grained control over rollback
points and read access.

Steve.

On 31 May 2012 05:25, bhorvat horvat.z.bo...@gmail.com wrote:
 Can you elaborate a bit more the part below


 Steve Eynon wrote

 unlike T5's @CommitAfter, it doesn't always commit or start a new
 transaction.


 The T5 annotation always commits when there is not RuntimeException so what
 does @Transactional annotation does then :S

 tnx



 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Tapestry-Transactions-tp5713299p5713540.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Tapestry Transactions

2012-05-30 Thread Steve Eynon
Yeah, you can put the Spring @Transactional annotation on any Spring
bean / service. Both on the class and its methods.

The propagation=Propagation.REQUIRED ensures the code runs inside a
transaction but unlike T5's @CommitAfter, it doesn't always commit or
start a new transaction. It sounds like this does what you want.

Steve.

On 25 May 2012 21:33, bhorvat horvat.z.bo...@gmail.com wrote:
 So you put your transactional annotation on the DAO, right? The CommitAfter
 does that for me as well, what I need is to put it on some layer above that
 has multiple contats to the couple of different DAOs. One that saves one
 part of the transaction, other that saves another but the should fail or
 success together, can I do this with you configuration? Can I put
 Transactional annotation on something other then HibernateDAO.


 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Tapestry-Transactions-tp5713299p5713416.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Tapestry Transactions

2012-05-25 Thread Steve Eynon
Our dependencies are configured via Ivy:

dependency org=org.hibernate name=hibernate-core
rev=3.6.1.Final conf=compile
artifact name=hibernate-core ext=jar/
/dependency

dependency org=org.springframework name=spring-core
rev=3.1.0.RELEASE conf=compile/
dependency org=org.springframework name=spring-context
rev=3.1.0.RELEASE conf=compile/
dependency org=org.springframework name=spring-tx
rev=3.1.0.RELEASE conf=compile/
dependency org=org.springframework name=spring-jdbc
rev=3.1.0.RELEASE conf=compile/
dependency org=org.springframework name=spring-context-support
rev=3.1.0.RELEASE conf=compile
artifact name=spring-context-support ext=jar/
/dependency

And yes, you need to use the Spring filter in your web.xml because
your transactional services will be Spring services - configured in
the usual Spring way via the application-context.xml.

Example DAO:

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Transactional(propagation=Propagation.REQUIRED,
isolation=Isolation.READ_COMMITTED, readOnly = true)
public class MyHibernateDAO extends HibernateDaoSupport {

  ...

}

Hope it helps,

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 25 May 2012 17:26, bhorvat horvat.z.bo...@gmail.com wrote:
 Hi Steve,

 Thanks for posting. Can I ask you to help a bit more :)

 I have tried adding to pom tapestry-spring but it didn't resolve everything.
 I was under the impression that tapestry-spring includes everything spring
 related that is needed. The missing dependencies are related to hibernate

 import org.springframework.orm.hibernate3.SessionFactoryUtils;
 import org.springframework.orm.hibernate3.SessionHolder;
 import
 org.springframework.transaction.support.TransactionSynchronizationManager;


 Also will I need to do anything from this page

 http://tapestry.apache.org/integrating-with-spring-framework.html

 Something like


  filter
    filter-nameapp/filter-name


 filter-classorg.apache.tapestry5.spring.TapestrySpringFilter/filter-class
  /filter

 So if you can share a bit more light on the configuration (how did you
 define services, since mine are defined in the code as normal tapestry
 service, as your custom OpenSessionInViewFilter), how do I plug in the
 filter into the tapestry (do I have to), do I have to change the hibernate
 configuration that I have so far, since my project does not use spring.

 Cheers and thanks for posting and helping

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Tapestry-Transactions-tp5713299p5713407.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: How can I create a component that generates unique ids?

2012-05-24 Thread Steve Eynon
All IDs rendered by T5 are already unique. e.g.

t:any t:mixins=renderClientId /
t:any t:mixins=renderClientId /

will render

div id=any/
div id=any_0/

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 24 May 2012 17:27, iberck ibe...@gmail.com wrote:
 Hi tapestry members:

 How can I create a component that generates unique ids?

 For example:

 PAGE
 -
 1 t:component1/
 2 t:component1/
 -

 I need component1 of line 1 has for example unique generated
 t:id=component1_0 and
 component1 of line 2 has for example unique generated t:id=component1_1

 Thanks in advance

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/How-can-I-create-a-component-that-generates-unique-ids-tp5713377.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: T5 How can I pass a block to a component?

2012-05-23 Thread Steve Eynon
In Test.tml you could also do:

t:component1 block1=block:dude /

t:block t:id=dude
texto bloque uno
/t:block

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 24 May 2012 07:43, iberck ibe...@gmail.com wrote:
 I found the solution:


 .tml:
 public class Component1 {

    @Parameter
    @Property
    private Block block1;
 }

 .java:
 contenido bloque: t:delegate to=block1/

 Test.tml:
 t:component1
        p:block1
            texto bloque uno
        /p:block1
    /t:component1


 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/T5-How-can-I-pass-a-block-to-a-component-tp5713371p5713372.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Tapestry Transactions

2012-05-23 Thread Steve Eynon
Here is our implementation with Spring 3.1.0 - it lets you use the
Spring transaction annotations on your Spring services.

First in your module:

public static void bind(ServiceBinder binder) {
binder.bind(ComponentRequestFilter.class,
OpenSpringSessionInViewFilter.class).withSimpleId();
}

public static void
contributeComponentRequestHandler(OrderedConfigurationComponentRequestFilter
configuration, OpenSpringSessionInViewFilter filter) {
configuration.add(OpenSessionInViewFilter, filter);
}

And here's the class - it was created by collapsing the usual Spring
hierarchy of 18,001 classes and interfaces to about 8 lines of useful
code. (Shesh!)

import java.io.IOException;

import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.ComponentEventRequestParameters;
import org.apache.tapestry5.services.ComponentRequestFilter;
import org.apache.tapestry5.services.ComponentRequestHandler;
import org.apache.tapestry5.services.PageRenderRequestParameters;
import org.apache.tapestry5.services.Request;
import org.hibernate.FlushMode;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.SessionFactoryUtils;
import org.springframework.orm.hibernate3.SessionHolder;
import 
org.springframework.transaction.support.TransactionSynchronizationManager;



public class OpenSpringSessionInViewFilter implements ComponentRequestFilter {
private static final Logger LOG =
LoggerFactory.getLogger(OpenSpringSessionInViewFilter.class);

@Inject
private ApplicationContext applicationContext;

@Inject
private Request request;



@Override
public void handlePageRender(final PageRenderRequestParameters
parameters, final ComponentRequestHandler handler) throws IOException
{
if (alreadyFiltered()) {
// Proceed without invoking this filter...
handler.handlePageRender(parameters);
} else {
doFilterInternal(new PageRenderEventHandler(handler, 
parameters));
}
}

@Override
public void handleComponentEvent(final
ComponentEventRequestParameters parameters, final
ComponentRequestHandler handler) throws IOException {
if (alreadyFiltered()) {
// Proceed without invoking this filter...
handler.handleComponentEvent(parameters);
} else {
doFilterInternal(new ComponentEventHandler(handler, 
parameters));
}
}



private void doFilterInternal(EventHandler stuff) throws IOException {
SessionFactory sessionFactory =
applicationContext.getBean(sessionFactory, SessionFactory.class);
boolean participate = false;

// single session mode
if 
(TransactionSynchronizationManager.hasResource(sessionFactory)) {
// Do not modify the Session: just set the participate 
flag.
participate = true;
} else {
LOG.debug(Opening single Hibernate Session in 
OpenSessionInViewFilter);
Session session = getSession(sessionFactory);

TransactionSynchronizationManager.bindResource(sessionFactory, new
SessionHolder(session));
}

try {
stuff.doStuff();

} finally {
if (!participate) {
SessionHolder sessionHolder = (SessionHolder)
TransactionSynchronizationManager.unbindResource(sessionFactory);
LOG.debug(Closing single Hibernate Session in 
OpenSessionInViewFilter);

SessionFactoryUtils.closeSession(sessionHolder.getSession());
}
}
}

@SuppressWarnings(deprecation)
private Session getSession(SessionFactory sessionFactory) {
Session session = 
SessionFactoryUtils.getSession(sessionFactory, true);
session.setFlushMode(FlushMode.NEVER);
return session;
}

private boolean alreadyFiltered() {
String alreadyFilteredAttributeName =
OpenSpringSessionInViewFilter.FILTERED;
boolean alreadyFiltered =
request.getAttribute(alreadyFilteredAttributeName) != null;
request.setAttribute(alreadyFilteredAttributeName, 
Boolean.TRUE);
return alreadyFiltered;
}

private final class PageRenderEventHandler implements EventHandler {
private final ComponentRequestHandler handler;
private final PageRenderRequestParameters parameters;

   

Re: mixin with t:datefield bug?

2012-05-14 Thread Steve Eynon
Rather writing out your own disabled attribute, try having your Mixin
bind to the disabled parameter:

@BindParameter
private boolean disabled;

then set this to false and have the input component disable itself:

void beginRender() {
disabled = true;
}

--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 15 May 2012 03:52, Emmanuel DEMEY demey.emman...@gmail.com wrote:
 Hi Alexander

 I think the problem come from the fact that the input element of the
 datefield is closed (writer.end()) in the beginRender phase. So when your
 mixin is executed, it is too late.

 You should maybe test if the field using the mixin is a Datefield, and if
 this the case, get the Input Element (one of the children of the current
 element) and set the disable attribute.

 Manu

 2012/5/14 sommeralex alexander.som...@gmail.com

 Hello!

 I have a mixin which is responsible for deactivating some input-form
 elements (textfields, textareas, and datefields).

 My mixin function works on select fields and on textfields, but with one
 exception: if i am using my mixin on t:datefield, it does not work.

 My Mixin in short:

 @MixinAfter
 public class DecoFeatureInput {

 ...
 ...

        @BeginRender
        void beginRender(MarkupWriter writer){
                if(
 !productService.isAvailableProduct(userService.getCurrentUser(),
 productName) ){
                        writer.attributes(disabled ,true);
                }
        }
 }


 My TML components is:

 t:textfield t:mixins=decoFeatureInput productName=Question
 value=message.question /

 and this works, the resulting HTML is:

 input disabled=true id=textfield_0 name=textfield_0
 type=text/input

 *therefore, the disabled tag is on the right position. *

 BUT

 t:datefield t:mixins=decoFeatureInput  productName=Schedule
 value=message.endDate  t:id=endDate /

 does not work. My datefield is not deactivated, even if the Product
 schedule is not available.

 the resulting HTML is:

 *TD disabled=true*input value= id=endDate name=endDate
 type=text/input

 *so, the disabled tag is written BEFORE the input tag. *


 the complete code:


 t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;



 t:form
 t:hidden value=groupID /

 Message

 label class=inputLabel for=text${message:Text}/labelbr/br
 t:textarea style=width:450px; t:id=text value=message.text rows=2
 validate=required /
 br/br

 br/br
 Location

 label class=inputLabel for=address${message:Address}/labelbr/br
 input id=address type=text style=width:430px
 onChange=goToAddress(this.value); onKeyPress=return checkEnter();/
 button name=Go type=button class=button
 onclick=goToAddress($('address').value);${message:Go}/button
 br/
 div style=width:450px;
 ${message:AddressInGroupScope} ${message:DragMapOrMarkerToLocation}
 br/
 t:googleMaps /
 /div

 br/br
 javascript:void(0); ${message:AdvancedLocation}

 div style=width:450px;
 div id=divAdvancedLocation style=display:none
        t:textfield t:id=longitude t:label=${message:Longitude}
                value=message.geoPoint.longitude validate=required
                onChange=javascript:goToLatLng(map, $('latitude').value,
 this.value);
                t:mixins=decoField /

        t:textfield t:id=latitude t:label=${message:Latitude}
                value=message.geoPoint.latitude validate=required
                onChange=javascript:goToLatLng(map, this.value,
 $('longitude').value);
                t:mixins=decoField /
 /div
 /div

 div class =map id=map/div



 br /

        div class=sliderfeature







                        t:slider t:id=slider onSlide=onSlide(value);
 value=message.radiusInMeters /

                        ${message:scope}

                        m.

                        km.

                        ${message:Miles}


                        t:html.hidden t:id=scopeRadius
 value=message.radiusInMeters /

        /div

        t:if test=groupHasFeatures

 Features

        /t:if

        br/br
        t:if test=group.hasEmotions
                div class=feature
                        div class=featureIcon
                                 /img/icon/attributes/icon_emotion_55x55.png
                        /div
                        div class=featureLabel
                                label class=inputLabel
 for=emotion${message:Emotion}/label
                                br/br
                        /div
                        div class=featureInput
                                t:select value=message.emotion
 id=emotion
 t:mixins=decoFeatureInput
                                        productName=Emotions /
                        /div
                /div
        /t:if


        t:if test=group.hasRelationship
                div class=feature
                        div class=featureIcon

 /img/icon/attributes/icon_relationship_55x55.png
                        /div
                        div class=featureLabel

Re: Tapestry.ZONE_UPDATED_EVENT issue

2012-05-13 Thread Steve Eynon
Try removing the double quotes from Tapestry.ZONE_UPDATED_EVENT :

 $jq(mediaZone).on(Tapestry.ZONE_UPDATED_EVENT, function(){
alert(EVENT TRIGGERED);
 });

Failing that, not knowing anything about jQuery integration, I'd try
the more T5 standard Prototype functions:

 $(mediaZone).observe(Tapestry.ZONE_UPDATED_EVENT, function(event) {
alert(EVENT TRIGGERED);
 });

Steve.



On 14 May 2012 04:29, bogdan_cm bogdan.iva...@rbccm.com wrote:
 Hello everyone,
  I have this nagging little problem handling the zone updated event. I
 tried all that I could find on this forum and still cannot solve it.

 My TML zone:

        t:zone t:id=mediaZone id=mediaZone
        div id=big_photo_div
                Some other code here.
        /div
        /t:zone


 my jquery event handler sitting in the .js file and imported into the page:

 $jq(mediaZone).on(Tapestry.ZONE_UPDATED_EVENT, function(){
        alert(EVENT TRIGGERED);
 });

 The above does not work when the zone is updated.

 Is there a working example posted anywhere? I can only find bits and pieces
 of examples that do not work when put together.

 Thanks very much,
 Bogdan.

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Tapestry-ZONE-UPDATED-EVENT-issue-tp5708402.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: Basic question about URL rewriting and Tapestry 5

2012-05-10 Thread Steve Eynon
It's just that implementing a LinkTransformer is lot of work and
constructing / deconstructing PageRenderRequestParameters from a raw
Request is not a simple task.

Whereas the external solutions offer a simple search / replace
functionality on the url.

Steve.



On 8 May 2012 19:53, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote:
 May I ask why external solutions to URL rewriting are always suggested when
 Tapestry provides a perfectly good one out-of-the-box and that can take
 advantage of all the Tapestry infrastructure?


 On Tue, 08 May 2012 07:07:32 -0300, Julien Martin bal...@gmail.com wrote:

 Thanks Steve.
 I was also considering: http://ocpsoft.org/rewrite/
 Julien.

 2012/5/8 Steve Eynon steve.ey...@alienfactory.co.uk

 I find Tuckey's Url Rewrite Filter a good option for simple rewrites:

 http://www.tuckey.org/urlrewrite/

 Steve.
 --
 Steve Eynon
 ---
 If at first you don't succeed,
   so much for skydiving!



 On 8 May 2012 04:23, Julien Martin bal...@gmail.com wrote:
  Thanks Thiago!
 
 
  2012/5/7 Julien Martin bal...@gmail.com
 
  Thanks Thiago!
  I was not aware of that.
  J.
 
  2012/5/7 Thiago H. de Paula Figueiredo thiag...@gmail.com
 
  On Mon, 07 May 2012 14:19:24 -0300, Julien Martin bal...@gmail.com
  wrote:
 
   Hi all!
 
 
  Hi!
 
 
   @Thiago: My only concern is about SEO optimization. Can you provide
 any
  guideline about LinkTransformer usage? I read Igor's blog entry but
  I
 am
  still not sure how to use the LinkTransformer for my specific use
 case...
 
 
  For SEO optimization, as far as I know, the event URLs are
  irrelevant,
 as
  the crawlers (bots) follow redirects.
 
 

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



Re: Basic question about URL rewriting and Tapestry 5

2012-05-10 Thread Steve Eynon
Yeah, I was quite dismayed when the old URL Rewriter API disappeared
to make way for the LinkTransformer - it'd be great if something
similar was resurrected!

In the mean time, I'm checking out Lance's suggestion.

Steve.



On 10 May 2012 20:40, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote:
 On Thu, 10 May 2012 08:58:50 -0300, Steve Eynon
 steve.ey...@alienfactory.co.uk wrote:

 It's just that implementing a LinkTransformer is lot of work and
 constructing / deconstructing PageRenderRequestParameters from a raw
 Request is not a simple task.
 Whereas the external solutions offer a simple search / replace
 functionality on the url.


 This could be done easily with the old URL Rewriter API. I'm planning to
 provide it as a separate package soon.


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



Re: Basic question about URL rewriting and Tapestry 5

2012-05-08 Thread Steve Eynon
I find Tuckey's Url Rewrite Filter a good option for simple rewrites:

http://www.tuckey.org/urlrewrite/

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!



On 8 May 2012 04:23, Julien Martin bal...@gmail.com wrote:
 Thanks Thiago!


 2012/5/7 Julien Martin bal...@gmail.com

 Thanks Thiago!
 I was not aware of that.
 J.

 2012/5/7 Thiago H. de Paula Figueiredo thiag...@gmail.com

 On Mon, 07 May 2012 14:19:24 -0300, Julien Martin bal...@gmail.com
 wrote:

  Hi all!


 Hi!


  @Thiago: My only concern is about SEO optimization. Can you provide any
 guideline about LinkTransformer usage? I read Igor's blog entry but I am
 still not sure how to use the LinkTransformer for my specific use case...


 For SEO optimization, as far as I know, the event URLs are irrelevant, as
 the crawlers (bots) follow redirects.


 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, Ars Machina Tecnologia da Informação Ltda.
 http://www.arsmachina.com.br




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



[T5.3.3] Removing The LoopBack Parameter From An EventLink

2012-05-07 Thread Steve Eynon
Hi,

I have a use-case where I'd like to remove the LoopBack parameter from
an EventLink. For now I've just created a Link from ComponentResources
and stuck it in an a tag, but I'd like to propose the following
change to org.apache.tapestry5.corelib.base.AbstractComponentEventLink:

  protected void setupRender() {
super.link = createLink(context);
  }

AbstractLink.link would also need to become protected.

This would allow me to write a Mixin which could alter the Link and
it's paramters before it gets rendered (i.e. remove the LoopBack
parameter). Currently the link field is set *after* it is written out,
which is a little late for my purpose.

Any thoughts?

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!

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



Re: Accessing protected instrumented fields

2012-04-12 Thread Steve Eynon
Oh sweet. That is good news, cheers!
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!




On 13 April 2012 06:47, Howard Lewis Ship hls...@gmail.com wrote:
 Turns out its mutable fields that don't work.  I was fooled because my
 tests mistakenly only attempted injected fields.

 In any case, it is fixed in 5.3.3-rc-3.

 On Wed, Apr 11, 2012 at 9:20 PM, Steve Eynon
 steve.ey...@alienfactory.co.uk wrote:
 Hello,

 Directly accessing instrumented fields (@Parameter etc...) from
 subclasses does not work. This is fine, but I do wish T5 complained
 bitterly when it finds a instrumented field marked as non-public.

 Olaf found similar problems here (TAP5-1860):
 http://tapestry.1045711.n5.nabble.com/Protected-page-properties-confusion-td5607824.html

 We've come a cropper with this a couple of times when young'uns mark a
 @Parameter field as protected and accesses it from a subclass. The
 nasty gotcha being, that once the field is shadowed in DevMode, it
 works fine! But then fails spectacularly in ProdMode with an NPE as
 the actual field instance is never set!

 I know this is all related to TAP5-1801 and the T5.3.2 release but I'm
 not really sure what it was supposed to address. If, as I suspect, we
 shouldn't mark instrumented fields as protected could the
 documentation be updated to say so? (
 http://tapestry.apache.org/component-classes.html#ComponentClasses-InstanceVariables
 )

 Cheers,

 Steve.
 --
 Steve Eynon
 ---
 If at first you don't succeed,
    so much for skydiving!

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




 --
 Howard M. Lewis Ship

 Creator of Apache Tapestry

 The source for Tapestry training, mentoring and support. Contact me to
 learn how I can get you up and productive in Tapestry fast!

 (971) 678-5210
 http://howardlewisship.com

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


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



Accessing protected instrumented fields

2012-04-11 Thread Steve Eynon
Hello,

Directly accessing instrumented fields (@Parameter etc...) from
subclasses does not work. This is fine, but I do wish T5 complained
bitterly when it finds a instrumented field marked as non-public.

Olaf found similar problems here (TAP5-1860):
http://tapestry.1045711.n5.nabble.com/Protected-page-properties-confusion-td5607824.html

We've come a cropper with this a couple of times when young'uns mark a
@Parameter field as protected and accesses it from a subclass. The
nasty gotcha being, that once the field is shadowed in DevMode, it
works fine! But then fails spectacularly in ProdMode with an NPE as
the actual field instance is never set!

I know this is all related to TAP5-1801 and the T5.3.2 release but I'm
not really sure what it was supposed to address. If, as I suspect, we
shouldn't mark instrumented fields as protected could the
documentation be updated to say so? (
http://tapestry.apache.org/component-classes.html#ComponentClasses-InstanceVariables
)

Cheers,

Steve.
--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!

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



Re: Which method is called in a page when click back button from browser

2012-04-02 Thread Steve Eynon
I always enjoyed this post on the topic:

http://tapestry.1045711.n5.nabble.com/Browser-Back-Button-td4909542.html#a4917143

Steve.


On 31 March 2012 02:08, fredramsey fredram...@gmail.com wrote:
 And this:

 http://www.boutell.com/newfaq/creating/backbutton.html

 You can probably find other solutions, just google disable browser back
 button.

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Which-method-is-called-in-a-page-when-click-back-button-from-browser-tp5606532p5607363.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: T5.3 datetime settings question

2012-03-26 Thread Steve Eynon
Our apps have something like this in the module:

  @Startup
  public static void setDefaultTimeZones(@Inject
@Symbol(PlatformSymbols.DEFAULT_TIMEZONE_TO_UTC) boolean
setTimezoneToUtc) {
if (setTimezoneToUtc) {
  System.setProperty(user.timezone, UTC);
  org.joda.datetime.DateTimeZone.setDefault(DateTimeZone.UTC);
  java.util.TimeZone.setDefault(TimeZone.getTimeZone(UTC));
}
  }


On 27 March 2012 04:30, Paul Stanton p...@mapshed.com.au wrote:
 you need to change the timezone setting for the jvm via -Duser.timezone, but
 even then you need to patch an outstanding bug with the DateField:

 https://issues.apache.org/jira/browse/TAP5-841


 On 25/03/2012 7:48 AM, bigcache1 wrote:

 Hello, everybody.
 I want to set the time in the application to the UTC+4, how should I do
 that?
 I would prefer not to touch the server settings.

 And can I change the datepicker using the SymbolConstraints.Datepicker
 property?

 P.S. I have searched the first question for 20 minutes, but google gives
 me
 something like 'comile time', or time of posts on the forum.

 --
 View this message in context:
 http://tapestry.1045711.n5.nabble.com/T5-3-datetime-settings-question-tp5592275p5592275.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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



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


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



Re: Boolean Return Values in Custom Component Events

2012-03-22 Thread Steve Eynon
Food for future thought - the way the event return value is used for
multiple purposes and may, or may not be passed to your callback seems
a little messy. Currently we have -

in ComponentPageElementImpl:

  ComponentEventCallback wrapped = new ComponentEventCallback() {
public boolean handleResult(Object result) {
  // Boolean value is not passed to the handler; it will be true
(abort event)
  // or false (continue looking for event handlers).

  if (result instanceof Boolean)
  return (Boolean) result;

  return providedHandler.handleResult(result);
}
  };

I guess I would rather the callback not be wrapped and instead have an
abstract implmentation for the default Boolean behaviour.

Steve.

--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!


On 21 March 2012 20:19, Thiago H. de Paula Figueiredo
thiag...@gmail.com wrote:
 On Wed, 21 Mar 2012 00:28:25 -0300, Steve Eynon
 steve.ey...@alienfactory.co.uk wrote:

 Hi,


 Hi!


 So it seems Boolean is a 'reserved' event return value.


 100% correct.


 Is there
 another way to determine if an event was aborted via a true return
 value or do need to make my own Boolean enum?


 As you said, create your own class for the return value.

 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
 instructor
 Owner, Ars Machina Tecnologia da Informação Ltda.
 http://www.arsmachina.com.br

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


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



Re: MarkupWriter + HTML (5) Validation

2012-03-22 Thread Steve Eynon
Sounds like this Jira:

Filter out attributes with default value (from DTD) when parsing templates
https://issues.apache.org/jira/browse/TAP5-171

--
Steve Eynon
---
If at first you don't succeed,
   so much for skydiving!


On 23 March 2012 05:28, Thiago H. de Paula Figueiredo
thiag...@gmail.com wrote:
 Hi!

 Take a look at the MarkupWriterFactoryImpl, DefaultMarkupModel, and
 XMLMarkupModel classes in the Tapestry sources.

 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
 instructor
 Owner, Ars Machina Tecnologia da Informação Ltda.
 http://www.arsmachina.com.br


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


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



Boolean Return Values in Custom Component Events

2012-03-20 Thread Steve Eynon
Hi,

I wish to raise an event from a component and abort further processing
if true is returned from any event handlers - only I don't know how!

ComponentResources.triggerEvent() returns true if *any* event handler
was invoked, regardless of what it returns.

Passing a ComponentEventCallback doesn't work either because (as
quoted from ComponentPageElementImpl source) Boolean value is not
passed to the handler;

So it seems Boolean is a 'reserved' event return value. Is there
another way to determine if an event was aborted via a true return
value or do need to make my own Boolean enum?

Cheers,

Steve.
--
Steve Eynon

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



Re: [T5.3] Contributing a Service Override using addInstance()

2012-03-06 Thread Steve Eynon
 and is not 
 practical to change them.


 -Original Message-
 From: Steve Eynon [mailto:steve.ey...@alienfactory.co.uk]
 Sent: 21 February 2012 10:36
 To: Tapestry users
 Subject: Re: [T5.3] Contributing a Service Override using
 addInstance()

 Hi, I'm not really sure what's going on as the two classes you mention, 
 ValidatingMappedConfigurationWrapper  AbstractConfigurationImpl, don't 
 appear in your code snippet.

 If you define your overriding service as an Interface (say in the
 bind() method) then T5 will create a proxy for it.

 public static void bind(ServiceBinder binder) {
        binder.bind(ToOverrideInterface.class,
 ToOverrideImpl.class).withId(anything so we don't conflict with the
 existing ID); }

 then you can inject that in the service override like this:

 public static void contributeServiceOverride(MappedConfiguration
 config, @Local ToOverrideInterface override) {
        config.add(ToOverrideInterface.class, override); }

 The @Local is important, otherwise T5 doesn't know which serivce to inject 
 (yours or the one you're trying to override).

 Steve.


 On 20 February 2012 20:54, Blower, Andy andy.blo...@proquest.co.uk wrote:
 I managed to get this to work by tracking down all dependencies and 
 finding that one was being used in the services' constructor. Once I 
 moved the initialisation code into a lazy init method I stopped getting 
 the exceptions.

 Unfortunately, I still have an issue because when using addInstance() 
 Tapestry is not using a proxy for the overriding service implementation, 
 instead I'm getting a concrete reference instead which I thought never 
 happened with Tapestry IoC. This causes problems when used in objects 
 that are serialized to the session because it tries to serialize the 
 service implementation rather than just the service proxy.

 My override looks like this:

        @Contribute(ServiceOverride.class)
        public static void
 setupApplicationServiceOverrides(MappedConfigurationClass?,
 Object
 configuration)
        {
                configuration.addInstance(ProductConfig.class,
 DynamicMultiProductConfig.class);
        }

 Basically the contributionType in ValidatingMappedConfigurationWrapper 
 (AbstractConfigurationImpl) is Object which isn't an interface so a proxy 
 isn't created. How can I change the signature of my module service 
 override method so that contributionType is an interface and I get a 
 service proxy like every other service?

 Can anyone help me?


 -Original Message-
 From: Blower, Andy [mailto:andy.blo...@proquest.co.uk]
 Sent: 15 February 2012 14:51
 To: users@tapestry.apache.org
 Subject: [T5.3] Contributing a Service Override using addInstance()

 I've read the section below about contributing a service override. This 
 method is exactly what I need to resolve an issue I'm having getting a 
 conditional override implemented, but it doesn't appear to work if the 
 service implementations' constructor has any other T5 service 
 dependencies in the signature. (T5 complains that ServiceOverride depends 
 on itself.

 Is this true, because that doesn't seem to be what's implied below by 
 handle dependency resolution, and makes addInstance of limited 
 usefulness. I'm hoping I'm just missing something here.



 From http://tapestry.apache.org/ioc-cookbook-overriding-ioc-services.html 
 :

 In this case, it is very easy to supply your own alternate 
 implementation of a service.
 AppModule.java (partial)

  @Contribute(ServiceOverride.class)

  public static void
 setupApplicationServiceOverrides(MappedConfigurationClass,Object
 configuration)

  {

    configuration.addInstance(SomeServiceType.class,
 SomeServiceTypeOverrideImpl.class);

  }

 The name of the method is not important, as long as the 
 @Contributehttp://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Contribute.html
  annotation is present on the method.

 In this example, we are using addInstance() which will instantiate the 
 indicated class and handle dependency resolution. (Be careful with this, 
 because in some cases, resolving dependencies of the override class can 
 require checking against the ServiceOverrides service, and you'll get a 
 runtime exception about ServiceOverrides requiring itself!)



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


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




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




 --
 Howard M. Lewis Ship

 Creator of Apache Tapestry

 The source for Tapestry training, mentoring and support

  1   2   3   4   >