T5: native component needs asset: effects.js but I want to combine/minify js-files

2010-03-18 Thread britske

I've decorated ClientInfrastructure to supply my own set of required
js-files. 
this is only 1 file containing complete prototype and a modified version of
scriptaculous (stripped what I dont need, and some overridden controls) 
This all works well, but there is still a native component that injects
effects.js. 
Is there a way to override which file this component needs to look at? 

At the moment I haven't got an idea which component is triggering the
inclusion of effects.js. I don't recall having any component in use  (direct
or subclassed) that uses it. 

of course i could always rename my javascript file to effects.js but this
would be a matintenace nightmare: new version of scriptaculous -- overwrite
effects.js..

any help appreciated...
thanks Geert-Jan
-- 
View this message in context: 
http://n2.nabble.com/T5-native-component-needs-asset-effects-js-but-I-want-to-combine-minify-js-files-tp4759964p4759964.html
Sent from the Tapestry Users 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



T5: logging statements logged twice using Log4j

2010-02-19 Thread britske

Hi, 

I'm having the problem (always had as far as I remember, but it starts to
bug me now) that when using Log4j with Tapestry every log-statement is
logged twice to the console. For example, the last few lines before the
tapestry is initialized look like this: 

INFO - ApplicationContext.log(646) |
org.tuckey.web.filters.urlrewrite.utils.Log ERROR: logLevelConf: null
org.tuckey.web.filters.urlrewrite.utils.Log ERROR: logLevelConf: null
INFO - ApplicationContext.log(646) |
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: loaded (conf ok)
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: loaded (conf ok)
INFO - Http11BaseProtocol.init(144) | Initializing Coyote HTTP/1.1 on
http-8080
Initializing Coyote HTTP/1.1 on http-8080
INFO - Http11BaseProtocol.start(156) | Starting Coyote HTTP/1.1 on http-8080
Starting Coyote HTTP/1.1 on http-8080

Since the formatting of the 'duplicates' is different I figure there must
somehow be a different logger at work. 
I already tried pluggin in the vanilla logging.properties from the tapestry
5 archetype but nothing changes.

Anyone got any clue where to look? 

p.s: I'm running in Tomcat 5.5  does this have anything to do with  it?
-- 
View this message in context: 
http://n2.nabble.com/T5-logging-statements-logged-twice-using-Log4j-tp4597599p4597599.html
Sent from the Tapestry Users 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




Re: T5: some automagical way to export versioned assets to CDN?

2010-01-22 Thread britske

Just to get this straight: That code takes care of rewiring the templates to
use the correct asset-path right?
But it doesn't take care of actually getting the updated assets to CDN in
the first place?

Thanks,
Geert-Jan

