Re: Development Environment

2008-09-27 Thread adamh

I currently use Eclipse 3.4 J2EE, Run-Jetty-Run and Jetty 6 with no problems
at all, I can debug quite happily through the debugger with class reloading
(components/pages) and template (.tml) changes all happening live. The only
thing I need to restart for is non-managed clesses such as Entities and
Services - no biggie, jetty restarts virtually instantly on my machine.

Have a look at:
http://wiki.apache.org/tapestry/Tapestry5HowToSetupEclipseRunJettyRun

-- 
View this message in context: 
http://www.nabble.com/Development-Environment-tp19686205p19704939.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



RenderInformals on Component With Template

2008-06-22 Thread adamh

Hi All,

I seem to be having trouble getting my component to render informal
parameters, see enclosed classes, I can only get the informals to render on
the container element, not on the component itself. 

So I have my Inf component which uses a tml - the compnent div already
having an 'existing' attribute, but does not define a t:body element. I use
the component in my InfTest page like so:




I would expect:

Inf Component


but get:

Inf Component



I've tried the various render phase methods but I'm still getting this
behaviour. I've looked at the code for other components but they seem to
build the output in code without a template.

Environment:
OS X 10.5.3
Java 1.5.0_13
Tapestry 5.0.14-20080621.110019-10

Any ideas?


/**
 * A simple component with a template that should render its informal params
 */
@SupportsInformalParameters
public class Inf {

@Inject
private ComponentResources res;

// @BeginRender seems to render the components informals to the 
containing
element, not the
// component element
@BeginRender
void renderInfs_BeginRender(MarkupWriter writer) {
// res.renderInformalParameters(writer);
}

// BeforeRenderTemplate seems to render the components informals to the
containing element, not the
// component element
@BeforeRenderTemplate
void renderInfs_BeforeRenderTemplate(MarkupWriter writer) {
// res.renderInformalParameters(writer);
}

// @BeforeRenderBody does not render any informals anywhere, probably 
not
called as this component does not define a  in the tml
@BeforeRenderBody
void renderInfs_BeforeRenderBody(MarkupWriter writer) {
// res.renderInformalParameters(writer);
}

// @AfterRenderBody does not render any informals anywhere, probably not
called as this component does not define a  in the tml
@AfterRenderBody
void renderInfs_AfterRenderBody(MarkupWriter writer) {
// res.renderInformalParameters(writer);
}

// @AfterRenderTemplate seems to render the components informals to the
containing element, not the
// component element
@AfterRenderTemplate
void renderInfs_AfterRenderTemplate(MarkupWriter writer) {
// res.renderInformalParameters(writer);
}

@AfterRender
// @AfterRender seems to render the components informals to the 
containing
element, not the
// component element
void renderInfs_AfterRender(MarkupWriter writer) {
// res.renderInformalParameters(writer);
}

}

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



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


Hi


-- 
View this message in context: 
http://www.nabble.com/RenderInformals-on-Component-With-Template-tp18053261p18053261.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: t5 - Classloader issues with System classpath

2008-05-25 Thread adamh

Hi Ben,

I'm no classloader expert but I had a similar problem running with
RunJettyRun, that might be related to your problem, but I think its a clash
between the SLF4J in Jetty and the one in your app see
http://wiki.apache.org/tapestry/Tapestry5HowToSetupEclipseRunJettyRun

Regards,
Adam.
-- 
View this message in context: 
http://www.nabble.com/t5---Classloader-issues-with-System-classpath-tp17455266p17455858.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: T5: Exception occurs in onActivate

2008-01-13 Thread adamh

Hi All,

I'm seeing the same behaviour, I have a page that displays a list of items
which link off to a viewitem page with a pagelink with an item id for the
context (a string). When I hit the viewitem page I'm seeing the onActivate
event handler being called twice, the first time I can see that the item id
is there, then the second time its "asset"

ViewItem.java:
public void onActivate(String theID) {
log.debug(theId);
}


The tml is very light, no images/assets being used, the only asset that gets
rendered out in the final html is the  that
Tapestry auto renders.

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


Log output:
DEBUG - uk.co.app.pages. ViewItem.onActivate(36) | A4S4
DEBUG - uk.co.app.pages. ViewItem.onActivate(36) | assets

Is there any reason why I should see two invocations, this is a render
request so only one cycle should be seen right?

Any ideas?

Thanks, Adam.