2010/1/22 Jun Tsai [via Tapestry Users] 
ml-node+4438110-1664249...@n2.nabble.comml-node%2b4438110-1664249...@n2.nabble.com


 You can override AssetPathConverter  service.

 example:

 http://code.google.com/p/corner/source/browse/corner3/trunk/src/main/java/corner/asset/services/impl/CDNAssetPathConverterImpl.java



 2010/1/22 britske [hidden 
 email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4438110i=0


 
  Versioning in Tapestry is really easy. Just increment the version-nr in
  appModule and you're set.
 
  However, I'd like my assets to live on a CDN. (Amazon S3 + cloudfront) .
  For
  this to work (along with versioning)  I would have to do 2 conceptual
  things:
  1. export assets to a specific s3 bucket linked to cloudfront.
  2. point html-code to correct path.
 
  To do this manually I'd have to:
  - up the version in appmodule by hand.
  - create a new s3 bucket by hand (with the version-nr encoded in it)
  - ? copy/ move the versioned assets-directory created by Tapestry to the
  newly created S3- bucket ( I assume it is created on-the-fly on run-time
  and
  are saved to disk?
  - point html-code to the new correct path. I assume I can code this once,

  bc. I must be able to access the versionnr, and along with the static
  s3-path be able to create the path to the newly created s3-bucket.
 
 
  All this is possible, but I would like it to be automated. Is this
 already
  possible (with some minor tweaking)
  If not, where would I start looking to automate this?
 
  any pointers highly appreciated.
 
  Best regards,
  Geert-Jan
 
  --
  View this message in context:
 
 http://n2.nabble.com/T5-some-automagical-way-to-export-versioned-assets-to-CDN-tp4437084p4437084.html
  Sent from the Tapestry Users mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: [hidden 
  email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4438110i=1
  For additional commands, e-mail: [hidden 
  email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4438110i=2
 
 


 --
 regards,
 Jun Tsai


 --
  View message @
 http://n2.nabble.com/T5-some-automagical-way-to-export-versioned-assets-to-CDN-tp4437084p4438110.html
 To unsubscribe from T5: some automagical way to export versioned assets to
 CDN?, click here (link removed) =.




-- 
View this message in context: 
http://n2.nabble.com/T5-some-automagical-way-to-export-versioned-assets-to-CDN-tp4437084p4439561.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


T5: how to eval 'canned' expansions (stored in db)?

2010-01-21 Thread britske

I have a page showing different blocks (ala myYahoo , netvibes, etc) . 
Each block is a different component. 

One of these components gets it's content from a database and writes it in
the BeginRender() - phase.  The content to store in the database is some
html possibly with tapestry expansions. E.g: today is:   #foo
${dateAsString}  or something.  (The database route is the way to go for me
in this scenario, as content is not known at design-time) 

Is there a way to evaluate the expansions in the the html in the
component.beginRender phase and render the result?
This would be pretty powerful stuff.

Thanks, 
Geert-Jan
-- 
View this message in context: 
http://n2.nabble.com/T5-how-to-eval-canned-expansions-stored-in-db-tp4433039p4433039.html
Sent from the Tapestry Users 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



Re: T5: how to eval 'canned' expansions (stored in db)?

2010-01-21 Thread britske

Thanks, this looks like the way to go.

2010/1/21 Howard Lewis Ship [via Tapestry Users] 
ml-node+4434057-1227788...@n2.nabble.comml-node%2b4434057-1227788...@n2.nabble.com


 You can inject the PropertyConduitSource service (it is public). You
 can obtain PropertyConduits, which are the compiled versions of
 property expressions (as used by parameter bindings).

 The PCS caches the result, so it's reasonable to pass an a class and
 an expression, get back a PC, and discard it.

 On Thu, Jan 21, 2010 at 3:12 AM, britske [hidden 
 email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4434057i=0
 wrote:

 
  I have a page showing different blocks (ala myYahoo , netvibes, etc) .
  Each block is a different component.
 
  One of these components gets it's content from a database and writes it
 in
  the BeginRender() - phase.  The content to store in the database is some
  html possibly with tapestry expansions. E.g: today is:   #foo
  ${dateAsString}  or something.  (The database route is the way to go for
 me
  in this scenario, as content is not known at design-time)
 
  Is there a way to evaluate the expansions in the the html in the
  component.beginRender phase and render the result?
  This would be pretty powerful stuff.
 
  Thanks,
  Geert-Jan
  --
  View this message in context:
 http://n2.nabble.com/T5-how-to-eval-canned-expansions-stored-in-db-tp4433039p4433039.html
  Sent from the Tapestry Users mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: [hidden 
  email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4434057i=1
  For additional commands, e-mail: [hidden 
  email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4434057i=2
 
 



 --
 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: [hidden 
 email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4434057i=3
 For additional commands, e-mail: [hidden 
 email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4434057i=4



 --
  View message @
 http://n2.nabble.com/T5-how-to-eval-canned-expansions-stored-in-db-tp4433039p4434057.html
 To unsubscribe from T5: how to eval 'canned' expansions (stored in db)?, click
 here (link removed) =.




-- 
View this message in context: 
http://n2.nabble.com/T5-how-to-eval-canned-expansions-stored-in-db-tp4433039p4434292.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


Re: T5: how to eval 'canned' expansions (stored in db)?

2010-01-21 Thread britske

I'd rather have an all- tapestry solution. Neverthless i'll have a look
thanks.

2010/1/21 Thiago H. de Paula Figueiredo [via Tapestry Users] 
ml-node+4433143-269793...@n2.nabble.comml-node%2b4433143-269793...@n2.nabble.com


 On Thu, 21 Jan 2010 09:12:02 -0200, britske [hidden 
 email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4433143i=0
 wrote:

  One of these components gets it's content from a database and writes it

  in the BeginRender() - phase.  The content to store in the database is
  some
  html possibly with tapestry expansions. E.g: today is:   #foo
  ${dateAsString}  or something.  (The database route is the way to go
  for me in this scenario, as content is not known at design-time)

 What about using some template engine like FreeMarker or Velocity in
 conjunction with the OutputRaw component or MarkupWriter.writeRaw()?

 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

 -
 To unsubscribe, e-mail: [hidden 
 email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4433143i=1
 For additional commands, e-mail: [hidden 
 email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4433143i=2



 --
  View message @
 http://n2.nabble.com/T5-how-to-eval-canned-expansions-stored-in-db-tp4433039p4433143.html
 To unsubscribe from T5: how to eval 'canned' expansions (stored in db)?, click
 here (link removed) =.




-- 
View this message in context: 
http://n2.nabble.com/T5-how-to-eval-canned-expansions-stored-in-db-tp4433039p4434300.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


t5: when updating zone, non persistent fields outside of zone are null, is this expected?

2009-10-14 Thread Britske

Perhaps a pretty ignorant question, but: 

I have a searchresults-page with a zone-component which is updated through
an ajax call. 
Another component lives within the zone-component and it's
setuprender-method is called. 

In this method I need to access the 'searchresults-object' which is stored
as a Map in the surrounding page. 
this map is NOT annotated with @Persist or anything

Somehow I figured  that since the page itself isn't updated, the
'searchresults-object' would still be available in the page, but instead the
value is null. 
Did I completely misunderstood this, or might something else be the problem? 

If I misunderstood, what would be the best way to have a zone that has
access to a results-set such as my  'searchresults-object' for which
calculating the results again is out of the question (from a performance
standpoint) 

I guess making it @Persist(flash)  would help, but how does the impact
performance, it destroys the option of tapestry reusing the page right? 

Thanks, 
Geert-Jan 
-- 
View this message in context: 
http://www.nabble.com/t5%3A-when-updating-zone%2C-non-persistent-fields-outside-of-zone-are-null%2C-is-this-expected--tp25895923p25895923.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



Re: t5: autocomplete mixin gets autofocus on field. I don't want that.

2009-09-03 Thread Britske

Yeah thanks! totally missed that. 


Joachim Van der Auwera (PROGS bvba) wrote:
 
 You can disable the autofocus handling in the form component.
 
 Joachim
 
 Britske wrote:
 I have a textfield enriched with the autocomplete mixin. 

 input class=search t:minChars=3 t:frequency=0.2 t:type=textfield
 t:id=quickTextField t:mixins=autocompletearoer2 id=quickTextField
 name=Best type=text value=quickTextValue /

 This field always gets the focus even though it isn't the first field of
 the
 form. 
 Is there a way to disable this? 
 I tried to circumvent this by having a javascript set the focus on
 another
 field, but without success: the autcomplete field seems to get the focus
 back automatically.

 This is a problem since for instance alt-tabbing forth and back to the
 browser set's off an ajax-call automatically since the focus is on the
 autocomplete field. 

 Any way to prevent this? 

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

-- 
View this message in context: 
http://www.nabble.com/t5%3A-autocomplete-mixin-gets-autofocus-on-field.-I-don%27t-want-that.-tp25255884p25271757.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



t5: autocomplete mixin gets autofocus on field. I don't want that.

2009-09-02 Thread Britske

I have a textfield enriched with the autocomplete mixin. 

input class=search t:minChars=3 t:frequency=0.2 t:type=textfield
t:id=quickTextField t:mixins=autocompletearoer2 id=quickTextField
name=Best type=text value=quickTextValue /

This field always gets the focus even though it isn't the first field of the
form. 
Is there a way to disable this? 
I tried to circumvent this by having a javascript set the focus on another
field, but without success: the autcomplete field seems to get the focus
back automatically.

This is a problem since for instance alt-tabbing forth and back to the
browser set's off an ajax-call automatically since the focus is on the
autocomplete field. 

Any way to prevent this? 

Thanks, 
Geert-Jan
-- 
View this message in context: 
http://www.nabble.com/t5%3A-autocomplete-mixin-gets-autofocus-on-field.-I-don%27t-want-that.-tp25255884p25255884.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



Re: T5: service contribution conflict after updating from 5.0.17 to 5.1.0.5

2009-08-19 Thread Britske

Yeah that was it. 
I had t5c-commons still hanging around. 

Thanks. 


Carl Crowder wrote:
 
 Could it be that you have the older version of Tapestry still on the 
 classpath? Or some other Tapestry module that automatically adds itself?
 
 Britske wrote:
 Also: I should have added that I'm not contributing anything remotely
 related
 to AppModule.java
 
 
 Britske wrote:
 Hi all,

 I'm in the process of updating from 5.0.17 to the latest stable release:
 5.1.0.5
 Most of the process is pretty smooth except the following: 

 on page X I have an actionlink defined which updates a zone. (see
 snippets
 below) . 
 The problem is thaty I'm getting  a 'conflicting contribution error'
 when
 clicking the actionlink thus trying to populate the zone. Everything
 worked fine in  5.0.17. 
 Anyone knows what's wrong? 

 relevant info below.
 thanks, 
 Geert-Jan

 .tml
 --
  zoek bestemming 

 div t:type=zone t:id=locationhelpZone t:visible=false
 id=locationhelpZone class=mff style=display:none;
  # close 
 div class=popcont t-zone-update/
 /div

 relevant snippet of class X:
 
 Object onActionFromLocationhelp(){
 return
 getResources().getComponent().getComponentResources().getEmbeddedComponent
 (locationHelper);
 }


 error: (enormous stacktrace, only showing the root-cause. BTW: I
 couldn't
 find any classes of my own that were referenced in the stacktrace)

 Caused by: java.lang.IllegalArgumentException: Service contribution (to
 service 'AjaxComponentEventResultProcessor') conflicts with existing
 contribution (by
 org.apache.tapestry.commons.TapestryCommonsModule.contributeAjaxComponentEventResultProcessor(MappedConfiguration,
 ObjectLocator, Response) (at TapestryCommonsModule.java:127)).
 at
 org.apache.tapestry5.ioc.internal.ValidatingMappedConfigurationWrapper.add(ValidatingMappedConfigurationWrapper.java:83)
 at
 org.apache.tapestry5.ioc.internal.ValidatingMappedConfigurationWrapper.addInstance(ValidatingMappedConfigurationWrapper.java:115)
 at
 org.apache.tapestry5.services.TapestryModule.contributeAjaxComponentEventResultProcessor(TapestryModule.java:1535)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at
 org.apache.tapestry5.ioc.internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java:110)
 ... 114 more


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

-- 
View this message in context: 
http://www.nabble.com/T5%3A-service-contribution-conflict-after-updating-from-5.0.17--to-5.1.0.5-tp25033459p25038498.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



T5: HibernateEntityValueEncoder nullpointerException after Tapestry update

2009-08-19 Thread Britske

I'm in the process of updating from 5.0.17 to 5.1.0.5 and breaking my head on
this one: 

Getting a NullPointerException in HibernateEntityValueEncoder when trying to
loop a hibernate Entity where the entity has a multi-column id. 

I actually have this with every entity with a multi-column id so please
consider the below as an example of the generalized case. See relevant
snippets as well as trace below. 

After some investigation it SEEMS that: 

- looping of entities (for which HibernateEntityValueEncoder is called)
WORKS for entities with standard IDs
- looping FAILS for entities with an @IdClass specified (i.e: multi-column
id)\
 - querying of all entities works (so it isn't a hibernate issue as far as I
can tell) 

I double checked this by transforming the mapped class to contain a single
id instead of the multi-column id
(I simply concatenated the columns that made up the id in sql and updated
this value to a new column. Afterwards I assigned this new column to be the
id of the table, and updated the hibernate entity accordingly. )

Afterwards the code just works. 

Is there a reason why multi-column entities don't seem to be working in my
case? All dependencies are correct as far as I can tell. Anyone experienced
this? 


relevant code: 

.tml

t:loop source=CityTemperaturesOrEmptyIfNonFound value=CurCityTemp !--
LINE GIVING ERROR --
${CurCityTemp.temp}
/t:loop

Please note that simply calling CityTemperaturesOrEmptyIfNonFound from a
different method just works and returned results. It's just that the
looping-code raises the error because the entity can't be encoded.
(stacktrace at the end) 


relevant part of old entity class:  (FAILS)
---
@Entity
@Table(name = citytemperatures)
@IdClass(CityTemperatureId.class) //CityTemperatureId is default id class
combining two columns
public class CityTemperatureBak
{
@Id
private String cityid; 

@Id
private String dateid;
}

relevant part of new entity class (WORKS) 
---
@Entity
@Table(name = citytemperatures)
public class CityTemperature
{
@Id
private String id; 

private String cityid; 
private String dateid;
}

relevant part of stacktrace: 

Caused by: java.lang.NullPointerException
at
org.apache.tapestry5.internal.hibernate.HibernateEntityValueEncoder.init(HibernateEntityValueEncoder.java:54)
at
org.apache.tapestry5.hibernate.HibernateModule$1.create(HibernateModule.java:100)
at
org.apache.tapestry5.internal.services.ValueEncoderSourceImpl.getValueEncoder(ValueEncoderSourceImpl.java:49)
at
$ValueEncoderSource_1233238c1f1.getValueEncoder($ValueEncoderSource_1233238c1f1.java)
at
org.apache.tapestry5.internal.services.ComponentDefaultProviderImpl.defaultValueEncoder(ComponentDefaultProviderImpl.java:116)
at
$ComponentDefaultProvider_1233238c0cd.defaultValueEncoder($ComponentDefaultProvider_1233238c0cd.java)
at
org.apache.tapestry5.corelib.components.Loop.defaultEncoder(Loop.java:304)
at
org.apache.tapestry5.corelib.components.Loop.containingPageDidLoad(Loop.java)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$4.run(ComponentPageElementImpl.java:98)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:933)
... 61 more


Thanks 
Geert-Jan
-- 
View this message in context: 
http://www.nabble.com/T5%3A-HibernateEntityValueEncoder-nullpointerException-after-Tapestry-update-tp25041718p25041718.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



Re: T5: HibernateEntityValueEncoder nullpointerException after Tapestry update

2009-08-19 Thread Britske

I'm not sure if HibernateEntityValueEncoder called
PersistentClass.getIdentifierProperty() before (in 5.0.x) when my code
worked...

getIdentifierProperty() returns an instance of hibernate.mapping.Property
which may be a Composite ID (which seems to be the official name for
multi-column ids). In other words this method should return the id-property
of my class even though this 'property' isn't defined by a single field in
my case. 

So I think it should return a property, although a  multi-valued one. 
All this indeed strongly suggests that it is a hibernate issue.. 

I will investigate further. 

Thanks.



Ulrich Stärk wrote:
 
 This /seems/ to be a Hibernate issue.
 PersistentClass.getIdentifierProperty() is apparently 
 returning null.
 
 On second thought this seems just natural since there is no property
 representing your Id.
 
 Uli
 
 On 19.08.2009 12:39 schrieb Britske:
 I'm in the process of updating from 5.0.17 to 5.1.0.5 and breaking my
 head on
 this one: 
 
 Getting a NullPointerException in HibernateEntityValueEncoder when trying
 to
 loop a hibernate Entity where the entity has a multi-column id. 
 
 I actually have this with every entity with a multi-column id so please
 consider the below as an example of the generalized case. See relevant
 snippets as well as trace below. 
 
 After some investigation it SEEMS that: 
 
 - looping of entities (for which HibernateEntityValueEncoder is called)
 WORKS for entities with standard IDs
 - looping FAILS for entities with an @IdClass specified (i.e:
 multi-column
 id)\
  - querying of all entities works (so it isn't a hibernate issue as far
 as I
 can tell) 
 
 I double checked this by transforming the mapped class to contain a
 single
 id instead of the multi-column id
 (I simply concatenated the columns that made up the id in sql and updated
 this value to a new column. Afterwards I assigned this new column to be
 the
 id of the table, and updated the hibernate entity accordingly. )
 
 Afterwards the code just works. 
 
 Is there a reason why multi-column entities don't seem to be working in
 my
 case? All dependencies are correct as far as I can tell. Anyone
 experienced
 this? 
 
 
 relevant code: 
 
 .tml
 
 t:loop source=CityTemperaturesOrEmptyIfNonFound value=CurCityTemp
 !--
 LINE GIVING ERROR --
 ${CurCityTemp.temp}
 /t:loop
 
 Please note that simply calling CityTemperaturesOrEmptyIfNonFound from a
 different method just works and returned results. It's just that the
 looping-code raises the error because the entity can't be encoded.
 (stacktrace at the end) 
 
 
 relevant part of old entity class:  (FAILS)
 ---
 @Entity
 @Table(name = citytemperatures)
 @IdClass(CityTemperatureId.class) //CityTemperatureId is default id class
 combining two columns
 public class CityTemperatureBak
 {
  @Id
  private String cityid; 
  
  @Id
  private String dateid;
 }
 
 relevant part of new entity class (WORKS) 
 ---
 @Entity
 @Table(name = citytemperatures)
 public class CityTemperature
 {
  @Id
  private String id; 
  
  private String cityid; 
  private String dateid;
 }
 
 relevant part of stacktrace: 
 
 Caused by: java.lang.NullPointerException
  at
 org.apache.tapestry5.internal.hibernate.HibernateEntityValueEncoder.init(HibernateEntityValueEncoder.java:54)
  at
 org.apache.tapestry5.hibernate.HibernateModule$1.create(HibernateModule.java:100)
  at
 org.apache.tapestry5.internal.services.ValueEncoderSourceImpl.getValueEncoder(ValueEncoderSourceImpl.java:49)
  at
 $ValueEncoderSource_1233238c1f1.getValueEncoder($ValueEncoderSource_1233238c1f1.java)
  at
 org.apache.tapestry5.internal.services.ComponentDefaultProviderImpl.defaultValueEncoder(ComponentDefaultProviderImpl.java:116)
  at
 $ComponentDefaultProvider_1233238c0cd.defaultValueEncoder($ComponentDefaultProvider_1233238c0cd.java)
  at
 org.apache.tapestry5.corelib.components.Loop.defaultEncoder(Loop.java:304)
  at
 org.apache.tapestry5.corelib.components.Loop.containingPageDidLoad(Loop.java)
  at
 org.apache.tapestry5.internal.structure.ComponentPageElementImpl$4.run(ComponentPageElementImpl.java:98)
  at
 org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:933)
  ... 61 more
 
 
 Thanks 
 Geert-Jan
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-HibernateEntityValueEncoder-nullpointerException-after-Tapestry-update-tp25041718p25042186.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail

T5: service contribution conflict after updating from 5.0.17 to 5.1.0.5

2009-08-18 Thread Britske

Hi all,

I'm in the process of updating from 5.0.17 to the latest stable release:
5.1.0.5
Most of the process is pretty smooth except the following: 

on page X I have an actionlink defined which updates a zone. (see snippets
below) . 
The problem is thaty I'm getting  a 'conflicting contribution error' when
clicking the actionlink thus trying to populate the zone. Everything worked
fine in  5.0.17. 
Anyone knows what's wrong? 

relevant info below.
thanks, 
Geert-Jan

.tml
--
zoek bestemming 

div t:type=zone t:id=locationhelpZone t:visible=false
id=locationhelpZone class=mff style=display:none;
 # close 
div class=popcont t-zone-update/
/div

relevant snippet of class X:

Object onActionFromLocationhelp(){
return
getResources().getComponent().getComponentResources().getEmbeddedComponent
(locationHelper);
}


error: (enormous stacktrace, only showing the root-cause. BTW: I couldn't
find any classes of my own that were referenced in the stacktrace)

Caused by: java.lang.IllegalArgumentException: Service contribution (to
service 'AjaxComponentEventResultProcessor') conflicts with existing
contribution (by
org.apache.tapestry.commons.TapestryCommonsModule.contributeAjaxComponentEventResultProcessor(MappedConfiguration,
ObjectLocator, Response) (at TapestryCommonsModule.java:127)).
at
org.apache.tapestry5.ioc.internal.ValidatingMappedConfigurationWrapper.add(ValidatingMappedConfigurationWrapper.java:83)
at
org.apache.tapestry5.ioc.internal.ValidatingMappedConfigurationWrapper.addInstance(ValidatingMappedConfigurationWrapper.java:115)
at
org.apache.tapestry5.services.TapestryModule.contributeAjaxComponentEventResultProcessor(TapestryModule.java:1535)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.tapestry5.ioc.internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java:110)
... 114 more

-- 
View this message in context: 
http://www.nabble.com/T5%3A-service-contribution-conflict-after-updating-from-5.0.17--to-5.1.0.5-tp25033459p25033459.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



Re: T5: service contribution conflict after updating from 5.0.17 to 5.1.0.5

2009-08-18 Thread Britske

Also: I should have added that I'm not contributing anything remotely related
to AppModule.java


Britske wrote:
 
 Hi all,
 
 I'm in the process of updating from 5.0.17 to the latest stable release:
 5.1.0.5
 Most of the process is pretty smooth except the following: 
 
 on page X I have an actionlink defined which updates a zone. (see snippets
 below) . 
 The problem is thaty I'm getting  a 'conflicting contribution error' when
 clicking the actionlink thus trying to populate the zone. Everything
 worked fine in  5.0.17. 
 Anyone knows what's wrong? 
 
 relevant info below.
 thanks, 
 Geert-Jan
 
 .tml
 --
  zoek bestemming 
 
 div t:type=zone t:id=locationhelpZone t:visible=false
 id=locationhelpZone class=mff style=display:none;
# close 
   div class=popcont t-zone-update/
 /div
 
 relevant snippet of class X:
 
 Object onActionFromLocationhelp(){
   return
 getResources().getComponent().getComponentResources().getEmbeddedComponent
 (locationHelper);
   }
 
 
 error: (enormous stacktrace, only showing the root-cause. BTW: I couldn't
 find any classes of my own that were referenced in the stacktrace)
 
 Caused by: java.lang.IllegalArgumentException: Service contribution (to
 service 'AjaxComponentEventResultProcessor') conflicts with existing
 contribution (by
 org.apache.tapestry.commons.TapestryCommonsModule.contributeAjaxComponentEventResultProcessor(MappedConfiguration,
 ObjectLocator, Response) (at TapestryCommonsModule.java:127)).
   at
 org.apache.tapestry5.ioc.internal.ValidatingMappedConfigurationWrapper.add(ValidatingMappedConfigurationWrapper.java:83)
   at
 org.apache.tapestry5.ioc.internal.ValidatingMappedConfigurationWrapper.addInstance(ValidatingMappedConfigurationWrapper.java:115)
   at
 org.apache.tapestry5.services.TapestryModule.contributeAjaxComponentEventResultProcessor(TapestryModule.java:1535)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at
 org.apache.tapestry5.ioc.internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java:110)
   ... 114 more
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-service-contribution-conflict-after-updating-from-5.0.17--to-5.1.0.5-tp25033459p25033525.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



Re: t5: strategy for caching html output of component

2009-05-06 Thread Britske

yeah that's true in general . Good catch.  However, I have a sessionid
strippping filter in place so it doesn't effect me luckily. 



Andreas Andreou-4 wrote:
 
 As a note, one sideeffect i can think of would occur if the first
 user (when cache doesn't yet exist) has cookies disabled (and thus
 url-rewriting
 takes place)...
 
 in that case, the cache would be filled in with urls
 containing his specific JSESSIONID, e.t.c.
 
 On Wed, May 6, 2009 at 2:16 AM, Britske gbr...@gmail.com wrote:

 ok solved (don't know why I didn't see this earlier ;-)
 simply tested in template if cached html existed.
 if false -- render component
 if true -- use OutputRaw to output cached html of component.

 cheers,
 Britske



 Britske wrote:

 currently I'm working on a page with a lot of components.

 part of these components are lists with contents related to the visitor
 viewing the page (i.e: last viewed products, product in wishlist) but
 most
 of these components display lists which are related to context of the
 page
 only (and are thus visitor-independent.)

 Because of:
 a. rather big processing time of these components
 b. pretty static nature of the visitor-independent components (changes
 once a night)
 c. limited nr of possible contexts

 it seems a good idea to wrap all visitor-independent components in a new
 'container component' of which I would like to cache the outputted html.

 Has anybody done something like this before, and if yes how? Are there
 any
 'tapestry-ways' to go about it?
 If not, in the basis I just need to know how to fetch the output of a
 component as html, so I can insert it in memcached using the pagename+
 context as key.

 Thanks for you help,
 Britske


 --
 View this message in context:
 http://www.nabble.com/t5%3A-strategy-for-caching-html-output-of-component-tp23394162p23397603.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


 
 
 
 -- 
 Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr
 Tapestry / Tacos developer
 Open Source / JEE Consulting
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/t5%3A-strategy-for-caching-html-output-of-component-tp23394162p23403917.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



t5: strategy for caching html output of component

2009-05-05 Thread Britske

currently I'm working on a page with a lot of components.

part of these components are lists with contents related to the visitor
viewing the page (i.e: last viewed products, product in wishlist) but most
of these components display lists which are related to context of the page
only (and are thus visitor-independent.) 

Because of: 
a. rather big processing time of these components 
b. pretty static nature of the visitor-independent components (changes once
a night) 
c. limited nr of possible contexts

it seems a good idea to wrap all visitor-independent components in a new
'container component' of which I would like to cache the outputted html. 

Has anybody done something like this before, and if yes how? Are there any
'tapestry-ways' to go about it? 
If not, in the basis I just need to know how to fetch the output of a
component as html, so I can insert it in memcached using the pagename+
context as key.

Thanks for you help, 
Britske
-- 
View this message in context: 
http://www.nabble.com/t5%3A-strategy-for-caching-html-output-of-component-tp23394162p23394162.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



Re: t5: strategy for caching html output of component

2009-05-05 Thread Britske

ok, tried a couple of things, but none of them work: 

1. in the container component keep track of the element that is created by
the container component. 
in the afterRender fetch the html as element.toString() and put to cache. 

in the beginrender method check the cache and if found -- write to
markupWriter using
markwriter.addRaw(htmlFromCache); 

This gives an OOM-error since apparently Markupwriter doens't like having to
construct so many dom elements all at once, 

2. Better solution would be to use TextStreamResponse. However, I would like
to return the html in this streamresponse in the same render methods of the
component. However, I only seem to be able to return a streamresponse from
an event method (such as onActivate, which seems the recommended way to
render using StreamResponse) . Since a Component doesn't have a onActivate
I'm out of luck. 

Ther is some metnion in earlier posts of using a page's onActivate to return
a TextStreamResponse but I don't see how this could help me...

any help is highly appreciated. 
Britske



Britske wrote:
 
 currently I'm working on a page with a lot of components.
 
 part of these components are lists with contents related to the visitor
 viewing the page (i.e: last viewed products, product in wishlist) but most
 of these components display lists which are related to context of the page
 only (and are thus visitor-independent.) 
 
 Because of: 
 a. rather big processing time of these components 
 b. pretty static nature of the visitor-independent components (changes
 once a night) 
 c. limited nr of possible contexts
 
 it seems a good idea to wrap all visitor-independent components in a new
 'container component' of which I would like to cache the outputted html. 
 
 Has anybody done something like this before, and if yes how? Are there any
 'tapestry-ways' to go about it? 
 If not, in the basis I just need to know how to fetch the output of a
 component as html, so I can insert it in memcached using the pagename+
 context as key.
 
 Thanks for you help, 
 Britske
 

-- 
View this message in context: 
http://www.nabble.com/t5%3A-strategy-for-caching-html-output-of-component-tp23394162p23397417.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



Re: t5: strategy for caching html output of component

2009-05-05 Thread Britske

ok solved (don't know why I didn't see this earlier ;-) 
simply tested in template if cached html existed. 
if false -- render component
if true -- use OutputRaw to output cached html of component. 

cheers,
Britske



Britske wrote:
 
 currently I'm working on a page with a lot of components.
 
 part of these components are lists with contents related to the visitor
 viewing the page (i.e: last viewed products, product in wishlist) but most
 of these components display lists which are related to context of the page
 only (and are thus visitor-independent.) 
 
 Because of: 
 a. rather big processing time of these components 
 b. pretty static nature of the visitor-independent components (changes
 once a night) 
 c. limited nr of possible contexts
 
 it seems a good idea to wrap all visitor-independent components in a new
 'container component' of which I would like to cache the outputted html. 
 
 Has anybody done something like this before, and if yes how? Are there any
 'tapestry-ways' to go about it? 
 If not, in the basis I just need to know how to fetch the output of a
 component as html, so I can insert it in memcached using the pagename+
 context as key.
 
 Thanks for you help, 
 Britske
 

-- 
View this message in context: 
http://www.nabble.com/t5%3A-strategy-for-caching-html-output-of-component-tp23394162p23397603.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



T5: how to add tuckey url rewrite filter to Tapestry Context

2009-03-10 Thread Britske

I saw a recent post about setting up Tuckey url-rewrite filter to set up some
url rewriting in conjuction with Tapestry so decided to try it out. 

All works fine when using 'redirects':
rule
   from/test/from
to type=redirect/zoeken/to
/rule


However the real power (in my opinion) comes with forwarding url's so that
the url's in the browser window do not change, like so:
rule
   from/test/from
to/zoeken/to
/rule

localhost:8080/zoeken maps to a page 'zoeken' in Tapestry.

When setting a rewrite rule from redirect to forward (which is the default)
the filter can't find the resource to rewrite to anymore. 

According to the rewrite manual at: http://tuckey.org/urlrewrite/manual/2.6/
this happens when: the to URL is not in the same context as
UrlRewriteFilter.

So I'm guessing that's what causing the problems here. The problem is that I
don't have a clue where to put the UrlRewriteFilter so it is included in the
same context as my tapestry app. 


Currently, UrlRewriteFilter is supplied as a .jar in a /lib folder within
the WEB-INF folder (which is the correct place according to the rewrite
manual) Web.xml correctly locates and initalizes the filter so that part
works fine. 

SO I'm left with the question: were do I put this .jar file so it will be
included in the 'Tapestry' web context?

I'm using Tomcat 5.5 btw since this might be related to that as well. I'm
just not sure. Probably usless info: the context of this tapestry app is
ROOT (which maps to the default in Tomcat) 

Anyone?

Thanks, 
Britske


-- 
View this message in context: 
http://www.nabble.com/T5%3A-how-to-add-tuckey-url-rewrite-filter-to-Tapestry-Context-tp22443644p22443644.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



T5: getting to the url anchor-tag server side

2009-03-05 Thread Britske

Is there a way to get to the anchor of an url in tapestry?

I tried getting it through getRequestGlobals().getHTTPServletRequest(), 
but the anchor seems to be stripped from the url that HTTPServletRequest
gives me. 

Anyone?
Thanks,

Britske
-- 
View this message in context: 
http://www.nabble.com/T5%3A-getting-to-the-url-anchor-tag--server-side-tp22353475p22353475.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



Re: T5: getting to the url anchor-tag server side

2009-03-05 Thread Britske

Hmm, it seems a non -tapestry issue. Browsers don't send anchor-tags to the
server... 


Britske wrote:
 
 Is there a way to get to the anchor of an url in tapestry?
 
 I tried getting it through getRequestGlobals().getHTTPServletRequest(), 
 but the anchor seems to be stripped from the url that HTTPServletRequest
 gives me. 
 
 Anyone?
 Thanks,
 
 Britske
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-getting-to-the-url-anchor-tag--server-side-tp22353475p22353637.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



Re: T5: possible to combine prototype and scriptaculous js-files?

2009-02-27 Thread Britske

+1 for the addition ;-) 

As new users will be extremely important to me, page loads with empty caches
should be fast as well. Besides, some research shows that often more people
thean expected don't come in with a warmed cache.
http://yuiblog.com/blog/2007/01/04/performance-research-part-2/

Anyway, thanks for the great framework, 
Britske 


Howard Lewis Ship wrote:
 
 I have plans to automatically combine and minimize JavaScript, but I
 don't know if it will make it into 5.1.
 
 On the other hand, the use of far-future expires header (and a version
 number in the URL) means that the client will aggresively cache the
 javascript, so there's just a first-page cost.
 
 On Thu, Feb 26, 2009 at 9:22 AM, Britske gbr...@gmail.com wrote:

 is there a way to configure tapestry to use a custom js-file including
 all
 the prototype and scriptaculous files I need? Currently my setup uses 7
 js-files, 6 of which are added by tapestry. From a performance standpoint
 this can be improved.

 Thanks,
 Britske
 --
 View this message in context:
 http://www.nabble.com/T5%3A-possible-to-combine-prototype-and-scriptaculous-js-files--tp9088p9088.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


 
 
 
 -- 
 Howard M. Lewis Ship
 
 Creator Apache Tapestry and Apache HiveMind
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-possible-to-combine-prototype-and-scriptaculous-js-files--tp9088p22241747.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



T5: accessing assets/files using apache httpd instead of tomcat

2009-02-26 Thread Britske

for speed reasons, etc. I would like apache httpd to handle css,js and images
instead of tomcat
Of course apache httpd doesn't know of the resources bundled in the tapestry
webapp.

For those of you who are using tapestry with tomcat and a apache httpd
frontend: 
I'm interested in knowing what kind of (automatic) deployment setup you are
using to get the assets in a folder apache httpd can read. 

Of course this eliminates tapestry being able to manage the assets. WOuld
there be anything I'm missing out what tapestry can do, what can't be done
by apache httpd? Is there any other reasons why I should forget this setup
as soon as possible? 

Thanks, 
Britske
-- 
View this message in context: 
http://www.nabble.com/T5%3A-accessing-assets-files-using-apache-httpd-instead-of-tomcat-tp9014p9014.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



T5: possible to combine prototype and scriptaculous js-files?

2009-02-26 Thread Britske

is there a way to configure tapestry to use a custom js-file including all
the prototype and scriptaculous files I need? Currently my setup uses 7
js-files, 6 of which are added by tapestry. From a performance standpoint
this can be improved. 

Thanks, 
Britske 
-- 
View this message in context: 
http://www.nabble.com/T5%3A-possible-to-combine-prototype-and-scriptaculous-js-files--tp9088p9088.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



T5: how to update zone on dom load

2008-11-27 Thread britske

Hi, 

I've created a zone which get's a couple of updates from various external
websites. The zone initally (on page load) contains some local info, but
needs to be dynamically extends with the sources extracted from these
websites. I want to call a server-side method (onActionFromRefreshZone)
which updates this zone (and starts fetching the info from the external
websites) on the dom-loaded event. 

The zone is in place and I checked that it works with an actionlink: 
# update 

However as said I want to call the method onActionFromRefreshZone  on
dom-loaded. 
I already have the javascript method in place which is called on this
event.However I have no clue how to call the method in a Asynchrnous way. I
tried including the url of the above actionlink as such: 

function functionWhichIsCalledOnDomLoaded(){
new Ajax.Request('/thepage.refreshzone?t:zone=zone1;t:ac=/id-1-66590/', 
{
method:'get' });
}

but this doens't work. 
Somehow I'm thinking this isn't the correct way anyhow and that there should
be a more elegant way / more T5-way to call a server-side method
asynchronously. 

Thanks, 
Geert-Jan
-- 
View this message in context: 
http://n2.nabble.com/T5%3A-how-to-update-zone-on-dom-load-tp1584917p1584917.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


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



T5: actionlink calls onActivate twice: detecting first time

2008-09-30 Thread Britske

as part of onActivate I do some processing: 
- user validation
- parsing of params
- DAO / repository calls etc.

I want to avoid as much of this work as possible obviously. 
When this counts a lot is when actions are used. In that case the flow is
like: 

click -- onActivate -- onAction -- onActivate. (please comment if this is
not as it should be)
ultimately leading to calling the above code twice, while the first-time
(the activate before the onAction) this particular code doesn't need to be
executed (except the validation). 

This caused me to think that perhaps using the onActivate method isn't the
best place to load entities which are used for rendering (and not for page
navigation). 
However, methods like beginRender and setupRender are called twice as well.
Isn't this strange?? I thought setupRender, beginRender as well as any
method called through the page-template would be called in the Render-action
only. (So in this case only after the second onActivate occurs) correct?

So basically what I'm asking is:
- is the observerd behavior correct? or does this sound strange?
- where would be the best plave of isolating information neded to run in the
render-action only? And how would I make sure that indeed it is only run in
the Render-action?

Thanks in advance,
Britske
-- 
View this message in context: 
http://www.nabble.com/T5%3A-actionlink-calls-onActivate-twice%3A-detecting-first-time-tp19745430p19745430.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: what part of tapestry adds Jsessionid

2008-07-11 Thread Britske

Yep I tried that, but when I converted a working stripping servletfilter to a
requestfiler, I have to deal with tapestry's request and response in
addition to sevlet.HttpServletRequest and servlet.httpServletRepsonse. 

Although I override both (Response and HttpServletResponse, since I guess
some code uses Response while some use HttpServletResponse) still no luck. 

My code (almost an exact copy of the servlet filter I had ealier, but with
overwriting the Tapestry-reponse as well) is: 

public boolean service(Request request, Response response, RequestHandler
handler) 
throws IOException {
if (request.isRequestedSessionIdValid() 
_globals.getHTTPServletRequest().getCookies()==null)
{
Session session = request.getSession(false);
if (session != null) session.invalidate();


// wrap response to remove URL encoding
HttpServletResponse httpResponse = 
_globals.getHTTPServletResponse();
HttpServletResponseWrapper wrappedResponse = new
HttpServletResponseWrapper(httpResponse)
{
@Override
public String encodeRedirectUrl(String url) { 
return url; }

@Override
public String encodeRedirectURL(String url) { 
return url; }

@Override
public String encodeUrl(String url) { return 
url; }

@Override
public String encodeURL(String url) { return 
url; }
};

response = new ResponseImpl(wrappedResponse);

_globals.storeServletRequestResponse(_globals.getHTTPServletRequest(),
wrappedResponse);
_globals.storeRequestResponse(request, response);
}
return handler.service(request, response);
}

But still JSessionId in the results. (although actionlinks take a cycle more
to pick up the JSessionID than without the filter) 

Anyone? 




Robert Zeigler wrote:
 
 Just turn your ServletFilter into a RequestFilter.
 You can use ApplicationStateManager in RequestFilters now.
 (See, for example:
 http://code.google.com/p/tapestry5-cayenne/source/browse/trunk/tapestry5-cayenne-server/src/main/java/com/googlecode/tapestry5cayenne/services/CayenneRequestFilter.java)
 
 Robert
 
 On Jul 10, 2008, at 7/1012:30 PM , Britske wrote:
 

 yeah I realize that JSessionId is there for the session, but I want  
 to build
 functionality into a dispatcher that strips this jsessionid from the  
 request
 if a user is not logged in (logged in in my app means that a User- 
 instance
 exists in the ASM) and if the user has cookies disabled.

 The rationale is
 that I don't want search-engines to see the JSessionid, but I want  
 to enable
 users without cookies to login and track their settings using  
 JSessionID in
 the url.
 Since search-engines don't login these 2 groups are nice mutually  
 exclusive
 and so it's a clean cut when to strip the JSessionid and when not.

 Except that I'm still not sure how to do it.
 Wrapping the request and response in a handler (before Tapestry  
 comes in
 action) and stripping it like that works, but doing it almost  
 exactly the
 same in a dispather doesn't .

 That's why I think it has to do with some internal tapestry  
 processing.
 Do you have an idea where to look?


 Howard Lewis Ship wrote:

 All the jsessionid functionality is provided by the servlet  
 container,
 not by Tapestry.  And it does exactly what you are suggesting ...
 except that its not about the user being logged in, its about the  
 user
 have a session.

 On Thu, Jul 10, 2008 at 8:52 AM, Britske [EMAIL PROTECTED] wrote:

 partially related to a post I send a couple of days ago, but  
 perhaps this
 explains better what I'm trying to do.

 I'm trying to strip the jSessionId from displaying in the url if:
 1. user doesn't have cookies (otherwise it won't display anyway)
 2. user is not logged in.

 I wanted to implement this as a filter, but I have to go with a  
 dispather
 since to see if a user is logged in I need to have access to the  
 ASM,
 which
 I can't get to in a filter.


 Now somewhere in between all the HttpSevletRequest to  
 tapestry.request
 comversion, etc. tapestry decides to take over the JSessionId  
 provided by
 the HttpServletRequest. I want to intercept this call somehow and  
 strip
 the
 JSessionId from the request.

 I implemented a Dispatcher (the last in the line before onActivate  
 is
 called) and basically wrapped (subclassed) HttpServletRequest and
 HttpServletResponse to return null for the sessionid and have  
 redirecturl
 return url. My own HttpServlet get's called in the app (and  
 returns null
 for
 getrequestedSessionId

T5: possible to get the 'real' object instead of a proxy?

2008-07-11 Thread Britske

When injecting a (hibernate) Session a proxy to the actual session is
returned. 

However, when using the session in a lot of my dao-services I need to have
access to the 'real' underlying session instead of just the proxy. 

Is there a way to do this? 


Some background: 
 after revisioning my dao/repository layer a bit I want to rely on
hibernate's DetachedCriteria for a lot of queries. THis basically enables
you to build hibernate criteria's without having a session handy. (very
useful in the light of MVC, etc. ) However, when actually executing these
detachedcriteria through detachedcrit.getExecutableCriteria(Session session)
a 'real' session has to be supplied since the method makes uses the
underlying implementation instead of just the session-interface. (bad
design, I know)

Anyone?
-- 
View this message in context: 
http://www.nabble.com/T5%3A-possible-to-get-the-%27real%27-object-instead-of-a-proxy--tp18400135p18400135.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: possible to get the 'real' object instead of a proxy?

2008-07-11 Thread Britske

and this would also give me a session bound to the current thread? Like, I
would inject in into a custom singleton service, and invoke the
getSession-method from different threads. 

Would I still get the session bound to the current-thread or the session
bound to the thread which first invoked getSession? 




Howard Lewis Ship wrote:
 
 The injectable Session object is a property shadow of
 HibernateSessionManager.session.
 
 In other words, inject HibernateSessionManager, invoke getSession().
 
 On Fri, Jul 11, 2008 at 4:57 AM, Filip S. Adamsen [EMAIL PROTECTED] wrote:
 Hi,

 The problem here is that the proxy generated by Tapestry doesn't
 implement
 SessionImplementor. You'll have to get the SessionFactory and grab a
 Session
 from there if you want to do this.

 I don't use tapestry-hibernate so that's all I can say about that.

 By the way, the Session/SessionImplementor interfaces and the way they're
 used isn't bad design - it's exactly what interfaces are for. :)

 -Filip

 Britske skrev:

 When injecting a (hibernate) Session a proxy to the actual session is
 returned.
 However, when using the session in a lot of my dao-services I need to
 have
 access to the 'real' underlying session instead of just the proxy.
 Is there a way to do this?

 Some background:  after revisioning my dao/repository layer a bit I want
 to rely on
 hibernate's DetachedCriteria for a lot of queries. THis basically
 enables
 you to build hibernate criteria's without having a session handy. (very
 useful in the light of MVC, etc. ) However, when actually executing
 these
 detachedcriteria through detachedcrit.getExecutableCriteria(Session
 session)
 a 'real' session has to be supplied since the method makes uses the
 underlying implementation instead of just the session-interface. (bad
 design, I know)

 Anyone?

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


 
 
 
 -- 
 Howard M. Lewis Ship
 
 Creator Apache Tapestry and Apache HiveMind
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-possible-to-get-the-%27real%27-object-instead-of-a-proxy--tp18400135p18409476.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: possible to get the 'real' object instead of a proxy?

2008-07-11 Thread Britske

I meant that the hibernate-implementation is bad design here. 
Having a method: 
getExecutableCriteria(Session session) to me would mean that any object
adhering to the interface Session could be passed as a parameter. However
getExecutableCriteria really needs a SessionImpl to be passed so that should
have been the type of the param. 



Filip S. Adamsen-2 wrote:
 
 Hi,
 
 The problem here is that the proxy generated by Tapestry doesn't 
 implement SessionImplementor. You'll have to get the SessionFactory and 
 grab a Session from there if you want to do this.
 
 I don't use tapestry-hibernate so that's all I can say about that.
 
 By the way, the Session/SessionImplementor interfaces and the way 
 they're used isn't bad design - it's exactly what interfaces are for. :)
 
 -Filip
 
 Britske skrev:
 When injecting a (hibernate) Session a proxy to the actual session is
 returned. 
 
 However, when using the session in a lot of my dao-services I need to
 have
 access to the 'real' underlying session instead of just the proxy. 
 
 Is there a way to do this? 
 
 
 Some background: 
  after revisioning my dao/repository layer a bit I want to rely on
 hibernate's DetachedCriteria for a lot of queries. THis basically enables
 you to build hibernate criteria's without having a session handy. (very
 useful in the light of MVC, etc. ) However, when actually executing these
 detachedcriteria through detachedcrit.getExecutableCriteria(Session
 session)
 a 'real' session has to be supplied since the method makes uses the
 underlying implementation instead of just the session-interface. (bad
 design, I know)
 
 Anyone?
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-possible-to-get-the-%27real%27-object-instead-of-a-proxy--tp18400135p18409536.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: possible to get the 'real' object instead of a proxy?

2008-07-11 Thread Britske

Would there be a way to both get
1. the real session object
2.  the session object belonging to to current thread 

at the same time? 



Howard Lewis Ship wrote:
 
 No, this is the actual Hibernate Session object; you'll have to be
 careful if you share it around between threads, or hold onto it after
 the end of the current request.
 
 On Fri, Jul 11, 2008 at 11:04 AM, Britske [EMAIL PROTECTED] wrote:

 and this would also give me a session bound to the current thread? Like,
 I
 would inject in into a custom singleton service, and invoke the
 getSession-method from different threads.

 Would I still get the session bound to the current-thread or the session
 bound to the thread which first invoked getSession?




 Howard Lewis Ship wrote:

 The injectable Session object is a property shadow of
 HibernateSessionManager.session.

 In other words, inject HibernateSessionManager, invoke getSession().

 On Fri, Jul 11, 2008 at 4:57 AM, Filip S. Adamsen [EMAIL PROTECTED]
 wrote:
 Hi,

 The problem here is that the proxy generated by Tapestry doesn't
 implement
 SessionImplementor. You'll have to get the SessionFactory and grab a
 Session
 from there if you want to do this.

 I don't use tapestry-hibernate so that's all I can say about that.

 By the way, the Session/SessionImplementor interfaces and the way
 they're
 used isn't bad design - it's exactly what interfaces are for. :)

 -Filip

 Britske skrev:

 When injecting a (hibernate) Session a proxy to the actual session is
 returned.
 However, when using the session in a lot of my dao-services I need to
 have
 access to the 'real' underlying session instead of just the proxy.
 Is there a way to do this?

 Some background:  after revisioning my dao/repository layer a bit I
 want
 to rely on
 hibernate's DetachedCriteria for a lot of queries. THis basically
 enables
 you to build hibernate criteria's without having a session handy.
 (very
 useful in the light of MVC, etc. ) However, when actually executing
 these
 detachedcriteria through detachedcrit.getExecutableCriteria(Session
 session)
 a 'real' session has to be supplied since the method makes uses the
 underlying implementation instead of just the session-interface. (bad
 design, I know)

 Anyone?

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





 --
 Howard M. Lewis Ship

 Creator Apache Tapestry and Apache HiveMind

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




 --
 View this message in context:
 http://www.nabble.com/T5%3A-possible-to-get-the-%27real%27-object-instead-of-a-proxy--tp18400135p18409476.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]


 
 
 
 -- 
 Howard M. Lewis Ship
 
 Creator Apache Tapestry and Apache HiveMind
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-possible-to-get-the-%27real%27-object-instead-of-a-proxy--tp18400135p18413975.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]



T5: what part of tapestry adds Jsessionid

2008-07-10 Thread Britske

partially related to a post I send a couple of days ago, but perhaps this
explains better what I'm trying to do. 

I'm trying to strip the jSessionId from displaying in the url if: 
1. user doesn't have cookies (otherwise it won't display anyway)
2. user is not logged in. 

I wanted to implement this as a filter, but I have to go with a dispather
since to see if a user is logged in I need to have access to the ASM, which
I can't get to in a filter. 


Now somewhere in between all the HttpSevletRequest to tapestry.request
comversion, etc. tapestry decides to take over the JSessionId provided by
the HttpServletRequest. I want to intercept this call somehow and strip the
JSessionId from the request. 

I implemented a Dispatcher (the last in the line before onActivate is
called) and basically wrapped (subclassed) HttpServletRequest and
HttpServletResponse to return null for the sessionid and have redirecturl
return url. My own HttpServlet get's called in the app (and returns null for
getrequestedSessionId()) This request is added as a constructor param to a
newly created tapestry.requestImpl which are both saved to RequestGlobals. I
though that should do the trick

not...
Apperantly somehow the jsessionid is picked up anyway although (when
expecting requestglobals.getHttpServletRequest.getRequstedSessionId() in
page.onactivate() this correctly returns null). 

Anyone? 
Thanks.

my code: 
//SessionStripController 
public final class SessionStripController implements Dispatcher {
private ApplicationStateManager asm;
private RequestGlobals globals;

public SessionStripController(ApplicationStateManager asm,RequestGlobals
globals){
this.asm = asm;
this.globals = globals;
}

public boolean dispatch(Request req, Response response) throws 
IOException
{
if (req.isRequestedSessionIdValid() 
globals.getHTTPServletRequest().getCookies()==null)
{
Session session = req.getSession(false);
if (session != null) session.invalidate();

HttpServletRequestWrapper wrappednRequest = new
HttpServletRequestWrapperOwn(globals.getHTTPServletRequest());

HttpServletResponseWrapper wrappedResponse  = new
HttpServletResponseWrapper(globals.getHTTPServletResponse())
{
public String encodeRedirectUrl(String url) { 
return url; }
public String encodeRedirectURL(String url) { 
return url; }
public String encodeUrl(String url) { return 
url; }
public String encodeURL(String url) { return 
url; }
};
globals.storeServletRequestResponse(wrappednRequest, 
wrappedResponse);
globals.storeRequestResponse(new 
RequestImpl(wrappednRequest), new
ResponseImpl(wrappedResponse));
}
return false;
}
}


//HttpServletRequestWrapperOwn 
public class HttpServletRequestWrapperOwn extends HttpServletRequestWrapper
{

public HttpServletRequestWrapperOwn(HttpServletRequest request) {
super(request);
}

public String getRequestedSessionId(){
return null;
}

}



-- 
View this message in context: 
http://www.nabble.com/T5%3A-what-part-of-tapestry-adds-Jsessionid-tp18385573p18385573.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: what part of tapestry adds Jsessionid

2008-07-10 Thread Britske

yeah I realize that JSessionId is there for the session, but I want to build
functionality into a dispatcher that strips this jsessionid from the request
if a user is not logged in (logged in in my app means that a User-instance
exists in the ASM) and if the user has cookies disabled. 

The rationale is 
that I don't want search-engines to see the JSessionid, but I want to enable
users without cookies to login and track their settings using JSessionID in
the url. 
Since search-engines don't login these 2 groups are nice mutually exclusive
and so it's a clean cut when to strip the JSessionid and when not. 

Except that I'm still not sure how to do it. 
Wrapping the request and response in a handler (before Tapestry comes in
action) and stripping it like that works, but doing it almost exactly the
same in a dispather doesn't . 

That's why I think it has to do with some internal tapestry processing.
Do you have an idea where to look? 


Howard Lewis Ship wrote:
 
 All the jsessionid functionality is provided by the servlet container,
 not by Tapestry.  And it does exactly what you are suggesting ...
 except that its not about the user being logged in, its about the user
 have a session.
 
 On Thu, Jul 10, 2008 at 8:52 AM, Britske [EMAIL PROTECTED] wrote:

 partially related to a post I send a couple of days ago, but perhaps this
 explains better what I'm trying to do.

 I'm trying to strip the jSessionId from displaying in the url if:
 1. user doesn't have cookies (otherwise it won't display anyway)
 2. user is not logged in.

 I wanted to implement this as a filter, but I have to go with a dispather
 since to see if a user is logged in I need to have access to the ASM,
 which
 I can't get to in a filter.


 Now somewhere in between all the HttpSevletRequest to tapestry.request
 comversion, etc. tapestry decides to take over the JSessionId provided by
 the HttpServletRequest. I want to intercept this call somehow and strip
 the
 JSessionId from the request.

 I implemented a Dispatcher (the last in the line before onActivate is
 called) and basically wrapped (subclassed) HttpServletRequest and
 HttpServletResponse to return null for the sessionid and have redirecturl
 return url. My own HttpServlet get's called in the app (and returns null
 for
 getrequestedSessionId()) This request is added as a constructor param to
 a
 newly created tapestry.requestImpl which are both saved to
 RequestGlobals. I
 though that should do the trick

 not...
 Apperantly somehow the jsessionid is picked up anyway although (when
 expecting requestglobals.getHttpServletRequest.getRequstedSessionId() in
 page.onactivate() this correctly returns null).

 Anyone?
 Thanks.

 my code:
 //SessionStripController
 public final class SessionStripController implements Dispatcher {
private ApplicationStateManager asm;
private RequestGlobals globals;

public SessionStripController(ApplicationStateManager
 asm,RequestGlobals
 globals){
this.asm = asm;
this.globals = globals;
}

public boolean dispatch(Request req, Response response) throws
 IOException
 {
if (req.isRequestedSessionIdValid() 
 globals.getHTTPServletRequest().getCookies()==null)
{
Session session = req.getSession(false);
if (session != null) session.invalidate();

HttpServletRequestWrapper wrappednRequest = new
 HttpServletRequestWrapperOwn(globals.getHTTPServletRequest());

HttpServletResponseWrapper wrappedResponse  =
 new
 HttpServletResponseWrapper(globals.getHTTPServletResponse())
{
public String encodeRedirectUrl(String
 url) { return url; }
public String encodeRedirectURL(String
 url) { return url; }
public String encodeUrl(String url) {
 return url; }
public String encodeURL(String url) {
 return url; }
};
   
 globals.storeServletRequestResponse(wrappednRequest, wrappedResponse);
globals.storeRequestResponse(new
 RequestImpl(wrappednRequest), new
 ResponseImpl(wrappedResponse));
}
return false;
}
 }


 //HttpServletRequestWrapperOwn
 public class HttpServletRequestWrapperOwn extends
 HttpServletRequestWrapper
 {

public HttpServletRequestWrapperOwn(HttpServletRequest request) {
super(request);
}

public String getRequestedSessionId(){
return null;
}

 }



 --
 View this message in context:
 http://www.nabble.com/T5%3A-what-part-of-tapestry-adds-Jsessionid-tp18385573p18385573.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL

Re: T5: what part of tapestry adds Jsessionid

2008-07-10 Thread Britske

Tha's an interesting route, ill have a look at it, Thanks. 


joshcanfield wrote:
 
 I had a similar issue with my site and instead took the route of not
 creating the session for users that don't need it.
 
 I had to override the tapestry Form component so it only stored the
 validation tracker when there were errors and implement a session
 persistence that didn't create a session if the value stored was null. I
 believe the last part has been fixed in the standard session
 persistence. I'm in 5.0.11.
 
 here's my extended Form if you're interested.
 
 public class Form extends org.apache.tapestry.corelib.components.Form {
 @Persist
 private ValidationTracker _tracker;
 
 private ValidationTracker _nonPersistedTracker;
 
 public ValidationTracker getDefaultTracker() {
 if (_nonPersistedTracker == null) {
 if (_tracker != null) {
 // _tracker is loaded via injection magic when it's in the
 session
 _nonPersistedTracker = _tracker;
 } else {
 _nonPersistedTracker = new ValidationTrackerImpl();
 }
 }
 return _nonPersistedTracker;
 }
 
 public void setDefaultTracker(ValidationTracker defaultTracker) {
 _nonPersistedTracker = defaultTracker;
 }
 
 protected void onAction() {
 if (_nonPersistedTracker.getHasErrors()) {
 _tracker = _nonPersistedTracker;
 } else {
 _tracker = null;
 }
 }
 }
 
 Josh
 
 On Thu, Jul 10, 2008 at 10:30 AM, Britske [EMAIL PROTECTED] wrote:
 

 yeah I realize that JSessionId is there for the session, but I want to
 build
 functionality into a dispatcher that strips this jsessionid from the
 request
 if a user is not logged in (logged in in my app means that a
 User-instance
 exists in the ASM) and if the user has cookies disabled.

 The rationale is
 that I don't want search-engines to see the JSessionid, but I want to
 enable
 users without cookies to login and track their settings using JSessionID
 in
 the url.
 Since search-engines don't login these 2 groups are nice mutually
 exclusive
 and so it's a clean cut when to strip the JSessionid and when not.

 Except that I'm still not sure how to do it.
 Wrapping the request and response in a handler (before Tapestry comes in
 action) and stripping it like that works, but doing it almost exactly the
 same in a dispather doesn't .

 That's why I think it has to do with some internal tapestry processing.
 Do you have an idea where to look?


 Howard Lewis Ship wrote:
 
  All the jsessionid functionality is provided by the servlet container,
  not by Tapestry.  And it does exactly what you are suggesting ...
  except that its not about the user being logged in, its about the user
  have a session.
 
  On Thu, Jul 10, 2008 at 8:52 AM, Britske [EMAIL PROTECTED] wrote:
 
  partially related to a post I send a couple of days ago, but perhaps
 this
  explains better what I'm trying to do.
 
  I'm trying to strip the jSessionId from displaying in the url if:
  1. user doesn't have cookies (otherwise it won't display anyway)
  2. user is not logged in.
 
  I wanted to implement this as a filter, but I have to go with a
 dispather
  since to see if a user is logged in I need to have access to the ASM,
  which
  I can't get to in a filter.
 
 
  Now somewhere in between all the HttpSevletRequest to tapestry.request
  comversion, etc. tapestry decides to take over the JSessionId provided
 by
  the HttpServletRequest. I want to intercept this call somehow and
 strip
  the
  JSessionId from the request.
 
  I implemented a Dispatcher (the last in the line before onActivate is
  called) and basically wrapped (subclassed) HttpServletRequest and
  HttpServletResponse to return null for the sessionid and have
 redirecturl
  return url. My own HttpServlet get's called in the app (and returns
 null
  for
  getrequestedSessionId()) This request is added as a constructor param
 to
  a
  newly created tapestry.requestImpl which are both saved to
  RequestGlobals. I
  though that should do the trick
 
  not...
  Apperantly somehow the jsessionid is picked up anyway although (when
  expecting requestglobals.getHttpServletRequest.getRequstedSessionId()
 in
  page.onactivate() this correctly returns null).
 
  Anyone?
  Thanks.
 
  my code:
  //SessionStripController
  public final class SessionStripController implements Dispatcher {
 private ApplicationStateManager asm;
 private RequestGlobals globals;
 
 public SessionStripController(ApplicationStateManager
  asm,RequestGlobals
  globals){
 this.asm = asm;
 this.globals = globals;
 }
 
 public boolean dispatch(Request req, Response response) throws
  IOException
  {
 if (req.isRequestedSessionIdValid() 
  globals.getHTTPServletRequest().getCookies()==null)
 {
 Session session

T5: getting current hibernate session (per-thread) from singleton-service

2008-07-09 Thread Britske

I found some partial references on the list, but nothing that really answered
the question, so: 
How can I get the current (per-thread) hibernate-session (as configured
through tapestry-hibernate) from a singleton custom tapestry service?

For reference:
I have a MySingleton-class build as a tapestry service.
MySingleton.getSingleton().getCurrentSession() should give me the current
session (thread-bound) as managed by tapestry-hibernate. 
This would enable me to access the current session from any class (not just
components or tapestry services)


I tried 3 methods, 2 of which don't work, and 1 I'm not certain 

Method 1: 
build the MySingleton-class and inject Session at constructortime. 

Problem:  the hibernate session that is created on constructor-time stays
assoaciated with MySingleton  (correct?). So this doesn't give a
session-per-thread.


Method 2:
build the MySingleton-class and inject HibernateSessionSource 
getCurrentSession(){
   return hibernateSessionSource.getSessionFactory().getCurrentSession();
}

Problem: 

but this gives error: 
org.hibernate.HibernateException: No CurrentSessionContext configured!
I think this happens because the way the session is accessed bypasses the
tapestry-hibernate session-in-view filter (HibernateSessionManager) which
takes care of providing the context. 

Is there any way to make getSessionFactory() aware of the
HibernateSessionManager? So the above works?


Method 3: 
build the MySingleton-class and inject ProperyShadowBuilder  and
HibernateSessionManager 

I figured this calling hibernateSessionManager.getSession() would give me
the needed context (which lacked from method 2) . The problem is that
HibernateSessionManager is not a singleton either. 
I thought this could be bypassed by doing :

getCurrentSession(){
return shadowBuilder.build(hibernateSessionManager, session,
Session.class); 
}

However this still doens't ensure (I think) that hibernateSessionManager
belongs to the current thread. 


Can anyone shed some light on this? I would highly appreciate it!
Cheers, 
britske


-- 
View this message in context: 
http://www.nabble.com/T5%3A-getting-current-hibernate-session-%28per-thread%29-from-singleton-service-tp18365296p18365296.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: getting current hibernate session (per-thread) from singleton-service

2008-07-09 Thread Britske

Wow I love that. Somehow I mistakenly thought it didn't work that way,
thanks. 
 
As a related question :
is there a way to get the 'real' session instead of the proxy on a call to 
getSession()

The reason I'm asking is that in a lot of cases I want to use (Hibernate's)
DetachedCriteria's, so I can make a criteria, pass that as a parameter to a
repository and let the repository get the current session and create a real
criteria. (For reasons of seperation)

This is done through detachedCriteria.getExecutableCriteria(getSession());

However this always gives a classCastException, like: 
java.lang.ClassCastException: $Session_11b08fbaf1e cannot be cast to
org.hibernate.engine.SessionImplementor.

for a related post (similar problem) see:
http://www.nabble.com/Hivemind-creates-proxy-Hibernate-Session-td9845916.html

Therefore I need the 'real' object. 
diong getSession().getSessionFactory().getCurrentSession() would solve my
problem, since that would be both the session of the current thread and the
real object, but (as described in method 2 of my post) the context assigned
to be tapestry-hibernate isn't there when accessing the session in this way.

Any suggestions on how to solve this as well? Much apreciated!






Howard Lewis Ship wrote:
 
 If you are using tapestry-hibernate, the injectable Session service is
 a perthread proxy.  It can be shared across threads, but each method
 invocation on the proxy is redirected to a real per-thread Hibernate
 session.
 
 On Wed, Jul 9, 2008 at 9:27 AM, Britske [EMAIL PROTECTED] wrote:

 I found some partial references on the list, but nothing that really
 answered
 the question, so:
 How can I get the current (per-thread) hibernate-session (as configured
 through tapestry-hibernate) from a singleton custom tapestry service?

 For reference:
 I have a MySingleton-class build as a tapestry service.
 MySingleton.getSingleton().getCurrentSession() should give me the current
 session (thread-bound) as managed by tapestry-hibernate.
 This would enable me to access the current session from any class (not
 just
 components or tapestry services)


 I tried 3 methods, 2 of which don't work, and 1 I'm not certain

 Method 1:
 build the MySingleton-class and inject Session at constructortime.

 Problem:  the hibernate session that is created on constructor-time stays
 assoaciated with MySingleton  (correct?). So this doesn't give a
 session-per-thread.


 Method 2:
 build the MySingleton-class and inject HibernateSessionSource
 getCurrentSession(){
   return hibernateSessionSource.getSessionFactory().getCurrentSession();
 }

 Problem:

 but this gives error:
 org.hibernate.HibernateException: No CurrentSessionContext configured!
 I think this happens because the way the session is accessed bypasses the
 tapestry-hibernate session-in-view filter (HibernateSessionManager) which
 takes care of providing the context.

 Is there any way to make getSessionFactory() aware of the
 HibernateSessionManager? So the above works?


 Method 3:
 build the MySingleton-class and inject ProperyShadowBuilder  and
 HibernateSessionManager

 I figured this calling hibernateSessionManager.getSession() would give me
 the needed context (which lacked from method 2) . The problem is that
 HibernateSessionManager is not a singleton either.
 I thought this could be bypassed by doing :

 getCurrentSession(){
 return shadowBuilder.build(hibernateSessionManager, session,
 Session.class);
 }

 However this still doens't ensure (I think) that hibernateSessionManager
 belongs to the current thread.


 Can anyone shed some light on this? I would highly appreciate it!
 Cheers,
 britske


 --
 View this message in context:
 http://www.nabble.com/T5%3A-getting-current-hibernate-session-%28per-thread%29-from-singleton-service-tp18365296p18365296.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]


 
 
 
 -- 
 Howard M. Lewis Ship
 
 Creator Apache Tapestry and Apache HiveMind
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-getting-current-hibernate-session-%28per-thread%29-from-singleton-service-tp18365296p18367496.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: stripping jsessionid in custom dispatcher depending on ASM.

2008-07-08 Thread Britske

perhaps I should have mentioned that the code for checking if the
user-instance exists or not isn't here yet, but it isn't really relevant for
the problem.  Thanks. 


Britske wrote:
 
 I want to strip JsessionId from the url (for browsers who dont support
 cookies) for SEO purposes.
 btw: perhaps a bit long-winded as to the why's, but it may help others. 
 
 At first I implemented a servletfilter (from
 http://randomcoder.com/articles/jsessionid-considered-harmful)
 which basically consists of passing a subclassed httpServletResponse where
 i've overwritten the encodeUrl() method to not to include the jsessionid.
 This works well. 
 
 However I do not want to strip the jsesisonid when the user has logged in.
 The rationale here is that I really do need a session when a user is
 logged in, and since a searchengine doesn't login (at least I don't
 program for it) It can't harm to make this exception. 
 
 The application recognizes that a user is logged in if a User-instance is
 present in the ASM (ApplicationStateManager). 
 This means I have to let the notion of a requesthandler go, and go instead
 with a tapestry dispatcher, since a servlet requesthandler has no way f
 getting the ASM of the current user. (Is this correct?) 
 
 Not much changed to the dispather (in relationship to the code in the
 requestfilter before). The Dispatcher is also correctly registered in
 AppModule etc. 
 
 The problem is that although I see that jsessionid is stripped in the
 custom encodeUrl-method, if appears afterwards in request (as noticed in
 the address-bar).  So my question is: What code inserts the
 jsessionid-again, after the Response.encodeUrl()-method, and how can I
 change it's behavior?
 
 the relevant code:
 
 //Appmodule
 public static void bind(ServiceBinder binder)
 {
   binder.bind(AccessController.class).withId(AccessController);
   binder.bind(AutoLoginController.class).withId(AutoLoginController);
 
 binder.bind(SessionStripController.class).withId(SessionStripController);
 }
 
 public void contributeMasterDispatcher(OrderedConfigurationDispatcher
 configuration,
   @InjectService(AccessController) Dispatcher 
 accessController,
   @InjectService(AutoLoginController) Dispatcher 
 autoLoginController,
   @InjectService(SessionStripController) Dispatcher
 sessionStripController) {
   configuration.add(AccessController, accessController,
 before:PageRender);
   configuration.add(AutoLoginController, autoLoginController,
 before:AccessController);
   configuration.add(SessionStripController,
 sessionStripController,before:AutoLoginController);
   }
 
 //sessionstripcontroller
 public final class SessionStripController implements Dispatcher {
 
   
   private ApplicationStateManager asm;
   private RequestGlobals globals;
 
   public SessionStripController(ApplicationStateManager asm,RequestGlobals
 globals){
   this.asm = asm;
   this.globals = globals;
   }
   
   public boolean dispatch(Request req, Response response) throws
 IOException {
   // clear session if session id in URL
   if (req.isRequestedSessionIdValid() 
 globals.getHTTPServletRequest().getCookies()==null)
   {
   Session session = req.getSession(false);
   if (session != null) session.invalidate();
   ServletResponseWrapper wrapResp = new 
 ServletResponseWrapper(globals.getHTTPServletResponse());
   globals.storeRequestResponse(req, wrapResp);
   }
   return false;
   }
 }
 
 //ServletResponseWrapper
 public class ServletResponseWrapper extends ResponseImpl{
   public ServletResponseWrapper(HttpServletResponse response) {
   super(response);
   // TODO Auto-generated constructor stub
   }
 
   @Override
   public String encodeRedirectURL(String url) {
   url = super.encodeRedirectURL(url);
   return url; 
   }
   
   @Override
   public String encodeURL(String url) {
   url = super.encodeURL(url);
   url = url.substring(0,url.indexOf(;));
   return url; 
   }
 }
 
 btw: encodeRedirectURL and encodeURL can just return url straightaway,
 but the above code enabled me to see that indeed this code stripped the
 added jsessionid that super.encode*Url() added. So where is the other
 method that's adding jsessionid? 
 
 Cheers, 
 Britske
 
 

-- 
View this message in context: 
http://www.nabble.com/stripping-jsessionid-in-custom-dispatcher-depending-on-ASM.-tp18351016p18351055.html
Sent from the Tapestry - User mailing list archive at Nabble.com

t5: rollback when profile update is cancelled with beaneditform

2008-07-07 Thread Britske

hi,

I was quickly testing creating and updating userprofiles using beaneditform.
To me, the most logical thing to do was combine Create and Update in one
page: 

if a User-instance exists in the applicationstate -- user is displayed
using beaneditform and fields can be edited, 
if no user-instance exists in the applicaitonstate or no applicaiton state
exists -- create new user-instance

all works fine, except that I want a cancel button to exist, which rollbacks
all actions performed on the bound user-instance. So, if the user instance
already existed before, it should rollback to the field-values before
opening the edit screen. 

Since editing the beaneditform directly sets the fields of the
user-instance, all old values are overwritten. 

The question: of course I can get the persisted user from db when the
'cancel'-button is pressed and overwrite the user in applicationstate with
this fetched used from db, but this requires a db-call which I want to
avoid. 

Best would be to create a clone of the user-instance in onActivate which I
can use instead of the fetched instance from db. However, the fields of the
user-profiel are likely to change, so I want to clone 'dynamically'. 

Any bean*-functionality that I can leverage for this? 

Moreover, about that cancel-button, does beaneditform has an option to
display a cancel-button or something alike, with events I can bind to? 

Thanks in advance,
Geert-Jan
-- 
View this message in context: 
http://www.nabble.com/t5%3A-rollback-when-profile-update-is-cancelled-with-beaneditform-tp18320046p18320046.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]



T5: beaneditform: properties don't get populated although model is bound

2008-07-07 Thread Britske

I've got a beaneditform which displays a userprofile, with among other things
2 passwordsfields. 
When displaying an existing userprofile all fields except the password
fields are rendered, (the password fields remain empty), although values for
the password-fields exists in the bound userprofile. 

These password fields as exactly the fields that I overwrite using the
parameter-construction. 
Anyone knows why this happens? 

relevant snippets: 

private User user;
@Persist(flash) private User userOld;
public void onActivate(Object[] list){
if(isUserExists()){
user = getSessionModel().getUser();
userOld = user.clone();
}
}

//template
t:beaneditform t:id=beanEditForm object=user
submitlabel=prop:LabelForSuccess
t:parameter name=password
t:label for=password/
t:passwordfield t:id=password value=user.password/
/t:parameter
t:parameter name=passwordagain
t:label for=passwordagain/
t:passwordfield t:id=passwordagain
value=user.passwordagain/
/t:parameter
/t:beaneditform

Thanks a lot.
-- 
View this message in context: 
http://www.nabble.com/T5%3A-beaneditform%3A-properties-don%27t-get-populated-although-model-is-bound-tp18328072p18328072.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: beaneditform: properties don't get populated although model is bound

2008-07-07 Thread Britske

partially answering my own question: it doens't happen when both
passwordfields are changed from type: passwordField to type: textField. 

Perhaps this is a bug in passwordField? 
Kind regards,
Britske


Britske wrote:
 
 I've got a beaneditform which displays a userprofile, with among other
 things 2 passwordsfields. 
 When displaying an existing userprofile all fields except the password
 fields are rendered, (the password fields remain empty), although values
 for the password-fields exists in the bound userprofile. 
 
 These password fields as exactly the fields that I overwrite using the
 parameter-construction. 
 Anyone knows why this happens? 
 
 relevant snippets: 
 
 private User user;
 @Persist(flash) private User userOld;
 public void onActivate(Object[] list){
   if(isUserExists()){
   user = getSessionModel().getUser();
   userOld = user.clone();
   }
   }
 
 //template
 t:beaneditform t:id=beanEditForm object=user
 submitlabel=prop:LabelForSuccess
   t:parameter name=password
 t:label for=password/
 t:passwordfield t:id=password value=user.password/
 /t:parameter
 t:parameter name=passwordagain
 t:label for=passwordagain/
 t:passwordfield t:id=passwordagain
 value=user.passwordagain/
 /t:parameter
 /t:beaneditform
 
 Thanks a lot.
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-beaneditform%3A-properties-don%27t-get-populated-although-model-is-bound-tp18328072p18328137.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: beaneditform: properties don't get populated although model is bound

2008-07-07 Thread Britske

yeah that makes sense. 
However, when a user wants to edit his userprofile, I want the password
fields to be filled in. How would I do this using the beaneditform? Is this
at all possible? 




Martijn Brinkers (List)-2 wrote:
 
 That's intentional. You do not want your password to be sent to the
 client. 
 
 Martijn
 
 
 On Mon, 2008-07-07 at 15:27 -0700, Britske wrote:
 I've got a beaneditform which displays a userprofile, with among other
 things
 2 passwordsfields. 
 When displaying an existing userprofile all fields except the password
 fields are rendered, (the password fields remain empty), although values
 for
 the password-fields exists in the bound userprofile. 
 
 These password fields as exactly the fields that I overwrite using the
 parameter-construction. 
 Anyone knows why this happens? 
 
 relevant snippets: 
 
 private User user;
 @Persist(flash) private User userOld;
 public void onActivate(Object[] list){
  if(isUserExists()){
  user = getSessionModel().getUser();
  userOld = user.clone();
  }
  }
 
 //template
 t:beaneditform t:id=beanEditForm object=user
 submitlabel=prop:LabelForSuccess
  t:parameter name=password
 t:label for=password/
 t:passwordfield t:id=password value=user.password/
 /t:parameter
 t:parameter name=passwordagain
 t:label for=passwordagain/
 t:passwordfield t:id=passwordagain
 value=user.passwordagain/
 /t:parameter
 /t:beaneditform
 
 Thanks a lot.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-beaneditform%3A-properties-don%27t-get-populated-although-model-is-bound-tp18328072p18328418.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]



how to get the nice ajax form-validations when using beaneditform.recordError()

2008-07-07 Thread Britske

I get nice ajax validations on fields when using the @Validate-annotation
etc. 
I want that as well for cross-field validation, but instead I get the
'general' validation box in red above my form. 

I used the following validation-code to check if the two passwords supplied
are the same, and if not record an error to the password field: 

Object onValidateForm(){
if(!user.getPassword().equals(user.getPasswordAgain())){
beanEditForm.recordError(password, the two passwords 
supplied were not
the same));
}

Does this have to do with the 'ajax-validations' being bounded to a
particular field and the 'general validation' being bound to the form in
general (this is how it seems to me). 

Does anyone know how to get the nice ajax-validations on the above
validation as well? 
Thanks.
-- 
View this message in context: 
http://www.nabble.com/how-to-get-the-nice-ajax-form-validations-when-using-beaneditform.recordError%28%29-tp18328440p18328440.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]



T5: how to add a LinkFactoryListener to the existing linkFactory-service

2008-06-19 Thread Britske

I'm trying to add a custom made LinkFactoryListener to the existing
LinkFactory-service, but with now success. I must admit I'm really not
fluent with Tapestr-ioc so I think it might me something obvious. 

I tried several things, for instance trying to contribute a listener to the
LinkFactory (if it can be contributed to, how do you know for sure? ), but
that doens't work. 

building a LinkFactory as a service and  adding the built
LinkFactoryListener (see below) doesn't work either error -- Service id
'LinkFactory' has already been defined.

Any suggestions? 
Thanks,
---

public LinkFactoryListener buildSessionStripLinkFactoryListener()
{
return new LinkFactoryListener()
{
public void createdActionLink(Link link) {
for(String name: link.getParameterNames()){
System.out.println(name);
}
}

public void createdPageLink(Link link) {
for(String name: link.getParameterNames()){
System.out.println(name);
}
}
};
}

public LinkFactory build(
@InjectService(LinkFactory) LinkFactory linkFactory, 
@InjectService(SessionStripLinkFactoryListener) 
LinkFactoryListener
listener){
linkFactory.addListener(listener);
return linkFactory;
}
-- 
View this message in context: 
http://www.nabble.com/T5%3A-how-to-add-a-LinkFactoryListener-to-the-existing-linkFactory-service-tp18013026p18013026.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: getting ClassFactory is matched by 2 services After upgrade from 5.06 - 5.0.11

2008-05-19 Thread Britske

I do not quite understand where to put the annotation. I haven't got any code
where I'm referencing a classloader explicitly. I must be something missing
here?..



Howard Lewis Ship wrote:
 
 Add the injection point (i.e., the constructor parameter) add either
 the @Builtin or the @ComponentLayer annotation.  This marker
 annotation will select the correct implementation:  either the general
 ClassFactory (used by the IoC container) or the one used when working
 with component code.  You probably want @Builtin.
 
 On Sun, May 18, 2008 at 6:40 AM, Britske [EMAIL PROTECTED] wrote:

 After upgrading tapestry from 5.0.6  to 5.0.11 I'm getting the following
 error:

 Caused by: java.lang.RuntimeException: Service interface
 org.apache.tapestry.ioc.services.ClassFactory is matched by 2 services:
 ClassFactory, ComponentClassFactory.  Automatic dependency resolution
 requires that exactly one service implement the interface.

 I'm getting the error (I think), I'm just not sure where to look to
 change
 it. For instance, I have nothing defined in my AppModule that could be
 the
 cause.

 Anyone?

 Thanks,
 Britske
 --
 View this message in context:
 http://www.nabble.com/getting-ClassFactory-is-matched-by-2-services-After-upgrade-from-5.06--%3E-5.0.11-tp17303089p17303089.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]


 
 
 
 -- 
 Howard M. Lewis Ship
 
 Creator Apache Tapestry and Apache HiveMind
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/getting-ClassFactory-is-matched-by-2-services-After-upgrade-from-5.06--%3E-5.0.11-tp17303089p17323208.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]