Josh Penza wrote:
> 
> Can someone explain the following exception?
> 
> I click on a productdetail url like ('/productdetail/9)
> The system.out in ProductDetail. java prints nicely 9 to the screen.
> **
> *void* onActivate(Long productId) {
>  *this*.productId = productId;
>  System.*out*.println("ProductDetail.onActivate :" +
> *this*.productId);
> }
> 
> But where does the "assets" String come from??
> 
> Exception in method
> org.example.web.tapestry.pages.ProductDetail.onActivate(
> java.lang.Long) (at ProductDetail.java:49), parameter #1: Coercion of
> assets
> to type java.lang.Long (via String --> Long) failed: For input string:
> "assets"
> 
> Caused by: *java.lang.RuntimeException*: Coercion of assets to type
> java.lang.Long (via String --> Long) failed: For input string: "assets"
> 
> at org.apache.tapestry.ioc.internal.services.TypeCoercerImpl.coerce(*
> TypeCoercerImpl.java:154*)
> 
> at $TypeCoercer_1158a09422d.coerce($TypeCoercer_1158a09422d.java)
> 
> at
> org.apache.tapestry.internal.services.ComponentEventImpl.coerceContext(*
> ComponentEventImpl.java:90*)
> 
> ... 43 more
> 
> Caused by: *java.lang.NumberFormatException*: For input string: "assets"
> 
> at java.lang.NumberFormatException.forInputString(*
> NumberFormatException.java:48*)
> 
> at java.lang.Long.parseLong(*Long.java:403*)
> 
> at java.lang.Long.(*Long.java:671*)
> 
> at org.apache.tapestry.ioc.services.TapestryIOCModule$9.coerce(*
> TapestryIOCModule.java:232*)
> 
> at org.apache.tapestry.ioc.services.TapestryIOCModule$9.coerce(*
> TapestryIOCModule.java:230*)
> 
> at org.apache.tapestry.ioc.services.CoercionTuple$CoercionWrapper.coerce(*
> CoercionTuple.java:53*)
> 
> at org.apache.tapestry.ioc.internal.services.TypeCoercerImpl.coerce(*
> TypeCoercerImpl.java:150*)
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-Exception-occurs-in-onActivate-tp13135811p14787478.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



JS Library Inclusion Idea

2008-01-12 Thread adamh

Hi All,

I love T5.

However I'm not over the moon with being force-fed protoype/scriptaculous
when I'm developing say a dojo app, I don't want proto/scrpt downloaded as
well to do stuff that dojo can do, so here is my suggestion with dealing
with this.

Normally all the standard functionality is handled through the tapestry.js
file which is coded to use proto/script, now surely all we need to do is
have a standard API defined which can handle all the Tapestry stuff like
validation etc and have an implementation for each js library?

So we have a Tapestry javascript API defined interface like:
Tapestry.registerForm(form, clientValidations)
Tapestry.registerValidations : function(form, clientValidations)
Tapestry.linkZone(link, zoneDiv)
Tapestry.initializeZones(zoneSpecs, linkSpecs)
Tapestry.addValidator(field, acceptBlank, validator)
Tapestry.ElementAdditions.decorateForValidationError(element, event,
message)
Tapestry.Validator.required(field, message)
Tapestry.Validator.minlength(field, message, length)
Tapestry.Validator.maxlength(field, message, maxlength)
Tapestry.Validator.min(field, message, minValue)
Tapestry.Validator.max(field, message, maxValue)
Tapestry.Validator.regexp(field, message, pattern)
etc

tapestry.js could just contain common lib agnostic stuff only - no
implementations of the above interface. 

Then create a tapestry-[lib].js file for each library.

Then tell the app what libraries to use along with a Tapestry implementation
to use:

js-libraries=tapestry-tapestry.js
js-libraries=/dojo-1.0.2/dojo/dojo.js,tapestry-dojo102.js
js-libraries=/prototype-1.6/prototype.js,/scriptaculous/scriptaculous.js,tapestry-proto16scriptac18.js
js-libraries=/ext-2.0/extjs.js,tapestry-ext20.js

The last entry will be the Tapestry implementation for that library.

So you would end up with the following getting downloaded: tapestry.js,
[lib].js, tapestry-[lib].js

That way Tapestry becomes completely library agnostic, it just makes calls
to its API and the actual implementation is handles by the specialised
tapestry-[lib].js. 

I'd love to see something like this implemented, I don't think there should
be any major technical reasons why something like this could not be
implemented (or can it de done now??) but I'd like to know what people
think.

Regards,
Adam

Reated:https://issues.apache.org/jira/browse/TAPESTRY-1650

PS. Keep up the great work lads.
-- 
View this message in context: 
http://www.nabble.com/JS-Library-Inclusion-Idea-tp14776058p14776058.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: T5: Grid component, reorder and empty source

2007-11-16 Thread adamh

Hi Arve,

Yep, I got it to work as well - I should have been a bit more persistent
with my searching, still its little 'should be simple' things like this that
can trip you up if you are new to the T5 way. Its just a question of the
docs getting updated, I thought I saw talk of a grid section/tutorial
somewhere.


Arve Klev wrote:
> 
> yes, it works fine.
> 
> 
> 2007/11/16, Joshua Jackson <[EMAIL PROTECTED]>:
>>
>> On 11/16/07, Arve Klev <[EMAIL PROTECTED]> wrote:
>> > hi,
>> > as a novice in regards to Tapestry, I first thought it was a bug,
>> > but at last I tried to supply a beanmodel, and everything is fine
>> (obvious
>> > to others, I think).
>> > I found the tip here:
>> >
>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/beaneditform.html
>> .
>> >
>> > 
>> >
>> >@Inject
>> >private BeanModelSource _beanModelSource;
>> >
>> >@Inject
>> >private ComponentResources _resources;
>> >
>> >@Retain
>> >private BeanModel _model;
>> >
>> >public BeanModel getPersonModell() {
>> >return _model;
>> >}
>> >
>> >void pageLoaded() {
>> >_model = _beanModelSource.create(Person.class, false,
>> _resources);
>> >}
>> >
>> > Is this the right way to inform the grid component to use the "
>> Person.class
>> > "?
>>
>> Have you tried it yet?
>>
>>
>> --
>> What you want today, may not exist tommorrow
>>
>> Blog: http://joshuajava.wordpress.com/
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-Grid-component%2C-reorder-and-empty-source-tf4782045.html#a13797863
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: T5: Grid component, reorder and empty source

2007-11-13 Thread adamh

I'm seeing the same behaviour, if my source is empty and I use the 'remove'
parameter I get the same exception:

'grid: xxx -- no source to determine list type from'

Results.tml


Removing the 'remove' param the page renders with the 'nothing to display'
message.

-- 
View this message in context: 
http://www.nabble.com/T5%3A-Grid-component%2C-reorder-and-empty-source-tf4782045.html#a13732796
Sent from the Tapestry - User mailing list archive at Nabble.com.


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