getting ClassFactory is matched by 2 services After upgrade from 5.06 - 5.0.11

2008-05-18 Thread Britske

After upgrading tapestry from 5.0.6  to 5.0.11 I'm getting the following
error:

Caused by: java.lang.RuntimeException: Service interface
org.apache.tapestry.ioc.services.ClassFactory is matched by 2 services:
ClassFactory, ComponentClassFactory.  Automatic dependency resolution
requires that exactly one service implement the interface.

I'm getting the error (I think), I'm just not sure where to look to change
it. For instance, I have nothing defined in my AppModule that could be the
cause. 

Anyone?

Thanks,
Britske
-- 
View this message in context: 
http://www.nabble.com/getting-ClassFactory-is-matched-by-2-services-After-upgrade-from-5.06--%3E-5.0.11-tp17303089p17303089.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: nested loops don't work (can't figure this one out)

2008-03-28 Thread Britske

Arghh. Thanks a lot! I missed that. I figured it couldn't be a Tapestry
thing. 

I traced back why I thought that the resulting sublist had an element (while
in fact it didn't): apparently a sublist is nothing but a wrapper around the
source-list (which I didn't know_, which is why burried in the debug
parameters the sublist still shows to have an element. Anyhow, 

Thanks again. 


Jonathan Barker wrote:
 
 Subtle logic error.
 
 outputlist.add(list.subList(counter,
 Math.min(counter+maxListsize,outputlist.size(;
 
 Should be 
 
 outputlist.add(list.subList(counter,
 Math.min(counter+maxListsize, list.size(;
 
 Gotta love those!
 
 
 -Original Message-
 From: Britske [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 27, 2008 2:25 PM
 To: users@tapestry.apache.org
 Subject: T5: nested loops don't work (can't figure this one out)
 
 
 Hi,
 
 I'm breaking my head on this one.
 I have  2 nested loops where the value of the outer loop is used as the
 source of the inner loop.
 
 The problem is that getCurPhotoAsThumb() is never called (as noticed by
 debugging) thus nothing is rendered.
 I've made sure that getCurThumbSublist() has at least 1 element.
 
 Anyone?
 
 I've supplied the relative template and class-parts:
 
 TEMPLATE
 -
 t:loop source=listOfThumbSubLists value=curThumbSublist
   div id=${currentThumbContainerId} class=thumbcontainer
t:loop source=curThumbSublist value=curPhotoAsThumb
${curPhotoAsThumb.url}
  /t:loop
/div
  /t:loop
 
 
 CLASS
 ---
 private int maxListsize = 6;
 private ListPhoto curThumbSublist;
 private Photo curPhotoAsThumb;
 private int curListCounter = 0;
 
  public ListPhoto getCurThumbSublist()
  {
  return curThumbSublist;
  }
 
  public void setCurThumbSublist(ListPhoto curThumbSublist)
  {
  this.curThumbSublist = curThumbSublist;
  curListCounter++;
  }
 
  public String getCurrentThumbContainerId()
  {
  return thumb_+curListCounter;
  }
 
  public ListListPhoto getListOfThumbSubLists(){
  curListCounter= 0;
  ListListPhoto outputlist = new ArrayListListPhoto();
 
  SetPhoto set = this.getPage().getPhotos();
  ListPhoto list = new ArrayListPhoto();
  for(Photo p: set){
  list.add(p);
  System.out.println(p.getUrl());
  }
  int counter = 0;
  boolean stop = false;
  while(!stop){
  outputlist.add(list.subList(counter,
 Math.min(counter+maxListsize,outputlist.size(;
  if(list.size()=counter+maxListsize){
  stop = true;
  }
  counter += maxListsize;
  }
  return outputlist;
  }
 
  public Photo getCurPhotoAsThumb()
  {
  return curPhotoAsThumb;
  }
 
  public void setCurPhotoAsThumb(Photo curPhotoAsThumb)
  {
  this.curPhotoAsThumb = curPhotoAsThumb;
  }
 --
 View this message in context: http://www.nabble.com/T5%3A-nested-loops-
 don%27t-work-%28can%27t-figure-this-one-out%29-tp16330163p16330163.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]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-nested-loops-don%27t-work-%28can%27t-figure-this-one-out%29-tp16330163p16347650.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]



T5: nested loops don't work (can't figure this one out)

2008-03-27 Thread Britske

Hi, 

I'm breaking my head on this one. 
I have  2 nested loops where the value of the outer loop is used as the
source of the inner loop.

The problem is that getCurPhotoAsThumb() is never called (as noticed by
debugging) thus nothing is rendered. 
I've made sure that getCurThumbSublist() has at least 1 element. 

Anyone?

I've supplied the relative template and class-parts:

TEMPLATE
-
t:loop source=listOfThumbSubLists value=curThumbSublist
  div id=${currentThumbContainerId} class=thumbcontainer
   t:loop source=curThumbSublist value=curPhotoAsThumb
   ${curPhotoAsThumb.url}
/t:loop
   /div
 /t:loop


CLASS 
---
private int maxListsize = 6;
private ListPhoto curThumbSublist;
private Photo curPhotoAsThumb;
private int curListCounter = 0;

public ListPhoto getCurThumbSublist()
{
return curThumbSublist;
}

public void setCurThumbSublist(ListPhoto curThumbSublist)
{
this.curThumbSublist = curThumbSublist;
curListCounter++;
}

public String getCurrentThumbContainerId()
{
return thumb_+curListCounter;
}

public ListListPhoto getListOfThumbSubLists(){
curListCounter= 0;
ListListPhoto outputlist = new ArrayListListPhoto();

SetPhoto set = this.getPage().getPhotos();
ListPhoto list = new ArrayListPhoto();
for(Photo p: set){
list.add(p);
System.out.println(p.getUrl());
}
int counter = 0;
boolean stop = false;
while(!stop){
outputlist.add(list.subList(counter,
Math.min(counter+maxListsize,outputlist.size(;
if(list.size()=counter+maxListsize){
stop = true;
}
counter += maxListsize;
}
return outputlist;
}

public Photo getCurPhotoAsThumb()
{
return curPhotoAsThumb;
}

public void setCurPhotoAsThumb(Photo curPhotoAsThumb)
{
this.curPhotoAsThumb = curPhotoAsThumb;
}
-- 
View this message in context: 
http://www.nabble.com/T5%3A-nested-loops-don%27t-work-%28can%27t-figure-this-one-out%29-tp16330163p16330163.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]



T5: AJAX and Firefox doesn't work

2008-01-02 Thread Britske

A strange thing happens. 

following an example of returning a streamresponse based on a user-click,
this all works well in IE7 but not in Firefox. Instead firefox exectutes the
action and the simply fires an onActivate-event rendering the action useless
(the page is simply loaded again as if the action wasn't fired. ) 

Anyone knows whats happening here? (I know this may nog be tapestry-related,
but I'm not sure. )

- template --

script type=text/javascript
function handleResponse (xhrResponse){
alert (xhrResponse.responseText);
}

function asyncCall (){
new Ajax.Request ('${quickSearchBoxLink}',
{asynchronous:true,onSuccess:handleResponse});
}
/script

button onclick=asyncCall();Do AJAX Call/button


-- class --

/**
 * Generates a URI to the server-side function for the XHR
 * to use.
 *
 * @return the link
 */
public String getQuickSearchBoxLink ()  {
Link l = getResources().createActionLink 
(quickSearchBoxAction, false);
return l.toURI();
}

/**
 * This is a server-side method called via XHR that returns
 * some text.
 *
 * @return some text
 */
private StreamResponse onQuickSearchBoxAction (){
return new TextStreamResponse (text/html, Five bucks below 
the belt. 
That's how I roll.);
}

Thanks, (and a happy New Year!)

Geert-Jan
-- 
View this message in context: 
http://www.nabble.com/T5%3A-AJAX-and-Firefox-doesn%27t-work-tp14575595p14575595.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]



T5: template parser XHTML-well formed -- javascript goes wrong

2008-01-02 Thread Britske

Hi ,

I have a template which includes a javascript-function: 

function asyncCall (){
  if(($('quickTextField').value.length  2))
  {
new Ajax.Request ('${quickSearchBoxLink}',
{asynchronous:true,onSuccess:handleResponse});
  } 
}

However, this gets converted to (note the gt; instead of '' (greater than)
:

function asyncCall (){
alert($('quickTextField').value);

if(document.getElementById(quickTextField).value.length gt; 3)
{
new Ajax.Request 
('/aanbiedingen.quicknavigation:quickSearchBoxAction',
{asynchronous:true,onSuccess:handleResponse});
}


}

Obviously this is because the template outputs well-formed XHTML. 
Still I need to include the function in the template since I need '
${quickSearchBoxLink}' to be translated by Tapestry. How to proceed? 

Thanks,
Geert-Jan
-- 
View this message in context: 
http://www.nabble.com/T5%3A-template-parser-XHTML-well-formed---%3E-javascript-goes-wrong-tp14576351p14576351.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: AJAX and Firefox doesn't work

2008-01-02 Thread Britske

somehow the bug doesn't appear anymore.  I'm running 5.0.6 so it could be
related. I'll investigate once I encounter it again. 


Howard Lewis Ship wrote:
 
 That's supposed to work; there was a bug in 5.0.6 that may have caused
 this behavior (and is fixed in 5.0.7).
 
 On Jan 2, 2008 1:43 AM, Britske [EMAIL PROTECTED] wrote:

 A strange thing happens.

 following an example of returning a streamresponse based on a user-click,
 this all works well in IE7 but not in Firefox. Instead firefox exectutes
 the
 action and the simply fires an onActivate-event rendering the action
 useless
 (the page is simply loaded again as if the action wasn't fired. )

 Anyone knows whats happening here? (I know this may nog be
 tapestry-related,
 but I'm not sure. )

 - template --

 script type=text/javascript
 function handleResponse (xhrResponse){
 alert (xhrResponse.responseText);
 }

 function asyncCall (){
 new Ajax.Request ('${quickSearchBoxLink}',
 {asynchronous:true,onSuccess:handleResponse});
 }
 /script

 button onclick=asyncCall();Do AJAX Call/button


 -- class --

 /**
  * Generates a URI to the server-side function for the XHR
  * to use.
  *
  * @return the link
  */
 public String getQuickSearchBoxLink ()  {
 Link l = getResources().createActionLink
 (quickSearchBoxAction, false);
 return l.toURI();
 }

 /**
  * This is a server-side method called via XHR that returns
  * some text.
  *
  * @return some text
  */
 private StreamResponse onQuickSearchBoxAction (){
 return new TextStreamResponse (text/html, Five bucks
 below the belt.
 That's how I roll.);
 }

 Thanks, (and a happy New Year!)

 Geert-Jan
 --
 View this message in context:
 http://www.nabble.com/T5%3A-AJAX-and-Firefox-doesn%27t-work-tp14575595p14575595.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]


 
 
 
 -- 
 Howard M. Lewis Ship
 
 Creator Apache Tapestry and Apache HiveMind
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-AJAX-and-Firefox-doesn%27t-work-tp14575595p14581723.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: Linkage error .... violates loader constraints

2007-12-21 Thread Britske

As an addition: 

also pointing out what type of errors are likely to cause these errors would
help. 
I know that mixing injection with components can give loader constraints,
which is why i created an interface for SuperPage. Moreover, I can mimagine
that cyclic references would cause errors as well. Are there any others that
I should track in my code? 

Thanks again, 
Geert-Jan


Britske wrote:
 
 I'm going slightly insane on this one..
 that's because everything worked fine, and after some slight modifications
 (none that could cause such errors  I believe) I can't backtrack anymore
 where things went wrong. 
 
 The error I'm getting is this: 
 
 Could not convert 'page.quickNavigation' into a component parameter
 binding: java.lang.LinkageError: Class
 com/wrappt/aroer/base/AbstractNavigationContainer violates loader
 constraints. 
 for full stack-trace see entirely below. 
 
 location
 classpath:com/wrappt/aroer/components/BaseLayout.tml, line 122, column
 77
 117   div class=h plain
 118   h2Verfijn de resultaten/h2
 119   /div
 120   div class=c
 121   !-- t:quickForm t:id=quickForm/--
 122   t:delegate t:id=quickFormDelegate 
 t:to=page.quickNavigation/
 -- here it happens
 123   /div
 124   div class=f nbsp; /div
 125   /div
 126   /div
 127   /div
 
 the setup is not that simple, but here it goes anyway: 
 
 - baselayout is a basic layout that wraps all pages as implemented in an
 abstract class called superPage. 
 - all pages extend SuperPage. 
 - SuperPage implements ISuperPage (for mixing services with components)
 - all pages have a quicknavigation component , although their
 implementation can be different. 
 - each quickNavigation-component inherits from AbstractNavigationContainer
 (which is where the loader constraint happens)
 
 the relevant parts: 
 
 BaseLayout
 --
 @Parameter(required = true)
 private ISuperPage page;
 public ISuperPage getPage()
 {
   return (ISuperPage)page;
 }
 
 
 SuperPage (implements ISuperPage)
 --
 @Component(parameters={page=this})
 private BaseLayout bl;
 
 public abstract AbstractNavigationContainer getQuickNavigation();
 
 Aanbiedingen extends SuperPage
 --
 @Component private QuickFormAllResultsquickNavigation;
 public QuickFormAllResults getQuickNavigation()   {
   return this.quickNavigation;
   }
 
 Aanbiedingen.tml
 --
 t:baselayout t:id=bl
 xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
 t:block
   t:quickformallresults t:id=quickNavigation/
 /t:block
 ...
 /t:baselayout
 
 and finally: 
 QuickFormAllResults extends AbstractNavigationContainer
 -
 // nothing intersteing here
 
 
 AbstractNavigationContainer
 ---
 public SuperPage getPage()
 {
  . //uses componentresources to recursively traverse the tree upwards
 until it finds a componet
 of type SuperPage and returns that.. 
 }
 
 
 I'm really out of options, as I can't seem to comment enough lines to make
 it work: when i comment quicknavigation  in baselayout.tml the error
 simply shifts to another component that implements
 AbstractNavigationContainer
 
 Thanks a lot for any help!
 Geert-Jan 
 
 p.s: i was on 5.0.7 SNAPSHOT and now back  on 5.0.6
 
 stacktrace: 
 Caused by: java.lang.LinkageError: Class
 com/wrappt/aroer/base/AbstractNavigationContainer violates loader
 constraints
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
   at
 java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
   at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
   at java.lang.Class.getDeclaredMethods0(Native Method)
   at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
   at java.lang.Class.getDeclaredMethods(Class.java:1763)
   at java.beans.Introspector$1.run(Introspector.java:1265)
   at java.security.AccessController.doPrivileged(Native Method)
   at
 java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1263)
   at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1129)
   at java.beans.Introspector.getBeanInfo(Introspector.java:387)
   at java.beans.Introspector.getBeanInfo(Introspector.java:159

T5: Linkage error .... violates loader constraints

2007-12-21 Thread Britske

I'm going slightly insane on this one..
that's because everything worked fine, and after some slight modifications
(none that could cause such errors  I believe) I can't backtrack anymore
where things went wrong. 

The error I'm getting is this: 

Could not convert 'page.quickNavigation' into a component parameter binding:
java.lang.LinkageError: Class
com/wrappt/aroer/base/AbstractNavigationContainer violates loader
constraints. 
for full stack-trace see entirely below. 

location
classpath:com/wrappt/aroer/components/BaseLayout.tml, line 122, column
77
117 div class=h plain
118 h2Verfijn de resultaten/h2
119 /div
120 div class=c
121 !-- t:quickForm t:id=quickForm/--
122 t:delegate t:id=quickFormDelegate t:to=page.quickNavigation/
-- here it happens
123 /div
124 div class=f nbsp; /div
125 /div
126 /div
127 /div

the setup is not that simple, but here it goes anyway: 

- baselayout is a basic layout that wraps all pages as implemented in an
abstract class called superPage. 
- all pages extend SuperPage. 
- SuperPage implements ISuperPage (for mixing services with components)
- all pages have a quicknavigation component , although their implementation
can be different. 
- each quickNavigation-component inherits from AbstractNavigationContainer
(which is where the loader constraint happens)

the relevant parts: 

BaseLayout
--
@Parameter(required = true)
private ISuperPage page;
public ISuperPage getPage()
{
return (ISuperPage)page;
}


SuperPage (implements ISuperPage)
--
@Component(parameters={page=this})
private BaseLayout bl;

public abstract AbstractNavigationContainer getQuickNavigation();

Aanbiedingen extends SuperPage
--
@Component private QuickFormAllResults  quickNavigation;
public QuickFormAllResults getQuickNavigation() {
return this.quickNavigation;
}

Aanbiedingen.tml
--
t:baselayout t:id=bl
xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
t:block
t:quickformallresults t:id=quickNavigation/
/t:block
...
/t:baselayout

and finally: 
QuickFormAllResults extends AbstractNavigationContainer
-
// nothing intersteing here


AbstractNavigationContainer
---
public SuperPage getPage()
{
 . //uses componentresources to recursively traverse the tree upwards
until it finds a componet
of type SuperPage and returns that.. 
}


I'm really out of options, as I can't seem to comment enough lines to make
it work: when i comment quicknavigation  in baselayout.tml the error simply
shifts to another component that implements AbstractNavigationContainer

Thanks a lot for any help!
Geert-Jan 

p.s: i was on 5.0.7 SNAPSHOT and now back  on 5.0.6

stacktrace: 
Caused by: java.lang.LinkageError: Class
com/wrappt/aroer/base/AbstractNavigationContainer violates loader
constraints
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
at java.lang.Class.getDeclaredMethods(Class.java:1763)
at java.beans.Introspector$1.run(Introspector.java:1265)
at java.security.AccessController.doPrivileged(Native Method)
at 
java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1263)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1129)
at java.beans.Introspector.getBeanInfo(Introspector.java:387)
at java.beans.Introspector.getBeanInfo(Introspector.java:159)
at
org.apache.tapestry.ioc.internal.services.PropertyAccessImpl.buildAdapter(PropertyAccessImpl.java:85)
... 72 more
-- 
View this message in context: 
http://www.nabble.com/T5%3A-Linkage-error--violates-loader-constraints-tp14460169p14460169.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: Linkage error .... violates loader constraints

2007-12-21 Thread Britske

what do you mean exactly by trying to define a class in classloader ? 
I didn't do anything special in creating these instances and just follow the
normal route. 
The one thing that may have some, I dont'know :  dependency cycle thing
going on is: 

SuperPage referencing component quickNavigation
and quickNavigation referencing Superpage by using componentResources to
travere the component-tree upwards. 
No sign of double recreating a base-class twice (in one pass)

please keep the options coming, 
I will investigate further, 
Geert-Jan



joshcanfield wrote:
 
 That error can be caused by trying to define a class in classloader which
 already contains a class with the same name. I believe that Tapestry does
 some magic with the component base classes when it is extending them...
 maybe there is something causing Tapestry to try and recreate the base
 class
 twice?
 
 On Dec 21, 2007 10:37 AM, Britske [EMAIL PROTECTED] wrote:
 

 As an addition:

 also pointing out what type of errors are likely to cause these errors
 would
 help.
 I know that mixing injection with components can give loader constraints,
 which is why i created an interface for SuperPage. Moreover, I can
 mimagine
 that cyclic references would cause errors as well. Are there any others
 that
 I should track in my code?

 Thanks again,
 Geert-Jan


 Britske wrote:
 
  I'm going slightly insane on this one..
  that's because everything worked fine, and after some slight
 modifications
  (none that could cause such errors  I believe) I can't backtrack
 anymore
  where things went wrong.
 
  The error I'm getting is this:
 
  Could not convert 'page.quickNavigation' into a component parameter
  binding: java.lang.LinkageError: Class
  com/wrappt/aroer/base/AbstractNavigationContainer violates loader
  constraints.
  for full stack-trace see entirely below.
 
  location
  classpath:com/wrappt/aroer/components/BaseLayout.tml, line 122,
 column
  77
  117   div class=h plain
  118   h2Verfijn de resultaten/h2
  119   /div
  120   div class=c
  121   !-- t:quickForm t:id=quickForm/--
  122   t:delegate t:id=quickFormDelegate t:to=
 page.quickNavigation/
  -- here it happens
  123   /div
  124   div class=f nbsp; /div
  125   /div
  126   /div
  127   /div
 
  the setup is not that simple, but here it goes anyway:
 
  - baselayout is a basic layout that wraps all pages as implemented in
 an
  abstract class called superPage.
  - all pages extend SuperPage.
  - SuperPage implements ISuperPage (for mixing services with components)
  - all pages have a quicknavigation component , although their
  implementation can be different.
  - each quickNavigation-component inherits from
 AbstractNavigationContainer
  (which is where the loader constraint happens)
 
  the relevant parts:
 
  BaseLayout
  --
  @Parameter(required = true)
  private ISuperPage page;
  public ISuperPage getPage()
  {
return (ISuperPage)page;
  }
 
 
  SuperPage (implements ISuperPage)
  --
  @Component(parameters={page=this})
  private BaseLayout bl;
 
  public abstract AbstractNavigationContainer getQuickNavigation();
 
  Aanbiedingen extends SuperPage
  --
  @Component private QuickFormAllResultsquickNavigation;
  public QuickFormAllResults getQuickNavigation()   {
return this.quickNavigation;
}
 
  Aanbiedingen.tml
  --
  t:baselayout t:id=bl
  xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
  t:block
t:quickformallresults t:id=quickNavigation/
  /t:block
  ...
  /t:baselayout
 
  and finally:
  QuickFormAllResults extends AbstractNavigationContainer
  -
  // nothing intersteing here
 
 
  AbstractNavigationContainer
  ---
  public SuperPage getPage()
  {
   . //uses componentresources to recursively traverse the tree
 upwards
  until it finds a componet
  of type SuperPage and returns that..
  }
 
 
  I'm really out of options, as I can't seem to comment enough lines to
 make
  it work: when i comment quicknavigation  in baselayout.tml the error
  simply shifts to another component that implements
  AbstractNavigationContainer
 
  Thanks a lot for any help!
  Geert-Jan
 
  p.s: i was on 5.0.7 SNAPSHOT and now back  on 5.0.6
 
  stacktrace:
  Caused by: java.lang.LinkageError: Class
  com/wrappt/aroer/base/AbstractNavigationContainer violates loader
  constraints
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
  java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195

t5: violates loader constraints-error when loading pages into ioc-injected class-instance

2007-12-06 Thread Britske

I created a class PageRegistry and defined it in Spring. I use @Inject to
inject the singleton-instance of this class. (This worked before with other
classes). 

in the constructor of PageRegistry I fill a map with page-instances. (So
that i can access some methods of a page when  I dont have access to a
specific instance, ad having static-methods  doesn't cut it. )

At that point I get a violates loader constraints-error on component
QuickFormAllResults. (A component which is contained by a couple of those
pages). 

What's happing here? Is instantiating page-instances in a ioc-injected
class-instance impossible or something? 

Thanks,
Geert-Jan

complete stacktrace:
java.lang.LinkageError: Class cut/components/QuickFormAllResults violates
loader constraints
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
at javassist.Loader.findClass(Loader.java:379)
at
org.apache.tapestry.internal.services.ComponentInstantiatorSourceImpl$PackageAwareLoader.findClass(ComponentInstantiatorSourceImpl.java:85)
at javassist.Loader.loadClass(Loader.java:311)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.apache.tapestry.internal.services.ComponentInstantiatorSourceImpl.findClass(ComponentInstantiatorSourceImpl.java:254)
at
org.apache.tapestry.internal.services.ComponentInstantiatorSourceImpl.findInstantiator(ComponentInstantiatorSourceImpl.java:240)
at
$ComponentInstantiatorSource_116b0b3a7be.findInstantiator($ComponentInstantiatorSource_116b0b3a7be.java)
at
org.apache.tapestry.internal.services.PageElementFactoryImpl.newComponentElement(PageElementFactoryImpl.java:268)
at
$PageElementFactory_116b0b3a7e8.newComponentElement($PageElementFactory_116b0b3a7e8.java)
at
org.apache.tapestry.internal.services.PageLoaderProcessor.startComponent(PageLoaderProcessor.java:618)
at
org.apache.tapestry.internal.services.PageLoaderProcessor.loadTemplateForComponent(PageLoaderProcessor.java:498)
at
org.apache.tapestry.internal.services.PageLoaderProcessor.workComponentQueue(PageLoaderProcessor.java:714)
at
org.apache.tapestry.internal.services.PageLoaderProcessor.loadPage(PageLoaderProcessor.java:392)
at
org.apache.tapestry.internal.services.PageLoaderImpl.loadPage(PageLoaderImpl.java:59)
at $PageLoader_116b0b3a7e6.loadPage($PageLoader_116b0b3a7e6.java)
at
org.apache.tapestry.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:70)
at $PagePool_116b0b3a7e5.checkout($PagePool_116b0b3a7e5.java)
at
org.apache.tapestry.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:44)
at $RequestPageCache_116b0b3a7e4.get($RequestPageCache_116b0b3a7e4.java)
at $RequestPageCache_116b0b3a7bb.get($RequestPageCache_116b0b3a7bb.java)
at
org.apache.tapestry.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:55)
at
$PageRenderRequestHandler_116b0b3a7dd.handle($PageRenderRequestHandler_116b0b3a7dd.java)
at
org.apache.tapestry.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:72)
at $Dispatcher_116b0b3a7e0.dispatch($Dispatcher_116b0b3a7e0.java)
at $Dispatcher_116b0b3a7d3.dispatch($Dispatcher_116b0b3a7d3.java)
at
org.apache.tapestry.services.TapestryModule$13.service(TapestryModule.java:1108)
at com.wrappt.aroer.services.AppModule$3.service(AppModule.java:194)
at $RequestFilter_116b0b3a7d1.service($RequestFilter_116b0b3a7d1.java)
at $RequestHandler_116b0b3a7d4.service($RequestHandler_116b0b3a7d4.java)
at com.wrappt.aroer.services.AppModule$4.service(AppModule.java:215)
at $RequestFilter_116b0b3a7d2.service($RequestFilter_116b0b3a7d2.java)
at $RequestHandler_116b0b3a7d4.service($RequestHandler_116b0b3a7d4.java)
at
org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:43)
at $RequestHandler_116b0b3a7d4.service($RequestHandler_116b0b3a7d4.java)
at
org.apache.tapestry.services.TapestryModule$2.service(TapestryModule.java:688)
at $RequestHandler_116b0b3a7d4.service($RequestHandler_116b0b3a7d4.java)
at
org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:84)
at $RequestHandler_116b0b3a7d4.service($RequestHandler_116b0b3a7d4.java)
at
org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:97)
at
org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:88)
at
org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77)
at
org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:110)

T5: conditional parameter binding or something

2007-12-04 Thread Britske

I need a bit of introduction to lay down the problem, so please bare with me: 

I have a component which renders lists of items. A parameter (childcounter)
keeps track of the number of rendered items in the current List. 

I have the requirement. to be able to define on a per-page basis how many
items are rendered at max. I implemented this by simply binding childcounter
param and checking it against a field (say: maxitems) on the page. Depending
on that I can decide on a per-page basis what to do with items that exceed
the maxitems-threshold. (render different blocks, etc) So far so good. 

Currenly Im using this component to render facets
(http://en.wikipedia.org/wiki/Faceted_classification) as part of a
navigation menu. The requirement is to (for each list) render all SELECTED
facets first and then render x (say 5) UNSELECTED facets per list, where x
is defined by maxitems. 

The problem: 
the component doesn't know (and shouldnt know) that it is rendering facets.
So it doens't know if a facet is selected or unselected. Based on that the
childcounter is incremented each time a selected or unselected facet is
rendered, and the maxitem-treshold is reached when 5 facets per group are
rendered (independent whether they are selected or unselected). Obviously
thats not what I want. 

The solution (so I thought) 
1. The component doens't know that it's rendering facets, but the page
knows. Moreover, the component outputs the item that it is currently
rendering. (the facet in this case). 
2. the param childcounter of the component is bound to the page field
'facetCounter'

since as I understand it a param-binding is bi-directional I did the
following: 

Page:
--
@Component(parameters = {result=facetdsText,
row=gGroup,childrow=facet,ulClass=literal:facets,
childcounter=facetcounter})
private CompositeFlexLi facetBlock;

public void setFacetCounter(int facetCounter)
{
   if(facet==null || !facet.getFacet().isSelected()) 
  {
this.facetCounter = facetCounter;
  }
}

What it does is obvious: 
1. the component renders and updates childcounter, which in effect calls
setFacetCounter(int facetCounter), since its bound to facetCounter. 
2. facetCounter is only updated when the current item is a UNSELECTED facet
(which it knows in contrast to the component)

The actual problem now is that facetCounter indeed is only updated when a
facet is unselected, but the parameter 'childcounter' is still updated,
although it is bound to the field facetCounter which is not updated (they
aren't in sync). 
The behavior now is the following: (say i have 2 selected facets)
childcounter: 1,2,3,4,5
facetfield: 0,0,3,4,5

while i figured it would be:
childcounter: 0,0,1,2,3,4,5
facetfield: 0,0,1,2,3,4,5

Was I expecting to much 'binding-magic' to happen here, or am I missing
something?
If not, what would be your suggestion to tackle this issue? (making the
component aware that its rendering facets is as I explained no option)

Thanks in advance,
Geert-Jan


-- 
View this message in context: 
http://www.nabble.com/T5%3A-%22conditional-parameter-binding%22-or-something-tf4944458.html#a14155127
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: conditional parameter binding or something

2007-12-04 Thread Britske

I quickly solved it with some kind of hack for those interested, but I'm
still curious if the kind of binding I described is possible at all.

Cheers,
Geert-Jan

A hack that's working: 

introduced 2 extra fields: facetmaxInc and FacetOld; 

public void setFacetCounter(int facetCounter)
{
this.facetCounter = facetCounter;
if(facet!=null  facet.equals(facetold))
{
facetMaxInc = facetMax;
facetold = facet;
}
if(facet!=null  facet.getFacet().isSelected()) 
{
facetMaxInc++;
}
}

and check on facetMaxInc. 



Britske wrote:
 
 I need a bit of introduction to lay down the problem, so please bare with
 me: 
 
 I have a component which renders lists of items. A parameter
 (childcounter) keeps track of the number of rendered items in the current
 List. 
 
 I have the requirement. to be able to define on a per-page basis how many
 items are rendered at max. I implemented this by simply binding
 childcounter param and checking it against a field (say: maxitems) on the
 page. Depending on that I can decide on a per-page basis what to do with
 items that exceed the maxitems-threshold. (render different blocks, etc)
 So far so good. 
 
 Currenly Im using this component to render facets
 (http://en.wikipedia.org/wiki/Faceted_classification) as part of a
 navigation menu. The requirement is to (for each list) render all SELECTED
 facets first and then render x (say 5) UNSELECTED facets per list, where x
 is defined by maxitems. 
 
 The problem: 
 the component doesn't know (and shouldnt know) that it is rendering
 facets. So it doens't know if a facet is selected or unselected. Based on
 that the childcounter is incremented each time a selected or unselected
 facet is rendered, and the maxitem-treshold is reached when 5 facets per
 group are rendered (independent whether they are selected or unselected).
 Obviously thats not what I want. 
 
 The solution (so I thought) 
 1. The component doens't know that it's rendering facets, but the page
 knows. Moreover, the component outputs the item that it is currently
 rendering. (the facet in this case). 
 2. the param childcounter of the component is bound to the page field
 'facetCounter'
 
 since as I understand it a param-binding is bi-directional I did the
 following: 
 
 Page:
 --
 @Component(parameters = {result=facetdsText,
 row=gGroup,childrow=facet,ulClass=literal:facets,
   childcounter=facetcounter})
 private CompositeFlexLi facetBlock;
 
 public void setFacetCounter(int facetCounter)
 {
if(facet==null || !facet.getFacet().isSelected()) 
   {
   this.facetCounter = facetCounter;
   }
 }
 
 What it does is obvious: 
 1. the component renders and updates childcounter, which in effect calls
 setFacetCounter(int facetCounter), since its bound to facetCounter. 
 2. facetCounter is only updated when the current item is a UNSELECTED
 facet (which it knows in contrast to the component)
 
 The actual problem now is that facetCounter indeed is only updated when a
 facet is unselected, but the parameter 'childcounter' is still updated,
 although it is bound to the field facetCounter which is not updated (they
 aren't in sync). 
 The behavior now is the following: (say i have 2 selected facets)
 childcounter: 1,2,3,4,5
 facetfield: 0,0,3,4,5
 
 while i figured it would be:
 childcounter: 0,0,1,2,3,4,5
 facetfield: 0,0,1,2,3,4,5
 
 Was I expecting to much 'binding-magic' to happen here, or am I missing
 something?
 If not, what would be your suggestion to tackle this issue? (making the
 component aware that its rendering facets is as I explained no option)
 
 Thanks in advance,
 Geert-Jan
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-%22conditional-parameter-binding%22-or-something-tf4944458.html#a14155609
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: problems when extending DateField. More flexibility needed?

2007-11-29 Thread Britske

OK , I'll do that. 
How about issue 2? 



Andreas Andreou wrote:
 
 That's the same as
 https://issues.apache.org/jira/browse/TAPESTRY-1795
 only for Tapestry-5... add an issue for it
 
 On Nov 28, 2007 6:39 PM, Britske [EMAIL PROTECTED] wrote:

 Hi,

 I extended datafield to call a defined callback function in javascript.
 like so:

 public class MyDateField extends DateField
 {
 protected void configure(JSONObject setup)
 {
 setup.put(onUpdate, callOnUpdate);
 super.configure(setup);
 }
 }

 This puts a nice javascript into my htmls (see below). However I have 2
 issues:

 1. for a callback function to work with the javascript calendar, I need
 the
 text 'callOnUpdate' to be included into the Calendar.setup (see below)
 WITHOUT quotes. However there's no way I see that I have control of
 outputting this without quotes.

 2. for the defined funciton (callOnUpdate) to be picked up by the
 Calendar,
 the function must be in the same script-block as where calendar.setup
 sits.
 (At least thats what I conclude after testing this my hand. Im no
 javascript-guru). Since this block is rendered by DateField I have no
 possibility of writing the function into the block.

 Whatwould be the best way to tackel this? Of course, I could totally hack
 around DataField ( I can't extend much since most is package-private) but
 I
 really don't want to.

 Cheers,
 Geert-Jan


 This is what tapestry does:
 

 script type=text/javascript
 !--
 Event.observe(window, load, function() {
 Tapestry.registerForm('form');
 Calendar.setup({inputField:a,ifFormat:%d-%m-%y,button:a:trigger,onUpdate:callOnUpdate});
 });
 // --
 /script

 what i need:
 
 script type=text/javascript
 !--

 function callOnUpdate(cal)
 {
 alert('do something here');
 }

 Event.observe(window, load, function() {
 Tapestry.registerForm('form');
 Calendar.setup({inputField:a,ifFormat:%d-%m-%y,button:a:trigger,onUpdate:callOnUpdate});
 });
 // --
 /script

 --
 View this message in context:
 http://www.nabble.com/T5%3A-problems-when-extending-DateField.-More-flexibility-needed--tf4889614.html#a13996007
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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


 
 
 
 -- 
 Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
 Tapestry / Tacos developer
 Open Source / JEE Consulting
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-problems-when-extending-DateField.-More-flexibility-needed--tf4889614.html#a14022547
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



T5: problems when extending DateField. More flexibility needed?

2007-11-28 Thread Britske

Hi, 

I extended datafield to call a defined callback function in javascript.  
like so:

public class MyDateField extends DateField
{
protected void configure(JSONObject setup)
{
setup.put(onUpdate, callOnUpdate);
super.configure(setup);
}
}

This puts a nice javascript into my htmls (see below). However I have 2
issues: 

1. for a callback function to work with the javascript calendar, I need the
text 'callOnUpdate' to be included into the Calendar.setup (see below) 
WITHOUT quotes. However there's no way I see that I have control of
outputting this without quotes. 

2. for the defined funciton (callOnUpdate) to be picked up by the Calendar,
the function must be in the same script-block as where calendar.setup sits.
(At least thats what I conclude after testing this my hand. Im no
javascript-guru). Since this block is rendered by DateField I have no
possibility of writing the function into the block. 

Whatwould be the best way to tackel this? Of course, I could totally hack
around DataField ( I can't extend much since most is package-private) but I
really don't want to.

Cheers, 
Geert-Jan


This is what tapestry does: 


script type=text/javascript
!--
Event.observe(window, load, function() {
Tapestry.registerForm('form');
Calendar.setup({inputField:a,ifFormat:%d-%m-%y,button:a:trigger,onUpdate:callOnUpdate});
});
// --
/script

what i need:

script type=text/javascript
!--

function callOnUpdate(cal)
{
alert('do something here');
}

Event.observe(window, load, function() {
Tapestry.registerForm('form');
Calendar.setup({inputField:a,ifFormat:%d-%m-%y,button:a:trigger,onUpdate:callOnUpdate});
});
// --
/script

-- 
View this message in context: 
http://www.nabble.com/T5%3A-problems-when-extending-DateField.-More-flexibility-needed--tf4889614.html#a13996007
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



T5: why is a coorcion needed from subclass to abstract superclass?

2007-11-16 Thread Britske

just curious: 

why is it needed to make a cooercion from a page subclass to an abstract
superclass? 
Isn't the cast already implictly defined by the 'super-sub relation'? 

Geert-Jan
-- 
View this message in context: 
http://www.nabble.com/T5%3A-why-is-a-coorcion-needed-from-subclass-to-abstract-superclass--tf4821359.html#a13793439
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



T5: how to let subclass decide which component to render

2007-11-16 Thread Britske

I've got a page-class hierachy which all use component BaseLayout as their
layout. This BaseLayout-component contains a component called QuickForm. 

Each page-class must render a QuickForm-component but the implementation may
differ (so there is more than 1 actual QuickForm-component. 

I started experimenting with the following: 

BaseLayout
-
@Component
@Parameter(required=true)
private QuickForm quickForm;


SuperPage
---
@Component(parameters = {page=this,quickform=quickform})
private BaseLayout bl;

@Component
private QuickForm quickForm;

So that he actual quickform can be passed as a parameter from (int this
case) SuperPage to baselayout. 
However, then component quickForm in class SuperPage must exist in the
template, which can be done by putting it in a block,  (But SuperPage is
just what its called, an abstract base-class ,which doens't have a
termplate, so I must put the block in the templates of all actual
implementations of SuperPage, etc. ,etc. ) Excuse the ranting, but I think
you get the point.

All in all, I don't like this approach at all. Am I missing something here? 

Thanks in advance,
Geert-Jan 
-- 
View this message in context: 
http://www.nabble.com/T5%3A-how-to-let-subclass-decide-which-component-to-render-tf4820991.html#a13792436
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



T5: referencing embedded Component is null in onActivate(). What am I missing?

2007-11-14 Thread Britske

I've got a embedded component (a searchform) on a page. On page.onActivate()
I need to reference this embedded component (to set a couple of its
input-fields based on the url of the page). 
However, although the embedded component is correctly set-up in the page I
get a nullPointerException when I try to reference this component from 
page.onActivate(). 

What am I missing here? Perhaps an embedded component isn't bound yet on
onActivate? If so how to explictly bind it?

Thanks in advance,
Geert-Jan
-- 
View this message in context: 
http://www.nabble.com/T5%3A-referencing-embedded-Component-is-null-in-onActivate%28%29.-What-am-I-missing--tf4805943.html#a13749145
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: referencing embedded Component is null in onActivate(). What am I missing?

2007-11-14 Thread Britske

hmm, after quickly rebuilding the issue (I removed the component
,component-ref, etc) everything works..
well better than the other way around ;-)

Thanks anyway for the quick response,
Cheers,
Geert-Jan



Howard Lewis Ship wrote:
 
 Show us the code!  Also, check your console for warnings.
 
 On Nov 14, 2007 7:31 AM, Britske [EMAIL PROTECTED] wrote:

 I've got a embedded component (a searchform) on a page. On
 page.onActivate()
 I need to reference this embedded component (to set a couple of its
 input-fields based on the url of the page).
 However, although the embedded component is correctly set-up in the page
 I
 get a nullPointerException when I try to reference this component from
 page.onActivate().

 What am I missing here? Perhaps an embedded component isn't bound yet on
 onActivate? If so how to explictly bind it?

 Thanks in advance,
 Geert-Jan
 --
 View this message in context:
 http://www.nabble.com/T5%3A-referencing-embedded-Component-is-null-in-onActivate%28%29.-What-am-I-missing--tf4805943.html#a13749145
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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


 
 
 
 -- 
 Howard M. Lewis Ship
 Partner and Senior Architect at Feature50
 
 Creator Apache Tapestry and Apache HiveMind
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-referencing-embedded-Component-is-null-in-onActivate%28%29.-What-am-I-missing--tf4805943.html#a13754530
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



T5: datefield with custom configure howTO

2007-11-13 Thread Britske

I subclassed the DateField-component to MyDateField with the purpose to
overwrite the configure-method, since I need a custom method to go off when
I select a date in the calendar. 

I did the following  in MyDateField: (where onSelect1 is a function defined
in my page). 

protected void configure(JSONObject setup)
{
setup.put(onSelect, onSelect1);
super.configure(setup);
}

The problem is that the onSelect1-function is never called, although
according to
http://www.dynarch.com/demos/jscalendar/doc/html/reference.html#node_sec_2.3
this is the correct way of defining a callback function for the
onChange-event of the calendar. 

Also, Tapestry seems to generate the client-side code correctly to setup the
calendar: 

script type=text/javascript
!--
Event.observe(window, load, function() {
Tapestry.registerForm('form');
Calendar.setup({inputField:mydatefield,onSelect:onSelect1,ifFormat:%d-%m-%y,button:mydatefield:trigger});
Calendar.setup({inputField:mydatefield_0,onSelect:onSelect1,ifFormat:%d-%m-%y,button:mydatefield_0:trigger});
});
// --
/script

Anyone knows whats wrong with this? 

Thanks in advance 
Geert-Jan
-- 
View this message in context: 
http://www.nabble.com/T5%3A-datefield-with-custom-configure-howTO-tf4798573.html#a13728242
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: A component returning StreamResponse?

2007-11-04 Thread Britske

Not sure if you solved this already, but anyway:  
Regarding the exception you got: 


Borut Bolčina-2 wrote:
 
 then I get Exception:
 Component ui/dialog/JQModalAjax does not contain an embedded component
 with
 id 'wizardStep1'.
 
 which is true, as I don't have WizardStep1 in my ui/dialog/JQModalAjax.tml
 

As a workaround it's possible to define Wizarstep1 in a block in
JQModalAjax.tml, like so: 

t:block
t:WizardStep1 id=wizardstep1/
/t:block

Since the wizardstep component is included in the block it isn't rendered in
JQModalAjax.tml unless explicitly asked to do so. Now you should be able to
do what you wanted without exceptions.

Cheers,
Geert-Jan





Borut Bolčina-2 wrote:
 
 Hello,
 
 I would like to create an ajax dialog (actually a series of them to act as
 a
 wizard). The content of the dialog should change according to user
 interaction and therefore create a series of steps. If this wizard is
 going
 to have 3 steps then 3 ajax requests for dialog content would be made.
 
 I would like each ajax request to call (different) T5 component returning
 HTML fragment.
 
 I am using jQuery to make a request
 
 * TEMPLATE **
 script
 $().ready(function() {
   $('#ex2').jqm({ajax: '${thelink}'}).jqmShow();
 });
 /script
 
 * CLASS *
 public String getTheLink() {
 Link l = _resources.createActionLink(myAction, false);
 return l.toURI();
 }
 
 StreamResponse onMyAction() {
 String htmlFragment = pparagraph bold/p;
 return new TextStreamResponse(text/html, htmlFragment);
 }
 
 
 I would like the htmlFragment to be generated by T5 component for example
 WizardStep1.
 
 If I declare a component in the class above:
 @Component
 private WizardStep1 wizardStep1;
 
 and modify method onMyAction like this
 
 StreamResponse onMyAction() {
 wizardStep1.setMessage(hello);
 return (StreamResponse) wizardStep1;
 }
 
 then I get Exception:
 Component ui/dialog/JQModalAjax does not contain an embedded component
 with
 id 'wizardStep1'.
 
 which is true, as I don't have WizardStep1 in my ui/dialog/JQModalAjax.tml
 
 
 Any suggestions?
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-A-component-returning-StreamResponse--tf4600101.html#a13575865
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



T5: how to pass a component as a parameter? -- getting unbound errors

2007-10-30 Thread Britske

a quick background first: I'm creating a component which can display a 'list
of lists'. For flexibility I want to implement this as a composite-pattern
in which a CompositeFlexList-component can render one or more
FlexList-components as it's childs. (CompositeFlexList extends FlexList). 

This works well when I define the list-component as  @Component in the
CompositeFlexList-component. 

However for flexibility I need to extract the FlexList-component-definition
from the CompositeFlexList-component and define it in an enclosing page.
So want i want is this: 

page
|[EMAIL PROTECTED](..some config here.,childlist=childlist) 
CompositeFlexList
list; 
|[EMAIL PROTECTED](some config here) FlexList childlist;

Now CompositeFlexList has the following definition: 

@Parameter
private FlexList childlist; 
public FlexList getChildlist()  {return childlist;}


My problem/question: 
although component childlist is entirely defined in the enclosing page, and
this component is bound (???) to field childlist in the CompositeFlexList I
keep getting an unbound error, see below. 

Am I missing something, or is it impossible to pass a defined
component-instance as a parameter to another component? 

Thanks in advance,
Geert-Jan


/

Parameter(s) results are required for
com.wrappt.test.tap5springstry.components.FlexList, but have not been bound.

location
classpath:path_removed/CompositeFlexList.html, line 4, column 43
1   div class=${rowClass}
xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
2   t:body/
3   t:block t:id=childblock
4   div t:type=flexlist t:id=childlist
5   /div
6   /t:block
7   /div


-- 
View this message in context: 
http://www.nabble.com/T5%3A-how-to-pass-a-component-as-a-parameter%3E-getting-unbound-errors-tf4721073.html#a13497068
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



[T5]: how to prevent onActivate() from firing with activationcontext

2007-10-24 Thread Britske

for a page, I have two activation-methods:

onActivate()
onActivate(Object[] list);

when i provide an activation context to the page both methods are called
-onactivate() first-.
This seems correct behavior according to some forum-posts i've read. 

However, both methods call a method syncLists() which does a pretty
expensive operation (get search results  based on the activation context or
default if no activation context exists). 

The problem is that now syncLists() is called twice when the page has an
activation-context (based on calling both of the onActivate()-methods).
Obviously this is unwanted. 

However, I can't remove syncLists() from onActivate() (without params),
because a page-access without activation-context should call syncLists() as
well. 

so what i need to do is 
a. have onActivate() not called when an activatecontext exists
b. detect in onActivate() that an activationcontext exists and based on that
not call syncLists(). 
c. don't have syncLists() updated on onActivate() but on a change of the
page (so before the redirect-after-post) 

I can't find a way to do A. or B. while C. doesn't seem the best option,
because a lot of fields (on the page and in components) would need to be
tagged with @Persist to survive setting them on post and then redirecting. 

Anyone?

Thanks,
Geert-Jan
-- 
View this message in context: 
http://www.nabble.com/-T5-%3A-how-to-prevent-onActivate%28%29-from-firing-with-activationcontext-tf4683298.html#a13382460
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]: how to prevent onActivate() from firing with activationcontext

2007-10-24 Thread Britske

Thanks, removed the onActivate() without params. 

Moreover, i didn't test fully and discovered that on a post onActivate is
called once with the context of the old page and once with the context of
the new page, so it's not always empty the first time. Probably saying the
obvious but anyway..  Only in the latter case should the onActivate result
in update of my lists. 

for that i have the following to track the current activation-context 

@Persist Object[] params;  

now i do: 

onActivate(Object[] list)
{
  if(params!=list) //actually a method doing a compare on the elements of
the list
 {
   //handle context
   params = list;
 }
} 

thanks for helping me in the right direction,
Geert-Jan



Nick Westgate wrote:
 
 I'm not going to delve into the logic of your use case.
 Just put have one activate handler:
 
 void onActivate(Object[] context)
 {
  if (context.length == 0)
  {
  // handle no context
  {
  else
  {
  // handle context
  {
 }
 
 Cheers,
 Nick.
 
 
 Britske wrote:
 for a page, I have two activation-methods:
 
 onActivate()
 onActivate(Object[] list);
 
 when i provide an activation context to the page both methods are called
 -onactivate() first-.
 This seems correct behavior according to some forum-posts i've read. 
 
 However, both methods call a method syncLists() which does a pretty
 expensive operation (get search results  based on the activation context
 or
 default if no activation context exists). 
 
 The problem is that now syncLists() is called twice when the page has an
 activation-context (based on calling both of the onActivate()-methods).
 Obviously this is unwanted. 
 
 However, I can't remove syncLists() from onActivate() (without params),
 because a page-access without activation-context should call syncLists()
 as
 well. 
 
 so what i need to do is 
 a. have onActivate() not called when an activatecontext exists
 b. detect in onActivate() that an activationcontext exists and based on
 that
 not call syncLists(). 
 c. don't have syncLists() updated on onActivate() but on a change of the
 page (so before the redirect-after-post) 
 
 I can't find a way to do A. or B. while C. doesn't seem the best option,
 because a lot of fields (on the page and in components) would need to be
 tagged with @Persist to survive setting them on post and then
 redirecting. 
 
 Anyone?
 
 Thanks,
 Geert-Jan
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-T5-%3A-how-to-prevent-onActivate%28%29-from-firing-with-activationcontext-tf4683298.html#a13384950
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



T5: how to let pojo (no component) have reference to PropertyAccess

2007-10-23 Thread Britske

I have a helperclass SelectModelRepository which centralizes logic concerning
selectmodels which different pages/ components can access. This class needs
a reference to PropertyAccess to do some of its work, which normally is
available as: 

@Inject PropertyAccess _access.

However, this only works on components and not ordinary pojo's like the one
described above (i know... components are pojo's too ;-)

I tried passing the PropertyAccess-instance from a component to the
SelectModelRepository, but that didn't work because the
PropertyAccess-instance is only seen as a proxy since the JustInTimeCreator
proxies the class until it is needed. This all results in
NullPointer-exceptions when referencing the PropertyAccess-instance form the
SelectModelRepository. 

Is there any way to get a valid reference to the PropertyAccess-instance
from my 
SelectModelRepository-instance? 

The SelectModelRepository-instance is a singleton, so of course it could be
injected through Tapestry-ioc, although i havn't tried  tapestry-ioc yet at
all though. The trouble is that now it is configured as a Spring-IOC
instance with a whole chain of spring-ioc-references to build it. So
transferring it to Tapestry-ioc gets a bit messy i guess. If no other
solution exists, could you show a simple example of where (what file) and
how to configure the SelectModelRepository-instance as Tapestry-ioc service, 

thanks,
Geert-Jan
-- 
View this message in context: 
http://www.nabble.com/T5%3A-how-to-let-pojo-%28no-component%29-have-reference-to-PropertyAccess-tf4676141.html#a13360247
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: how to let pojo (no component) have reference to PropertyAccess

2007-10-23 Thread Britske

Never mind.
I thought it would be difficult to define SelectModelRepository in
Tapestry-IOC given the existing spring-ioc chain it needs for construction.
I didn't realize injecting spring-instances in the build()-method of
Tapestry-IOC works just as good as normally in components.. and i love it
;-)



Britske wrote:
 
 I have a helperclass SelectModelRepository which centralizes logic
 concerning selectmodels which different pages/ components can access. This
 class needs a reference to PropertyAccess to do some of its work, which
 normally is available as: 
 
 @Inject PropertyAccess _access.
 
 However, this only works on components and not ordinary pojo's like the
 one described above (i know... components are pojo's too ;-)
 
 I tried passing the PropertyAccess-instance from a component to the
 SelectModelRepository, but that didn't work because the
 PropertyAccess-instance is only seen as a proxy since the
 JustInTimeCreator proxies the class until it is needed. This all results
 in NullPointer-exceptions when referencing the PropertyAccess-instance
 form the SelectModelRepository. 
 
 Is there any way to get a valid reference to the PropertyAccess-instance
 from my 
 SelectModelRepository-instance? 
 
 The SelectModelRepository-instance is a singleton, so of course it could
 be injected through Tapestry-ioc, although i havn't tried  tapestry-ioc
 yet at all though. The trouble is that now it is configured as a
 Spring-IOC instance with a whole chain of spring-ioc-references to build
 it. So transferring it to Tapestry-ioc gets a bit messy i guess. If no
 other solution exists, could you show a simple example of where (what
 file) and how to configure the SelectModelRepository-instance as
 Tapestry-ioc service, 
 
 thanks,
 Geert-Jan
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-how-to-let-pojo-%28no-component%29-have-reference-to-PropertyAccess-tf4676141.html#a13360773
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: how to have persistent data in querystring?

2007-10-19 Thread Britske

Well i guess the onPassivate-method isn't entirely out of the question since
it gives a central place to handle this on the page-level as well. The
tagging-variant seems nicer though. I thought i read somewhere in the
documentation that a 'client-side persistence strategy' was on the horizon,
which would include 'automagically' inserting persistent fields into the
url. I can't find anymore where i've read it though. 

Since we're talking about updating / changing the url, in a somehwat related
post i asked about possibilities for rewriting the url. (I havn't found time
to try to resolve this) 
http://www.nabble.com/url-rewriting-in-Tapestry-5-tf4496726.html#a12823397

from that post: 

For example I want a Venue bean with name venueX and id=123 to show up as:
http://test.com/venue/countryname/cityname/venux/123

Notice the countryname and cityname, which aren't fields of the Venue-page
but are derived from the association venue-page-- venue-- city --
country. 

I think adapting the onPassivate-method for inserting these values into the
url and onActivate() for only parsing the necessary fields from this url is
all that is needed to get this to work, is this correct? 
btw: a Url-rwrite filtr for this won't work because i also want to have the
translation the other way around.: not only from nice -- tapestry internal
but also from tapestry internal -- nice. Url-rewrite only gives me the
former. 

Later on i would like to strip the first /venue/  --
http://test.com/venue/countryname/cityname/venux/123 would become
http://test.com/countryname/cityname/venux/123. 

This becomes harder, because tapestry now doesn't know anymore to which page
to redirect. out-of-the-box it starts searching for a page with
countryname. I guess for this I have to dig a little deeper. 

Hmm, in hindsight i believe this isn't at all a coherent post, with almost
no question or conclusion to be found... consider this a kind of braindump
;-)

cheers,
Geert-Jan




  



Josh Canfield-2 wrote:
 
 Ok, and you want to do this without implementing a passivate method on
 page
 B...
 
 That doesn't seem like a trivial problem to solve, especially in a safe
 and
 general way. I'm pretty sure nothing like that exists now, but I believe
 all
 the hooks are available to create your own annotations so you could do the
 implementation. If I were going to attempt this I'd start by looking at
 adding new activate/passivate methods via the class transform worker...
 
 There are a lot of issues to deal with... but you could start by taking a
 look at
 http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/services/ComponentClassTransformWorker.html
 
 and the source for the @Environmental annotation might help
 http://tapestry.apache.org/tapestry5/apidocs/src-html/org/apache/tapestry/internal/services/EnvironmentalWorker.html
 
 Good luck,
 Josh
 
 
 On 10/18/07, Britske [EMAIL PROTECTED] wrote:


 that would require a lot of manual labor for each and every link.

 btw: my question relates to T5.

 Say i had page B injected into page A.
 I could then initialize page B and return page B from some eventhandler
 on
 page A.
 What I would want to accomplish is that this automatically results in
 redirecting to page B (as normal) with the difference that the url of
 page
 B
 shows my predefined fields of page B in the url (I know I mentioned
 querystring in the subjectheader, i mean the path-part of the url)

 The mechanism could know this because at designtime I could have tagged
 the
 fields of page B that I wanted to include in the url. This would enable
 me
 to once define these fields at design-time and not having to worry about
 it
 later on.

 is anything like this out there, or planned at all?

 Thanks in advance,
 Geert-Jan


 Josh Canfield-2 wrote:
 
  If you want to parameters to the query string then you can create a
 link
  and
  add parameters to it from within your page.
 
 
 http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/Link.html
 
 
  Josh
 
  On 10/18/07, Britske [EMAIL PROTECTED] wrote:
 
 
  okay, I like peristent data very much. On the other hand I want to
 have
  pages
  in which several persistent properties are encoded into the
 querystring
  (for
  better bookmarking and other requirements from a user-perspective).
 
  so my question is:
  is there a way to encode / decode certain persistent properties into
 the
  querystring? The best would be a way without having to change the
  onActivate
  and onPassivate-methods of course...
 
  Thanks in advance,
  Geert-Jan
  --
  View this message in context:
 
 http://www.nabble.com/how-to-have-persistent-data-in-querystring--tf4646238.html#a13272192
  Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  --
  --
  TheDailyTube.com. Sign up and get the best new videos

Re: t5 form submit not fired

2007-10-19 Thread Britske

ok that explains a few things ;-)
thanks for clearing that up. 

Nick Westgate wrote:
 
 Hugo defined myAction as returning a StreamResponse - no redirect.
 Geert-Jan says myAction returns void - a redirect occurs.
 
 Cheers,
 Nick.
 
 
 Hugo Palma wrote:
 If your getting a page redirect then your doing something wrong in your 
 code.
 If you post it i can try and find the problem.
 
 Britske wrote:
 after the onchange occurs, this is what happens in my app:
 1. onMyAction is executed()  (this is an actionlink which returns
 nothing
 (void) which results in a client-side redirect to the same page (as 
 per documentation:
 http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html )

 2. onActivate() is executed on the server, which I think proofs that 
 there
 was indeed a redirect.
 please don't get me wrong, I still think it's an elegant solution...

 //Geert-Jan


 HugoPalma wrote:
  
 Why do you say a redirect happens ? Does your page refresh when you 
 change the selectbox value ?
 It won't refresh because all your doing is call a javascript 
 function. There's no redirect.

 Britske wrote:

 since your example effectively calls a ActionLink through AJAX, a
 redirect
 DOES happen. It's the result of the ActionLink. If I'm seeing this
 correctly
 what then is the advantage of doing a call through AJAX or a
 form.submit()
 for the discussed purpose, since both result in a redirect?

 //Geert-Jan



 HugoPalma wrote:

 The method i suggested is implemented so that you don't have to 
 submit the form. That's what AJAX is all about, you make a request 
 to the server and then update a portion of your page based on the 
 response from the server using javascript. There's no page reload 
 of for submission.

 Britske wrote:

 yeah indeed it is only called once when the template is rendered, I
 discovered now. However i don't need to return a dynamic url or 
 whatever based on the
 getTheLink-method.
 what I need is a way to reliably catch a event at the server/java 
 side
 (in
 this case onChange) every time that event occurs. I don't want to
 submit
 my
 form when that happens (otherwise I could use the method you 
 suggested)
 but
 I want to update some information on the current page and stay
 there.
 This means that i have to redirect to my currentpage with a couple
 of
 queryparameters in the url which depend on the selected fields in
 the
 form.
 hmm, the more i think about it, I don't think i really need to catch
 the
 event server-side. I just redirect to the current page on onChange
 using
 javascript:window.location=... and parse the querystrings 
 correctly in
 it.
 hope this makes sense, thanks!
 Geert-Jan



 HugoPalma wrote:
  
 That's the way it's supposed to be.
 You only see the getTheLink method executed once because that 
 what it need to replace ${theLink} in your template with the 
 correct link that is returned from your method. This is done once 
 when the page renders. If you look at the rendered page source 
 you won't see ${theLink}
 there, instead you will the the generated link to your listener.

 Anyway, does it really matter how many times the getTheLink 
 method is invoked ? I think not.  What really matters is that the 
 listener
 method to which your getTheLink method should be returning the 
 URL to is
 called whenever you call the sendRequest function.


 Britske wrote:

 thanks that works partially.
 However, the event is only catched twice: 1. on pageload (??m 
 the sendRequest isn't called, but somehow the
 getTheLink()-method is executed.)
 2. the first time i send a onchange.
 However after the first onchange all other onchange-event don't
 get
 getTheLink() executed, although sendRequest() is called on the
 client-side
 each time.
 This is my relevant code:
 in  html: script
 function sendRequest() {
 alert(sendRequest reached);
 new Ajax.Request('${theLink}',
 {asynchronous:true,onSuccess:handleResponse});
 } /script
 ...
 select t:type=select t:model=themaList t:value=thema
 onchange=sendRequest() name=thema id=thema tabindex=4 
 class=formElement/

 in the page-class: public String getTheLink() {
 System.out.println(catched!!);
 return catched!;
 }
 Do you 've got any idea what causes this behavior?
 Thanks,
 Geert-Jan




 HugoPalma wrote:

 I would suggest that you use AJAX instead of doing the form 
 submit. Although the AJAX integration in T5 is still not 
 implemented it's
 very easy to do using the provided prototype and json 
 javascripts. I did
 this successfully for some simple events also.
 Shortly, here's how i did it:

 In my page i have these two javascript functions:

 function handleResponse(xhrResponse) {
 var json = xhrResponse.responseText.evalJSON(true);

 //Do whatever you want with the server response
 }
 // --

 function sendRequest() {
 new

Re: t5 form submit not fired

2007-10-19 Thread Britske

thanks for mentioning the difference. In my case a dropdown-change causes a
result-set to reload based on a new query which is shown as the main result
on the page. Since this almost means rendering the entire page again, there
isn't much difference between streaming the diference as Json or whatever or
doing a complete reload. However ,i'm the first to admit that to do things
as populating dropdown boxes (autocomplete or whatever) or changing a
fraction of the page, AJAX is the way to go. 

Thanks again,
Geert-Jan 


Josh Canfield-2 wrote:
 
 The whole point of AJAX is not having to return the whole page. You just
 want to return the part of the page that needs updating. If selecting a
 field in a drop down is supposed to add a dependant drop down (choose a
 country changes possible address fields for instance), then you only
 return
 enough information for that field to be updated and use Javascript to
 populate the field.
 
 Your stream response can be XML, JSON, or HTML depending on what your
 needs
 are...
 
 Josh
 
 
 On 10/18/07, Britske [EMAIL PROTECTED] wrote:


 A changes your method somehwat to return void -- redirect to current
 page
 (Thanks Nick for mentioning the difference)

 Could you eleborate what exactly you stream to the client in the
 StreamReponse you give back?
 This must be the entire page right? You can't just stream changes back to
 the client at least to my knowledge.

 I'm curious if in your opinion streaming the response gives a noticable
 performance difference than doing a redirect to the same page.
 //Geert-Jan


 HugoPalma wrote:
 
  If your getting a page redirect then your doing something wrong in your
  code.
  If you post it i can try and find the problem.
 
  Britske wrote:
  after the onchange occurs, this is what happens in my app:
 
  1. onMyAction is executed()  (this is an actionlink which returns
 nothing
  (void) which results in a client-side redirect to the same page
  (as per documentation:
  http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html
 )
 
  2. onActivate() is executed on the server, which I think proofs that
  there
  was indeed a redirect.
 
  please don't get me wrong, I still think it's an elegant solution...
 
  //Geert-Jan
 
 
  HugoPalma wrote:
 
  Why do you say a redirect happens ? Does your page refresh when you
  change the selectbox value ?
  It won't refresh because all your doing is call a javascript
 function.
  There's no redirect.
 
  Britske wrote:
 
  since your example effectively calls a ActionLink through AJAX, a
  redirect
  DOES happen. It's the result of the ActionLink. If I'm seeing this
  correctly
  what then is the advantage of doing a call through AJAX or a
  form.submit()
  for the discussed purpose, since both result in a redirect?
 
  //Geert-Jan
 
 
 
  HugoPalma wrote:
 
 
  The method i suggested is implemented so that you don't have to
 submit
  the form. That's what AJAX is all about, you make a request to the
  server and then update a portion of your page based on the response
  from
  the server using javascript. There's no page reload of for
 submission.
 
  Britske wrote:
 
 
  yeah indeed it is only called once when the template is rendered,
 I
  discovered now.
  However i don't need to return a dynamic url or whatever based on
 the
  getTheLink-method.
 
  what I need is a way to reliably catch a event at the server/java
  side
  (in
  this case onChange) every time that event occurs. I don't want to
  submit
  my
  form when that happens (otherwise I could use the method you
  suggested)
  but
  I want to update some information on the current page and stay
 there.
 
  This means that i have to redirect to my currentpage with a couple
 of
  queryparameters in the url which depend on the selected fields in
 the
  form.
 
  hmm, the more i think about it, I don't think i really need to
 catch
  the
  event server-side. I just redirect to the current page on onChange
  using
  javascript:window.location=... and parse the querystrings
 correctly
  in
  it.
 
  hope this makes sense,
  thanks!
  Geert-Jan
 
 
 
  HugoPalma wrote:
 
 
 
  That's the way it's supposed to be.
  You only see the getTheLink method executed once because that
 what
  it
  need to replace ${theLink} in your template with the correct link
  that
  is returned from your method. This is done once when the page
  renders.
  If you look at the rendered page source you won't see ${theLink}
  there,
  instead you will the the generated link to your listener.
 
  Anyway, does it really matter how many times the getTheLink
 method
  is
  invoked ? I think not.  What really matters is that the listener
  method
  to which your getTheLink method should be returning the URL to is
  called
  whenever you call the sendRequest function.
 
 
  Britske wrote:
 
 
 
  thanks that works partially.
 
  However, the event is only catched twice:
  1. on pageload (??m the sendRequest isn't called, but somehow
 the
  getTheLink()-method

Re: how to have persistent data in querystring?

2007-10-19 Thread Britske

your welcome;-)
i have a look it myself.



Josh Canfield-2 wrote:
 
 I haven't played with the client persistence strategy, but the
 documentation
 (
 http://tapestry.formos.com/nightly/tapestry5/tapestry-core/guide/persist.html)
 says The field is persisted onto the client; you will see an additional
 query parameter in each URL (or an extra hidden field in each form).
 
 The nightly builds implementation is adding the client persisted fields
 into
 the url as a query parameter using a Base 64 encoded object stream... (
 http://tapestry.formos.com/nightly/tapestry5/apidocs/src-html/org/apache/tapestry/internal/services/ClientPersistentFieldStorageImpl.html#line.41
 )
 
 If you want attractive URLs then I'd say this isn't what you are looking
 for... Although I got to learn a bit about it so thanks for asking the
 question :)
 
 Josh
 
 On 10/19/07, Britske [EMAIL PROTECTED] wrote:


 Well i guess the onPassivate-method isn't entirely out of the question
 since
 it gives a central place to handle this on the page-level as well. The
 tagging-variant seems nicer though. I thought i read somewhere in the
 documentation that a 'client-side persistence strategy' was on the
 horizon,
 which would include 'automagically' inserting persistent fields into the
 url. I can't find anymore where i've read it though.

 Since we're talking about updating / changing the url, in a somehwat
 related
 post i asked about possibilities for rewriting the url. (I havn't found
 time
 to try to resolve this)
 http://www.nabble.com/url-rewriting-in-Tapestry-5-tf4496726.html#a12823397

 from that post:

 For example I want a Venue bean with name venueX and id=123 to show up
 as:
 http://test.com/venue/countryname/cityname/venux/123

 Notice the countryname and cityname, which aren't fields of the
 Venue-page
 but are derived from the association venue-page-- venue-- city --
 country.

 I think adapting the onPassivate-method for inserting these values into
 the
 url and onActivate() for only parsing the necessary fields from this url
 is
 all that is needed to get this to work, is this correct?
 btw: a Url-rwrite filtr for this won't work because i also want to have
 the
 translation the other way around.: not only from nice -- tapestry
 internal
 but also from tapestry internal -- nice. Url-rewrite only gives me the
 former.

 Later on i would like to strip the first /venue/  --
 http://test.com/venue/countryname/cityname/venux/123 would become
 http://test.com/countryname/cityname/venux/123.

 This becomes harder, because tapestry now doesn't know anymore to which
 page
 to redirect. out-of-the-box it starts searching for a page with
 countryname. I guess for this I have to dig a little deeper.

 Hmm, in hindsight i believe this isn't at all a coherent post, with
 almost
 no question or conclusion to be found... consider this a kind of
 braindump
 ;-)

 cheers,
 Geert-Jan








 Josh Canfield-2 wrote:
 
  Ok, and you want to do this without implementing a passivate method on
  page
  B...
 
  That doesn't seem like a trivial problem to solve, especially in a safe
  and
  general way. I'm pretty sure nothing like that exists now, but I
 believe
  all
  the hooks are available to create your own annotations so you could do
 the
  implementation. If I were going to attempt this I'd start by looking at
  adding new activate/passivate methods via the class transform worker...
 
  There are a lot of issues to deal with... but you could start by taking
 a
  look at
 
 http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/services/ComponentClassTransformWorker.html
 
  and the source for the @Environmental annotation might help
 
 http://tapestry.apache.org/tapestry5/apidocs/src-html/org/apache/tapestry/internal/services/EnvironmentalWorker.html
 
  Good luck,
  Josh
 
 
  On 10/18/07, Britske [EMAIL PROTECTED] wrote:
 
 
  that would require a lot of manual labor for each and every link.
 
  btw: my question relates to T5.
 
  Say i had page B injected into page A.
  I could then initialize page B and return page B from some
 eventhandler
  on
  page A.
  What I would want to accomplish is that this automatically results in
  redirecting to page B (as normal) with the difference that the url of
  page
  B
  shows my predefined fields of page B in the url (I know I mentioned
  querystring in the subjectheader, i mean the path-part of the url)
 
  The mechanism could know this because at designtime I could have
 tagged
  the
  fields of page B that I wanted to include in the url. This would
 enable
  me
  to once define these fields at design-time and not having to worry
 about
  it
  later on.
 
  is anything like this out there, or planned at all?
 
  Thanks in advance,
  Geert-Jan
 
 
  Josh Canfield-2 wrote:
  
   If you want to parameters to the query string then you can create a
  link
   and
   add parameters to it from within your page.
  
  
 
 http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry

Re: template-expansion sees hibernate-entity as java.lang.Boolean?

2007-10-19 Thread Britske

Has anyone ever experienced something similar? or has anyone used hibernate
lazy-associations succesfully with expansions in T5? 

I'm still not sure if it's a hibernate or a tapestry thing. 

FYI; the error is happening in: 
org.apache.tapestry.internal.services.PropertyConduitSourceImpl.readMethodForTerm(PropertyConduitSourceImpl.java:370)

and states: 
Could not convert 'firstresult.poi.city.name' into a component parameter
binding: Class java.lang.Boolean does not contain a property named 'name'
(within property expression 'firstresult.poi.city.name'). 

//Geert-Jan


Britske wrote:
 
 first of all, excuse me for the post-flood, but I had some standing
 issues. Perhaps some of these questions can help others as well so here
 this one goes:
 
 I was on a roll until i wanted to include the name of a City-instance
 through a template expansion, which gave the error: 
 
 Could not convert 'firstresult.poi.city.name' into a component parameter
 binding: Class java.lang.Boolean does not contain a property named 'name'
 (within property expression 'firstresult.poi.city.name'). 
 
 However, city is of type City and not op type java.lang.Boolean!
 
 The traversal goes through a POI and a City-class which are both mapped as
 hibernate-entities. 
 the traversal poi.getCity() is a lazy association. 
 
 (for you hibernate gurus: 
@ManyToOne(fetch = FetchType.LAZY) 
   @JoinColumn(name=cityid, nullable=false)
   @Cache(usage =
 org.hibernate.annotations.CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
   private City city;
 
 my expansion looks like:: 
 
 t:compositeBlockList t:id=comp1
   t:parameter name=groupheader
   div style=padding:5px
   strong
   ${firstresult.poi.city.name}
   /strong
   /div
   /t:parameter 
 /t:compositeBlockList
 
 What is causing this error? Could the hibernate-entity City look like a
 boolean (when reflection is used) before it is lazily fetched?? I can't
 really imagine that but who knows? anyone?
 
 thanks, 
 Geert-Jan
 
 
 

-- 
View this message in context: 
http://www.nabble.com/template-expansion-sees-hibernate-entity-as-java.lang.Boolean--tf4646244.html#a13289365
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 form submit not fired

2007-10-19 Thread Britske

A changes your method somehwat to return void -- redirect to current page
(Thanks Nick for mentioning the difference)

Could you eleborate what exactly you stream to the client in the
StreamReponse you give back? 
This must be the entire page right? You can't just stream changes back to
the client at least to my knowledge. 

I'm curious if in your opinion streaming the response gives a noticable
performance difference than doing a redirect to the same page. 
//Geert-Jan


HugoPalma wrote:
 
 If your getting a page redirect then your doing something wrong in your 
 code.
 If you post it i can try and find the problem.
 
 Britske wrote:
 after the onchange occurs, this is what happens in my app: 

 1. onMyAction is executed()  (this is an actionlink which returns nothing
 (void) which results in a client-side redirect to the same page 
 (as per documentation:
 http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html )

 2. onActivate() is executed on the server, which I think proofs that
 there
 was indeed a redirect. 

 please don't get me wrong, I still think it's an elegant solution...

 //Geert-Jan


 HugoPalma wrote:
   
 Why do you say a redirect happens ? Does your page refresh when you 
 change the selectbox value ?
 It won't refresh because all your doing is call a javascript function. 
 There's no redirect.

 Britske wrote:
 
 since your example effectively calls a ActionLink through AJAX, a
 redirect
 DOES happen. It's the result of the ActionLink. If I'm seeing this
 correctly
 what then is the advantage of doing a call through AJAX or a
 form.submit()
 for the discussed purpose, since both result in a redirect?

 //Geert-Jan



 HugoPalma wrote:
   
   
 The method i suggested is implemented so that you don't have to submit 
 the form. That's what AJAX is all about, you make a request to the 
 server and then update a portion of your page based on the response
 from 
 the server using javascript. There's no page reload of for submission.

 Britske wrote:
 
 
 yeah indeed it is only called once when the template is rendered, I
 discovered now. 
 However i don't need to return a dynamic url or whatever based on the
 getTheLink-method. 

 what I need is a way to reliably catch a event at the server/java
 side
 (in
 this case onChange) every time that event occurs. I don't want to
 submit
 my
 form when that happens (otherwise I could use the method you
 suggested)
 but
 I want to update some information on the current page and stay there. 

 This means that i have to redirect to my currentpage with a couple of
 queryparameters in the url which depend on the selected fields in the
 form. 

 hmm, the more i think about it, I don't think i really need to catch
 the
 event server-side. I just redirect to the current page on onChange
 using
 javascript:window.location=... and parse the querystrings correctly
 in
 it. 

 hope this makes sense, 
 thanks!
 Geert-Jan



 HugoPalma wrote:
   
   
   
 That's the way it's supposed to be.
 You only see the getTheLink method executed once because that what
 it 
 need to replace ${theLink} in your template with the correct link
 that 
 is returned from your method. This is done once when the page
 renders. 
 If you look at the rendered page source you won't see ${theLink}
 there, 
 instead you will the the generated link to your listener.

 Anyway, does it really matter how many times the getTheLink method
 is 
 invoked ? I think not.  What really matters is that the listener
 method 
 to which your getTheLink method should be returning the URL to is
 called 
 whenever you call the sendRequest function.


 Britske wrote:
 
 
 
 thanks that works partially. 

 However, the event is only catched twice: 
 1. on pageload (??m the sendRequest isn't called, but somehow the
 getTheLink()-method is executed.)
 2. the first time i send a onchange. 

 However after the first onchange all other onchange-event don't get
 getTheLink() executed, although sendRequest() is called on the
 client-side
 each time. 

 This is my relevant code: 

 in  html: 
 script
 function sendRequest() 
 {
alert(sendRequest reached);
new Ajax.Request('${theLink}',
 {asynchronous:true,onSuccess:handleResponse});
 } 
 /script
 ...
 select t:type=select t:model=themaList t:value=thema
 onchange=sendRequest() name=thema id=thema tabindex=4 
 class=formElement/

 in the page-class: 
public String getTheLink() 
{
System.out.println(catched!!);
return catched!;
} 

 Do you 've got any idea what causes this behavior? 

 Thanks,
 Geert-Jan




 HugoPalma wrote:
   
   
   
   
 I would suggest that you use AJAX instead of doing the form
 submit. 
 Although the AJAX integration in T5 is still not implemented it's
 very 
 easy to do using the provided prototype and json javascripts. I
 did
 this 
 successfully for some simple events

RE: T5: how to insert string including markup to template (2nd try)

2007-10-18 Thread Britske

 wonder how I missed that one ;-)
thanks!


Jonathan Barker wrote:
 
 Use the OutputRaw component.
 
 -Original Message-
 From: Britske [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, October 17, 2007 12:16 PM
 To: users@tapestry.apache.org
 Subject: T5: how to insert string including markup to template (2nd try)
 
 
 accidently submitted my first blank post so here it goes again:
 
 i have a variable for example:
 String text = strongsome text here/strong;
 
 In my template in want to insert it:
 ${text}
 
 however the html-tags get encoded as text, so the marktup doesn't show.
 So, is there a way to insert text including markup?
 
 thanks ,
 Geert-Jan
 --
 View this message in context: http://www.nabble.com/T5%3A-how-to-insert-
 string-including-markup-to-template-%282nd-try%29-tf4641214.html#a13255820
 Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-how-to-insert-string-including-markup-to-template-%282nd-try%29-tf4641214.html#a13269084
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



t5 form submit not fired

2007-10-18 Thread Britske

I have a use-case in which i need to catch a onchange of of select-component
on the server-side. 
The only way I know how to do that is do a javascript
onchange='this.form.submit()' and catch the onsubmit() event on the
serverside.

This works well when i don't have a submit-component in the form as well. 
However, when I do have a submit the onchange doesn't give a onsubmit() on
the serverside anymore. 

So, the onchange in the following snippet doesn't give a server side
onsubmit()-event:

body
form t:type=form t:id=form id=form
select t:type=select t:model=countryList t:value=country
onchange=this.form.submit();/
input t:type=Submit value=All results/
/form
/body

However, the following does:

body
form t:type=form t:id=form id=form
select t:type=select t:model=countryList t:value=country
onchange=this.form.submit();/
!--input t:type=Submit value=All results/--
/form
/body

This isn't expected behavior since both examples do work with plain html
form elements. 
anyone?

Geert-Jan
-- 
View this message in context: 
http://www.nabble.com/t5-form-submit-not-fired-tf4645307.html#a13269213
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 form submit not fired

2007-10-18 Thread Britske

thanks that works partially. 

However, the event is only catched twice: 
1. on pageload (??m the sendRequest isn't called, but somehow the
getTheLink()-method is executed.)
2. the first time i send a onchange. 

However after the first onchange all other onchange-event don't get
getTheLink() executed, although sendRequest() is called on the client-side
each time. 

This is my relevant code: 

in  html: 
script
function sendRequest() 
{
alert(sendRequest reached);
new Ajax.Request('${theLink}',
{asynchronous:true,onSuccess:handleResponse});
} 
/script
...
select t:type=select t:model=themaList t:value=thema
onchange=sendRequest() name=thema id=thema tabindex=4 
class=formElement/

in the page-class: 
public String getTheLink() 
{
System.out.println(catched!!);
return catched!;
} 

Do you 've got any idea what causes this behavior? 

Thanks,
Geert-Jan




HugoPalma wrote:
 
 I would suggest that you use AJAX instead of doing the form submit. 
 Although the AJAX integration in T5 is still not implemented it's very 
 easy to do using the provided prototype and json javascripts. I did this 
 successfully for some simple events also.
 Shortly, here's how i did it:
 
 In my page i have these two javascript functions:
 
 function handleResponse(xhrResponse) {
 var json = xhrResponse.responseText.evalJSON(true);
 
 //Do whatever you want with the server response
 }
 // --
 
 function sendRequest() {
 new Ajax.Request('${theLink}', {asynchronous:true, 
 onSuccess:handleResponse});
 }
 
 On the page class i have:
 
 public String getTheLink() {
 Link l = _resources.createActionLink(myAction, false);
 return l.toURI();
 }
 
 public StreamResponse onMyAction() {
 CollectionCasta castas =
 _regiaoDao.getRegiao(regiao).getCastas();
 
 JSONObject jsonObject = new JSONObject();
   // Add whatever info you want to send to the client
 
 return new TextStreamResponse(text/xml, jsonObject.toString());
 }
 
 And that's it. Works great. All you have to do now is call the 
 sendRequest function from whatever javascript event you want to catch.
 Hope this helps.
 
 Britske wrote:
 I have a use-case in which i need to catch a onchange of of
 select-component
 on the server-side. 
 The only way I know how to do that is do a javascript
 onchange='this.form.submit()' and catch the onsubmit() event on the
 serverside.

 This works well when i don't have a submit-component in the form as well. 
 However, when I do have a submit the onchange doesn't give a onsubmit()
 on
 the serverside anymore. 

 So, the onchange in the following snippet doesn't give a server side
 onsubmit()-event:

 body
 form t:type=form t:id=form id=form
  select t:type=select t:model=countryList t:value=country
 onchange=this.form.submit();/
 input t:type=Submit value=All results/
 /form
 /body

 However, the following does:

 body
 form t:type=form t:id=form id=form
  select t:type=select t:model=countryList t:value=country
 onchange=this.form.submit();/
 !--input t:type=Submit value=All results/--
 /form
 /body

 This isn't expected behavior since both examples do work with plain html
 form elements. 
 anyone?

 Geert-Jan
   
 
 

-- 
View this message in context: 
http://www.nabble.com/t5-form-submit-not-fired-tf4645307.html#a13271036
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 form submit not fired

2007-10-18 Thread Britske

yeah indeed it is only called once when the template is rendered, I
discovered now. 
However i don't need to return a dynamic url or whatever based on the
getTheLink-method. 

what I need is a way to reliably catch a event at the server/java side (in
this case onChange) every time that event occurs. I don't want to submit my
form when that happens (otherwise I could use the method you suggested) but
I want to update some information on the current page and stay there. 

This means that i have to redirect to my currentpage with a couple of
queryparameters in the url which depend on the selected fields in the form. 

hmm, the more i think about it, I don't think i really need to catch the
event server-side. I just redirect to the current page on onChange using
javascript:window.location=... and parse the querystrings correctly in it. 

hope this makes sense, 
thanks!
Geert-Jan



HugoPalma wrote:
 
 That's the way it's supposed to be.
 You only see the getTheLink method executed once because that what it 
 need to replace ${theLink} in your template with the correct link that 
 is returned from your method. This is done once when the page renders. 
 If you look at the rendered page source you won't see ${theLink} there, 
 instead you will the the generated link to your listener.
 
 Anyway, does it really matter how many times the getTheLink method is 
 invoked ? I think not.  What really matters is that the listener method 
 to which your getTheLink method should be returning the URL to is called 
 whenever you call the sendRequest function.
 
 
 Britske wrote:
 thanks that works partially. 

 However, the event is only catched twice: 
 1. on pageload (??m the sendRequest isn't called, but somehow the
 getTheLink()-method is executed.)
 2. the first time i send a onchange. 

 However after the first onchange all other onchange-event don't get
 getTheLink() executed, although sendRequest() is called on the
 client-side
 each time. 

 This is my relevant code: 

 in  html: 
 script
 function sendRequest() 
 {
  alert(sendRequest reached);
  new Ajax.Request('${theLink}',
 {asynchronous:true,onSuccess:handleResponse});
 } 
 /script
 ...
 select t:type=select t:model=themaList t:value=thema
 onchange=sendRequest() name=thema id=thema tabindex=4 
 class=formElement/

 in the page-class: 
  public String getTheLink() 
  {
  System.out.println(catched!!);
  return catched!;
  } 

 Do you 've got any idea what causes this behavior? 

 Thanks,
 Geert-Jan




 HugoPalma wrote:
   
 I would suggest that you use AJAX instead of doing the form submit. 
 Although the AJAX integration in T5 is still not implemented it's very 
 easy to do using the provided prototype and json javascripts. I did this 
 successfully for some simple events also.
 Shortly, here's how i did it:

 In my page i have these two javascript functions:

 function handleResponse(xhrResponse) {
 var json = xhrResponse.responseText.evalJSON(true);

 //Do whatever you want with the server response
 }
 // --

 function sendRequest() {
 new Ajax.Request('${theLink}', {asynchronous:true, 
 onSuccess:handleResponse});
 }

 On the page class i have:

 public String getTheLink() {
 Link l = _resources.createActionLink(myAction, false);
 return l.toURI();
 }

 public StreamResponse onMyAction() {
 CollectionCasta castas =
 _regiaoDao.getRegiao(regiao).getCastas();

 JSONObject jsonObject = new JSONObject();
   // Add whatever info you want to send to the client

 return new TextStreamResponse(text/xml,
 jsonObject.toString());
 }

 And that's it. Works great. All you have to do now is call the 
 sendRequest function from whatever javascript event you want to catch.
 Hope this helps.

 Britske wrote:
 
 I have a use-case in which i need to catch a onchange of of
 select-component
 on the server-side. 
 The only way I know how to do that is do a javascript
 onchange='this.form.submit()' and catch the onsubmit() event on the
 serverside.

 This works well when i don't have a submit-component in the form as
 well. 
 However, when I do have a submit the onchange doesn't give a onsubmit()
 on
 the serverside anymore. 

 So, the onchange in the following snippet doesn't give a server side
 onsubmit()-event:

 body
 form t:type=form t:id=form id=form
select t:type=select t:model=countryList t:value=country
 onchange=this.form.submit();/
 input t:type=Submit value=All results/
 /form
 /body

 However, the following does:

 body
 form t:type=form t:id=form id=form
select t:type=select t:model=countryList t:value=country
 onchange=this.form.submit();/
 !--input t:type=Submit value=All results/--
 /form
 /body

 This isn't expected behavior since both examples do work with plain
 html
 form elements. 
 anyone?

 Geert-Jan
   
   
 

   
 
 

-- 
View this message in context: 
http

how to have persistent data in querystring?

2007-10-18 Thread Britske

okay, I like peristent data very much. On the other hand I want to have pages
in which several persistent properties are encoded into the querystring (for
better bookmarking and other requirements from a user-perspective). 

so my question is:
is there a way to encode / decode certain persistent properties into the
querystring? The best would be a way without having to change the onActivate
and onPassivate-methods of course...

Thanks in advance,
Geert-Jan 
-- 
View this message in context: 
http://www.nabble.com/how-to-have-persistent-data-in-querystring--tf4646238.html#a13272192
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



template-expansion sees hibernate-entity as java.lang.Boolean?

2007-10-18 Thread Britske

first of all, excuse me for the post-flood, but I had some standing issues.
Perhaps some of these questions can help others as well so here this one
goes:

I was on a roll until i wanted to include the name of a City-instance
through a template expansion, which gave the error: 

Could not convert 'firstresult.poi.city.name' into a component parameter
binding: Class java.lang.Boolean does not contain a property named 'name'
(within property expression 'firstresult.poi.city.name'). 

However, city is of type City and not op type java.lang.Boolean!

The traversal goes through a POI and a City-class which are both mapped as
hibernate-entities. 
the traversal poi.getCity() is a lazy association. 

(for you hibernate gurus: 
   @ManyToOne(fetch = FetchType.LAZY) 
@JoinColumn(name=cityid, nullable=false)
@Cache(usage =
org.hibernate.annotations.CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
private City city;

my expansion looks like:: 

t:compositeBlockList t:id=comp1
  t:parameter name=groupheader
div style=padding:5px
strong
${firstresult.poi.city.name}
/strong
/div
  /t:parameter 
/t:compositeBlockList

What is causing this error? Could the hibernate-entity City look like a
boolean (when reflection is used) before it is lazily fetched?? I can't
really imagine that but who knows? anyone?

thanks, 
Geert-Jan


-- 
View this message in context: 
http://www.nabble.com/template-expansion-sees-hibernate-entity-as-java.lang.Boolean--tf4646244.html#a13272202
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 form submit not fired

2007-10-18 Thread Britske

Yeah i see/know, but for the discussion say that I want AJAX to change a
portion of the page every time a onChange-event fires (the server-side
method CallWhenOnChangeIsFired() should be called through AJAX whenever this
happens ans this method changes sets the necessary fields / performs a
search, etc. )

The example you provided in the example only fires once  but I need it to
fire every time a onChange happens. How to do this? 

Thanks in advance, 
Geert-Jan
 


HugoPalma wrote:
 
 The method i suggested is implemented so that you don't have to submit 
 the form. That's what AJAX is all about, you make a request to the 
 server and then update a portion of your page based on the response from 
 the server using javascript. There's no page reload of for submission.
 
 Britske wrote:
 yeah indeed it is only called once when the template is rendered, I
 discovered now. 
 However i don't need to return a dynamic url or whatever based on the
 getTheLink-method. 

 what I need is a way to reliably catch a event at the server/java side
 (in
 this case onChange) every time that event occurs. I don't want to submit
 my
 form when that happens (otherwise I could use the method you suggested)
 but
 I want to update some information on the current page and stay there. 

 This means that i have to redirect to my currentpage with a couple of
 queryparameters in the url which depend on the selected fields in the
 form. 

 hmm, the more i think about it, I don't think i really need to catch the
 event server-side. I just redirect to the current page on onChange using
 javascript:window.location=... and parse the querystrings correctly in
 it. 

 hope this makes sense, 
 thanks!
 Geert-Jan



 HugoPalma wrote:
   
 That's the way it's supposed to be.
 You only see the getTheLink method executed once because that what it 
 need to replace ${theLink} in your template with the correct link that 
 is returned from your method. This is done once when the page renders. 
 If you look at the rendered page source you won't see ${theLink} there, 
 instead you will the the generated link to your listener.

 Anyway, does it really matter how many times the getTheLink method is 
 invoked ? I think not.  What really matters is that the listener method 
 to which your getTheLink method should be returning the URL to is called 
 whenever you call the sendRequest function.


 Britske wrote:
 
 thanks that works partially. 

 However, the event is only catched twice: 
 1. on pageload (??m the sendRequest isn't called, but somehow the
 getTheLink()-method is executed.)
 2. the first time i send a onchange. 

 However after the first onchange all other onchange-event don't get
 getTheLink() executed, although sendRequest() is called on the
 client-side
 each time. 

 This is my relevant code: 

 in  html: 
 script
 function sendRequest() 
 {
alert(sendRequest reached);
new Ajax.Request('${theLink}',
 {asynchronous:true,onSuccess:handleResponse});
 } 
 /script
 ...
 select t:type=select t:model=themaList t:value=thema
 onchange=sendRequest() name=thema id=thema tabindex=4 
 class=formElement/

 in the page-class: 
public String getTheLink() 
{
System.out.println(catched!!);
return catched!;
} 

 Do you 've got any idea what causes this behavior? 

 Thanks,
 Geert-Jan




 HugoPalma wrote:
   
   
 I would suggest that you use AJAX instead of doing the form submit. 
 Although the AJAX integration in T5 is still not implemented it's very 
 easy to do using the provided prototype and json javascripts. I did
 this 
 successfully for some simple events also.
 Shortly, here's how i did it:

 In my page i have these two javascript functions:

 function handleResponse(xhrResponse) {
 var json = xhrResponse.responseText.evalJSON(true);

 //Do whatever you want with the server response
 }
 // --

 function sendRequest() {
 new Ajax.Request('${theLink}', {asynchronous:true, 
 onSuccess:handleResponse});
 }

 On the page class i have:

 public String getTheLink() {
 Link l = _resources.createActionLink(myAction, false);
 return l.toURI();
 }

 public StreamResponse onMyAction() {
 CollectionCasta castas =
 _regiaoDao.getRegiao(regiao).getCastas();

 JSONObject jsonObject = new JSONObject();
   // Add whatever info you want to send to the client

 return new TextStreamResponse(text/xml,
 jsonObject.toString());
 }

 And that's it. Works great. All you have to do now is call the 
 sendRequest function from whatever javascript event you want to catch.
 Hope this helps.

 Britske wrote:
 
 
 I have a use-case in which i need to catch a onchange of of
 select-component
 on the server-side. 
 The only way I know how to do that is do a javascript
 onchange='this.form.submit()' and catch the onsubmit() event on the
 serverside.

 This works well when i don't have a submit

Re: t5 form submit not fired

2007-10-18 Thread Britske

I must have been sleeping earlier, because I figured that (in your example) 
getTheLink() had to be called multiple times, instead of onMyAction()..

That solves a few things, now there's no need for a submit anymore, thanks!
Geert-Jan


HugoPalma wrote:
 
 The example i provided fires the call to the server whenever the 
 javascript function is called.
 So, if you call the function from an onchange event on a select the 
 method will be called every time you change the selectbox.
 
 select onchange=sendRequest() ...
 
 /select
 
 Britske wrote:
 Yeah i see/know, but for the discussion say that I want AJAX to change a
 portion of the page every time a onChange-event fires (the server-side
 method CallWhenOnChangeIsFired() should be called through AJAX whenever
 this
 happens ans this method changes sets the necessary fields / performs a
 search, etc. )

 The example you provided in the example only fires once  but I need it to
 fire every time a onChange happens. How to do this? 

 Thanks in advance, 
 Geert-Jan
  


 HugoPalma wrote:
   
 The method i suggested is implemented so that you don't have to submit 
 the form. That's what AJAX is all about, you make a request to the 
 server and then update a portion of your page based on the response from 
 the server using javascript. There's no page reload of for submission.

 Britske wrote:
 
 yeah indeed it is only called once when the template is rendered, I
 discovered now. 
 However i don't need to return a dynamic url or whatever based on the
 getTheLink-method. 

 what I need is a way to reliably catch a event at the server/java side
 (in
 this case onChange) every time that event occurs. I don't want to
 submit
 my
 form when that happens (otherwise I could use the method you suggested)
 but
 I want to update some information on the current page and stay there. 

 This means that i have to redirect to my currentpage with a couple of
 queryparameters in the url which depend on the selected fields in the
 form. 

 hmm, the more i think about it, I don't think i really need to catch
 the
 event server-side. I just redirect to the current page on onChange
 using
 javascript:window.location=... and parse the querystrings correctly in
 it. 

 hope this makes sense, 
 thanks!
 Geert-Jan



 HugoPalma wrote:
   
   
 That's the way it's supposed to be.
 You only see the getTheLink method executed once because that what it 
 need to replace ${theLink} in your template with the correct link that 
 is returned from your method. This is done once when the page renders. 
 If you look at the rendered page source you won't see ${theLink}
 there, 
 instead you will the the generated link to your listener.

 Anyway, does it really matter how many times the getTheLink method is 
 invoked ? I think not.  What really matters is that the listener
 method 
 to which your getTheLink method should be returning the URL to is
 called 
 whenever you call the sendRequest function.


 Britske wrote:
 
 
 thanks that works partially. 

 However, the event is only catched twice: 
 1. on pageload (??m the sendRequest isn't called, but somehow the
 getTheLink()-method is executed.)
 2. the first time i send a onchange. 

 However after the first onchange all other onchange-event don't get
 getTheLink() executed, although sendRequest() is called on the
 client-side
 each time. 

 This is my relevant code: 

 in  html: 
 script
 function sendRequest() 
 {
  alert(sendRequest reached);
  new Ajax.Request('${theLink}',
 {asynchronous:true,onSuccess:handleResponse});
 } 
 /script
 ...
 select t:type=select t:model=themaList t:value=thema
 onchange=sendRequest() name=thema id=thema tabindex=4 
 class=formElement/

 in the page-class: 
  public String getTheLink() 
  {
  System.out.println(catched!!);
  return catched!;
  } 

 Do you 've got any idea what causes this behavior? 

 Thanks,
 Geert-Jan




 HugoPalma wrote:
   
   
   
 I would suggest that you use AJAX instead of doing the form submit. 
 Although the AJAX integration in T5 is still not implemented it's
 very 
 easy to do using the provided prototype and json javascripts. I did
 this 
 successfully for some simple events also.
 Shortly, here's how i did it:

 In my page i have these two javascript functions:

 function handleResponse(xhrResponse) {
 var json = xhrResponse.responseText.evalJSON(true);

 //Do whatever you want with the server response
 }
 // --

 function sendRequest() {
 new Ajax.Request('${theLink}', {asynchronous:true, 
 onSuccess:handleResponse});
 }

 On the page class i have:

 public String getTheLink() {
 Link l = _resources.createActionLink(myAction, false);
 return l.toURI();
 }

 public StreamResponse onMyAction() {
 CollectionCasta castas =
 _regiaoDao.getRegiao(regiao).getCastas();

 JSONObject jsonObject = new JSONObject();
   // Add

Re: how to have persistent data in querystring?

2007-10-18 Thread Britske

that would require a lot of manual labor for each and every link. 

btw: my question relates to T5.

Say i had page B injected into page A. 
I could then initialize page B and return page B from some eventhandler on
page A. 
What I would want to accomplish is that this automatically results in
redirecting to page B (as normal) with the difference that the url of page B
shows my predefined fields of page B in the url (I know I mentioned
querystring in the subjectheader, i mean the path-part of the url)

The mechanism could know this because at designtime I could have tagged the
fields of page B that I wanted to include in the url. This would enable me
to once define these fields at design-time and not having to worry about it
later on. 

is anything like this out there, or planned at all?

Thanks in advance,
Geert-Jan


Josh Canfield-2 wrote:
 
 If you want to parameters to the query string then you can create a link
 and
 add parameters to it from within your page.
 
 http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/Link.html
 
 
 Josh
 
 On 10/18/07, Britske [EMAIL PROTECTED] wrote:


 okay, I like peristent data very much. On the other hand I want to have
 pages
 in which several persistent properties are encoded into the querystring
 (for
 better bookmarking and other requirements from a user-perspective).

 so my question is:
 is there a way to encode / decode certain persistent properties into the
 querystring? The best would be a way without having to change the
 onActivate
 and onPassivate-methods of course...

 Thanks in advance,
 Geert-Jan
 --
 View this message in context:
 http://www.nabble.com/how-to-have-persistent-data-in-querystring--tf4646238.html#a13272192
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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


 
 
 -- 
 --
 TheDailyTube.com. Sign up and get the best new videos on the internet
 delivered fresh to your inbox.
 
 

-- 
View this message in context: 
http://www.nabble.com/how-to-have-persistent-data-in-querystring--tf4646238.html#a13280217
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 form submit not fired

2007-10-18 Thread Britske

since your example effectively calls a ActionLink through AJAX, a redirect
DOES happen. It's the result of the ActionLink. If I'm seeing this correctly
what then is the advantage of doing a call through AJAX or a form.submit()
for the discussed purpose, since both result in a redirect?

//Geert-Jan



HugoPalma wrote:
 
 The method i suggested is implemented so that you don't have to submit 
 the form. That's what AJAX is all about, you make a request to the 
 server and then update a portion of your page based on the response from 
 the server using javascript. There's no page reload of for submission.
 
 Britske wrote:
 yeah indeed it is only called once when the template is rendered, I
 discovered now. 
 However i don't need to return a dynamic url or whatever based on the
 getTheLink-method. 

 what I need is a way to reliably catch a event at the server/java side
 (in
 this case onChange) every time that event occurs. I don't want to submit
 my
 form when that happens (otherwise I could use the method you suggested)
 but
 I want to update some information on the current page and stay there. 

 This means that i have to redirect to my currentpage with a couple of
 queryparameters in the url which depend on the selected fields in the
 form. 

 hmm, the more i think about it, I don't think i really need to catch the
 event server-side. I just redirect to the current page on onChange using
 javascript:window.location=... and parse the querystrings correctly in
 it. 

 hope this makes sense, 
 thanks!
 Geert-Jan



 HugoPalma wrote:
   
 That's the way it's supposed to be.
 You only see the getTheLink method executed once because that what it 
 need to replace ${theLink} in your template with the correct link that 
 is returned from your method. This is done once when the page renders. 
 If you look at the rendered page source you won't see ${theLink} there, 
 instead you will the the generated link to your listener.

 Anyway, does it really matter how many times the getTheLink method is 
 invoked ? I think not.  What really matters is that the listener method 
 to which your getTheLink method should be returning the URL to is called 
 whenever you call the sendRequest function.


 Britske wrote:
 
 thanks that works partially. 

 However, the event is only catched twice: 
 1. on pageload (??m the sendRequest isn't called, but somehow the
 getTheLink()-method is executed.)
 2. the first time i send a onchange. 

 However after the first onchange all other onchange-event don't get
 getTheLink() executed, although sendRequest() is called on the
 client-side
 each time. 

 This is my relevant code: 

 in  html: 
 script
 function sendRequest() 
 {
alert(sendRequest reached);
new Ajax.Request('${theLink}',
 {asynchronous:true,onSuccess:handleResponse});
 } 
 /script
 ...
 select t:type=select t:model=themaList t:value=thema
 onchange=sendRequest() name=thema id=thema tabindex=4 
 class=formElement/

 in the page-class: 
public String getTheLink() 
{
System.out.println(catched!!);
return catched!;
} 

 Do you 've got any idea what causes this behavior? 

 Thanks,
 Geert-Jan




 HugoPalma wrote:
   
   
 I would suggest that you use AJAX instead of doing the form submit. 
 Although the AJAX integration in T5 is still not implemented it's very 
 easy to do using the provided prototype and json javascripts. I did
 this 
 successfully for some simple events also.
 Shortly, here's how i did it:

 In my page i have these two javascript functions:

 function handleResponse(xhrResponse) {
 var json = xhrResponse.responseText.evalJSON(true);

 //Do whatever you want with the server response
 }
 // --

 function sendRequest() {
 new Ajax.Request('${theLink}', {asynchronous:true, 
 onSuccess:handleResponse});
 }

 On the page class i have:

 public String getTheLink() {
 Link l = _resources.createActionLink(myAction, false);
 return l.toURI();
 }

 public StreamResponse onMyAction() {
 CollectionCasta castas =
 _regiaoDao.getRegiao(regiao).getCastas();

 JSONObject jsonObject = new JSONObject();
   // Add whatever info you want to send to the client

 return new TextStreamResponse(text/xml,
 jsonObject.toString());
 }

 And that's it. Works great. All you have to do now is call the 
 sendRequest function from whatever javascript event you want to catch.
 Hope this helps.

 Britske wrote:
 
 
 I have a use-case in which i need to catch a onchange of of
 select-component
 on the server-side. 
 The only way I know how to do that is do a javascript
 onchange='this.form.submit()' and catch the onsubmit() event on the
 serverside.

 This works well when i don't have a submit-component in the form as
 well. 
 However, when I do have a submit the onchange doesn't give a
 onsubmit()
 on
 the serverside anymore. 

 So, the onchange

Re: t5 form submit not fired

2007-10-18 Thread Britske

after the onchange occurs, this is what happens in my app: 

1. onMyAction is executed()  (this is an actionlink which returns nothing
(void) which results in a client-side redirect to the same page 
(as per documentation:
http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html )

2. onActivate() is executed on the server, which I think proofs that there
was indeed a redirect. 

please don't get me wrong, I still think it's an elegant solution...

//Geert-Jan


HugoPalma wrote:
 
 Why do you say a redirect happens ? Does your page refresh when you 
 change the selectbox value ?
 It won't refresh because all your doing is call a javascript function. 
 There's no redirect.
 
 Britske wrote:
 since your example effectively calls a ActionLink through AJAX, a
 redirect
 DOES happen. It's the result of the ActionLink. If I'm seeing this
 correctly
 what then is the advantage of doing a call through AJAX or a
 form.submit()
 for the discussed purpose, since both result in a redirect?

 //Geert-Jan



 HugoPalma wrote:
   
 The method i suggested is implemented so that you don't have to submit 
 the form. That's what AJAX is all about, you make a request to the 
 server and then update a portion of your page based on the response from 
 the server using javascript. There's no page reload of for submission.

 Britske wrote:
 
 yeah indeed it is only called once when the template is rendered, I
 discovered now. 
 However i don't need to return a dynamic url or whatever based on the
 getTheLink-method. 

 what I need is a way to reliably catch a event at the server/java side
 (in
 this case onChange) every time that event occurs. I don't want to
 submit
 my
 form when that happens (otherwise I could use the method you suggested)
 but
 I want to update some information on the current page and stay there. 

 This means that i have to redirect to my currentpage with a couple of
 queryparameters in the url which depend on the selected fields in the
 form. 

 hmm, the more i think about it, I don't think i really need to catch
 the
 event server-side. I just redirect to the current page on onChange
 using
 javascript:window.location=... and parse the querystrings correctly in
 it. 

 hope this makes sense, 
 thanks!
 Geert-Jan



 HugoPalma wrote:
   
   
 That's the way it's supposed to be.
 You only see the getTheLink method executed once because that what it 
 need to replace ${theLink} in your template with the correct link that 
 is returned from your method. This is done once when the page renders. 
 If you look at the rendered page source you won't see ${theLink}
 there, 
 instead you will the the generated link to your listener.

 Anyway, does it really matter how many times the getTheLink method is 
 invoked ? I think not.  What really matters is that the listener
 method 
 to which your getTheLink method should be returning the URL to is
 called 
 whenever you call the sendRequest function.


 Britske wrote:
 
 
 thanks that works partially. 

 However, the event is only catched twice: 
 1. on pageload (??m the sendRequest isn't called, but somehow the
 getTheLink()-method is executed.)
 2. the first time i send a onchange. 

 However after the first onchange all other onchange-event don't get
 getTheLink() executed, although sendRequest() is called on the
 client-side
 each time. 

 This is my relevant code: 

 in  html: 
 script
 function sendRequest() 
 {
  alert(sendRequest reached);
  new Ajax.Request('${theLink}',
 {asynchronous:true,onSuccess:handleResponse});
 } 
 /script
 ...
 select t:type=select t:model=themaList t:value=thema
 onchange=sendRequest() name=thema id=thema tabindex=4 
 class=formElement/

 in the page-class: 
  public String getTheLink() 
  {
  System.out.println(catched!!);
  return catched!;
  } 

 Do you 've got any idea what causes this behavior? 

 Thanks,
 Geert-Jan




 HugoPalma wrote:
   
   
   
 I would suggest that you use AJAX instead of doing the form submit. 
 Although the AJAX integration in T5 is still not implemented it's
 very 
 easy to do using the provided prototype and json javascripts. I did
 this 
 successfully for some simple events also.
 Shortly, here's how i did it:

 In my page i have these two javascript functions:

 function handleResponse(xhrResponse) {
 var json = xhrResponse.responseText.evalJSON(true);

 //Do whatever you want with the server response
 }
 // --

 function sendRequest() {
 new Ajax.Request('${theLink}', {asynchronous:true, 
 onSuccess:handleResponse});
 }

 On the page class i have:

 public String getTheLink() {
 Link l = _resources.createActionLink(myAction, false);
 return l.toURI();
 }

 public StreamResponse onMyAction() {
 CollectionCasta castas =
 _regiaoDao.getRegiao(regiao).getCastas();

 JSONObject jsonObject = new JSONObject();
   // Add whatever info

T5: how to insert string including markup to template

2007-10-17 Thread Britske


-- 
View this message in context: 
http://www.nabble.com/T5%3A-how-to-insert-string-including-markup-to-template-tf4641184.html#a13255720
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



T5: how to insert string including markup to template (2nd try)

2007-10-17 Thread Britske

accidently submitted my first blank post so here it goes again: 

i have a variable for example:
String text = strongsome text here/strong;

In my template in want to insert it:
${text}

however the html-tags get encoded as text, so the marktup doesn't show. 
So, is there a way to insert text including markup?

thanks ,
Geert-Jan
-- 
View this message in context: 
http://www.nabble.com/T5%3A-how-to-insert-string-including-markup-to-template-%282nd-try%29-tf4641214.html#a13255820
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



t5: mock-up templates with sample-content then replace in t5

2007-10-01 Thread Britske

Hi, 

in T4 it is possible to mock-up pages in your  favorite html-editor (say
dreamweaver) including sample-content (for tables for example). 
How can I achieve the same in T5. 

I mean, I can add a table (see below) with dynamic content, but is it
possible to add sample content (which is replaced by the actual dynamic
content on launch) to this same table definition so that the design aspect
is integrated as well?

Thanks in advance,
Geert-Jan

table
tr t:type=loop source=items value=item class=prop:rowClass
  td${item.id}/td
  td${item.name}/td
  td${item.quantity}/td
/tr
  /table
-- 
View this message in context: 
http://www.nabble.com/t5%3A-mock-up-templates-with-sample-content-then-replace-in-t5-tf4547816.html#a12977663
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



[T5]: binding issue: supplying parameter to component -- always null

2007-09-27 Thread Britske

Hi all,

I guess I'm missing something here, maybe a trival thing so bear with me
please.;-)

I'm trying to extend the T5 grid / griddatasource for my requirements. For
some event-handling in GridColumn I need to reference the field _model of
type BeanModel which exists in the Grid-class from GridColumn. So I both
extended Grid -- LazyConfigurableGrid and GridColumns -- LazyGridColumns.

next,I supplied field  _model as a parameter from the gridclass to the
gridcolum-class. 

My problem:
 _model==null in GridColumn all the time. I guess this is some binding-thing
that I can't quite get my head around. (_model == null on initialization of
the component, but i thought it would be updated later on)

The general question: how to pass objects by reference as parameters, since
they always seem to be null.

the relevant bits: 

LazyConfigurableGrid:

@Parameter
  private BeanModel _model;

@SuppressWarnings(unused)
  @Component(parameters =
  { sortColumnId=sortColumnId, sortAscending=sortAscending,
source=_source, _model=_model })
  private LazyGridColumns _columns;


LazyGridColumns:

@Parameter
private BeanModel _model;

Thanks in advance,
Geert-Jan


-- 
View this message in context: 
http://www.nabble.com/-T5-%3A-binding-issue%3A--supplying-parameter-to-component---%3E-always-null-tf4530634.html#a12928987
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



where are predefined cooercions located?

2007-09-26 Thread Britske

I'm subtyping GridDataSource. 
For that to work I need to create cooercions from List and null -- my
subtype

Because I've not done this before, I figured to just look at the list --
GridDataSource cooercion for an example. However I can't find where this
(and other cooercions) are defined. 

As I understand it these cooercions should be defined with a static method:
contributeTypeCoercer(..)
No luck yet though. Anyone?

Thanks,
Geert-Jan
-- 
View this message in context: 
http://www.nabble.com/where-are-predefined-cooercions-located--tf4521596.html#a12898678
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



how to reference public field of included component in template (T5)

2007-09-25 Thread Britske

Some context first:

I'm using the T5 grid with the row-parameter to bind the current-row to a
property 'cityresult' so that I can edit the contents of all cells of the
name-column (works splendid by the way)

table t:type=Grid row=cityresult source=allCityResults
  t:parameter name=namecell 
 ${cityresult.city.name} 
   /t:parameter
/table

However, I forsee that some pages will contain multiple grids, which would
mean I need multiple binding-properties analogously as 'cityresult' in my
page-class, which clutters my page-class a bit.

At the same time the Grid-component internally has a private field _row of
type Object and a getter (getRow()). Instead of the above I want to be able
to access this field (through the getter or whatever) directly in my 
page-template. 

So for instance I would end up with: 

 table t:type=Grid id=allcities source=allCityResults
  t:parameter name=namecell 
 ${cityresult.city.name} 
   /t:parameter
/table

Is something like this at all possible? What needs to be done to make it
possible, or would you discourage it for a particular reason? 

Thanks,
Geert-Jan

-- 
View this message in context: 
http://www.nabble.com/how-to-reference-public-field-of-included-component-in-template-%28T5%29-tf4514005.html#a12874918
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



url-rewriting in Tapestry 5

2007-09-21 Thread Britske

Hi all,

I'm looking for a way to have flexible / nice urls when using tapestry5. 
I know that with tapestry 5, supplied parameters are appended to the path
instead of to the querystring, but i'm looking for a bit more control. 

For example I want a Venue bean with name venueX and id=123 to show up as: 
http://test.com/venue/countryname/cityname/venux/123

Notice the countryname and cityname.

Anybody knows if this is possible with Tapestry 5 out of the box (Can't get
my head aroundthis)
or with a urlrewriting filter or something?

Thanks in advance for any help,

yours sincerely,
Geert-Jan
-- 
View this message in context: 
http://www.nabble.com/url-rewriting-in-Tapestry-5-tf4496726.html#a12823397
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: url-rewriting in Tapestry 5

2007-09-21 Thread Britske

Thanks these all seem valid approaches.  
What i'm looking for is a stretching the possibilities i guess but here it
goes anyway: I want a way in which I can plug a 'rewrite strategy'. This
means that not only I have to translate urls from 'nice' to 'tapestry5'
-internal but also the other way around, so that tapestry-pages reference
other pages automatically by their 'nice' -url. 

I would like to keep the code in 1 place for making this
bidirectional-translation. 

Doing this with mode_rewrite does't give me control in code I think. 
I wonder if this is possible using some form of rewrite-filter, that is able
to translate both ways. 
any ideas on this?

regards,
Geert-Jan



Robin Helgelin wrote:
 
 On 9/21/07, Daniel Leffel [EMAIL PROTECTED] wrote:
 I went down this path and decided that mod_rewrite is a much cleaner way
 to
 achieve something like this.
 
 Or maybe an urlfilter bundled with your war, there are a few usable ones.
 
 -- 
 regards,
 Robin
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/url-rewriting-in-Tapestry-5-tf4496726.html#a12825612
Sent from the Tapestry - User mailing list archive at Nabble.com.


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