Re: T5.2 form reset on back button

2011-10-03 Thread Rendy Tapestry
FF 4 have same behavior as FF 6.

Thanks,
Rendy.

On Mon, Oct 3, 2011 at 6:47 PM, Geoff Callender <
geoff.callender.jumpst...@gmail.com> wrote:

> Are you sure Firefox 4 doesn't misbehave for T5.0.16 too? I ask because
> after a bit of googling I'm getting the impression the behaviour may be due
> to a Firefox 4 "security feature".
>
> On 03/10/2011, at 3:04 PM, Rendy Tapestry wrote:
>
> > Hi Geoff,
> >
> > I am using Firefox 6.0.2 and accessing
> >
> http://jumpstart.doublenegative.com.au/jumpstart/examples/state/sharingacrossmultiplepages1
> >
> > I fill field apple quantities, etc, and then next, and then click browser
> > back button, and everything reset as just first render of that page.
> >
> > But if I used chrome 14, everything is just as you describe.
> >
> > Thanks,
> > Rendy.
> >
> > On Mon, Oct 3, 2011 at 10:40 AM, Steve Eynon <
> steve.ey...@alienfactory.co.uk
> >> wrote:
> >
> >> There is nothing in T5 that explicitly resets form data when you
> >> refresh a page.
> >>
> >> If you ensure your form data is persisted when the form is submitted,
> >> then when you refresh your page, there is no reason why your fields
> >> should not display said data.
> >>
> >>
> >>
> >> On 3 October 2011 09:10, Geoff Callender
> >>  wrote:
> >>> I haven't seen this problem. Can you find an example in JumpStart that
> >> has this behaviour?
> >>>
> >>> On 03/10/2011, at 2:58 AM, Rendy Tapestry wrote:
> >>>
> >>>> Anyone resolved this problems ? I encountered the same things.
> >>>>
> >>>> Thank you,
> >>>> Rendy.
> >>>>
> >>>> On Fri, Sep 23, 2011 at 5:13 AM, Christoph Jäger <
> >>>> christoph.jae...@derwald.at> wrote:
> >>>>
> >>>>> Hi,
> >>>>>
> >>>>> I am migrating an application from Tapestry 5.0.16 to 5.2.6. There
> were
> >>>>> some things to change, but it was not too bad. Now, I am almost
> >> finished.
> >>>>> There is just one last things that bothers me: Tapestry 5.2.6 resets
> my
> >>>>> forms when I use the back button, while 5.0.16 left the values
> intact.
> >>>>>
> >>>>> I have a form, where a user selects some values, and gets a statistic
> >> as
> >>>>> .txt or .html table (depending on what is selected on the form). Now
> >> when he
> >>>>> sees the result, he may want to go back, change some settings and try
> >> again.
> >>>>> This worked nicely on 5.0.16, but now my form is reset, and he has to
> >> start
> >>>>> to fill in the complete form again. I can not include a HTML back
> link,
> >>>>> because the result page may also be plain text.
> >>>>>
> >>>>> It must be some javascript, because when I turn of javascript, my
> form
> >>>>> values stay as they are.
> >>>>>
> >>>>> How do I turn off this reset behaviour?
> >>>>>
> >>>>> Thanks,
> >>>>>
> >>>>> Christoph Jäger
> >>>>>
> >>>>>
> >>>>> -
> >>>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >>>>> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>>>>
> >>>>>
> >>>
> >>>
> >>> -
> >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >>> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>>
> >>>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>
> >>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Custom component

2011-10-02 Thread Rendy Tapestry
Thanks Taha,

I'll give your second suggestion a try.

Thanks,
Rendy.

On Sun, Oct 2, 2011 at 11:03 PM, Taha Hafeez Siddiqi <
tawus.tapes...@gmail.com> wrote:

> Hi Rendy
>
> Your component, if fits the definition of a form field, can extend
> AbstractField and then override processSubmission() method.
>
> Otherwise you can @Inject FormSupport and then use
> FormSupport#storeAndExecute() to execute a ComponentAction
>
> regards
> Taha
>
> On Oct 2, 2011, at 9:18 PM, Rendy Tapestry wrote:
>
> > Hi All,
> >
> > Is it possible to have a custom component with a method that will getting
> > called when the enclosing form is being submitted ? In that method, I
> want
> > to change some parameter of that custom component.
> >
> > Thanks,
> > Rendy.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: T5.2 form reset on back button

2011-10-02 Thread Rendy Tapestry
Hi Geoff,

I am using Firefox 6.0.2 and accessing
http://jumpstart.doublenegative.com.au/jumpstart/examples/state/sharingacrossmultiplepages1

I fill field apple quantities, etc, and then next, and then click browser
back button, and everything reset as just first render of that page.

But if I used chrome 14, everything is just as you describe.

Thanks,
Rendy.

On Mon, Oct 3, 2011 at 10:40 AM, Steve Eynon  wrote:

> There is nothing in T5 that explicitly resets form data when you
> refresh a page.
>
> If you ensure your form data is persisted when the form is submitted,
> then when you refresh your page, there is no reason why your fields
> should not display said data.
>
>
>
> On 3 October 2011 09:10, Geoff Callender
>  wrote:
> > I haven't seen this problem. Can you find an example in JumpStart that
> has this behaviour?
> >
> > On 03/10/2011, at 2:58 AM, Rendy Tapestry wrote:
> >
> >> Anyone resolved this problems ? I encountered the same things.
> >>
> >> Thank you,
> >> Rendy.
> >>
> >> On Fri, Sep 23, 2011 at 5:13 AM, Christoph Jäger <
> >> christoph.jae...@derwald.at> wrote:
> >>
> >>> Hi,
> >>>
> >>> I am migrating an application from Tapestry 5.0.16 to 5.2.6. There were
> >>> some things to change, but it was not too bad. Now, I am almost
> finished.
> >>> There is just one last things that bothers me: Tapestry 5.2.6 resets my
> >>> forms when I use the back button, while 5.0.16 left the values intact.
> >>>
> >>> I have a form, where a user selects some values, and gets a statistic
> as
> >>> .txt or .html table (depending on what is selected on the form). Now
> when he
> >>> sees the result, he may want to go back, change some settings and try
> again.
> >>> This worked nicely on 5.0.16, but now my form is reset, and he has to
> start
> >>> to fill in the complete form again. I can not include a HTML back link,
> >>> because the result page may also be plain text.
> >>>
> >>> It must be some javascript, because when I turn of javascript, my form
> >>> values stay as they are.
> >>>
> >>> How do I turn off this reset behaviour?
> >>>
> >>> Thanks,
> >>>
> >>> Christoph Jäger
> >>>
> >>>
> >>> -
> >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >>> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>>
> >>>
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: T5.2 form reset on back button

2011-10-02 Thread Rendy Tapestry
Anyone resolved this problems ? I encountered the same things.

Thank you,
Rendy.

On Fri, Sep 23, 2011 at 5:13 AM, Christoph Jäger <
christoph.jae...@derwald.at> wrote:

> Hi,
>
> I am migrating an application from Tapestry 5.0.16 to 5.2.6. There were
> some things to change, but it was not too bad. Now, I am almost finished.
> There is just one last things that bothers me: Tapestry 5.2.6 resets my
> forms when I use the back button, while 5.0.16 left the values intact.
>
> I have a form, where a user selects some values, and gets a statistic as
> .txt or .html table (depending on what is selected on the form). Now when he
> sees the result, he may want to go back, change some settings and try again.
> This worked nicely on 5.0.16, but now my form is reset, and he has to start
> to fill in the complete form again. I can not include a HTML back link,
> because the result page may also be plain text.
>
> It must be some javascript, because when I turn of javascript, my form
> values stay as they are.
>
> How do I turn off this reset behaviour?
>
> Thanks,
>
> Christoph Jäger
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Custom component

2011-10-02 Thread Rendy Tapestry
Hi All,

Is it possible to have a custom component with a method that will getting
called when the enclosing form is being submitted ? In that method, I want
to change some parameter of that custom component.

Thanks,
Rendy.


Re: Run javascript after a zone is updated

2011-09-13 Thread Rendy Tapestry
You could try this code, someone else was ask this question.

$('yourZoneId').observe(**Tapestry.ZONE_UPDATED_EVENT, function() {
   ...
});

On Tue, Sep 13, 2011 at 3:53 AM, Muhammad Gelbana wrote:

> I solved the situation using a workaround. But I still couldn't
> efficiently run javascript when the block zone is updated.
> I tried using the javascriptsupport service but couldn't find a way to
> use it as it needs to be used in the "afterrender" event of the zone
> which i couldn't figure out where to implement !..mixins doesn't work
> with zones !!
>
> If any of this sounds crazy..it's because I'm new to ajax with tapestry.
>
>
> On Mon, Sep 12, 2011 at 7:54 PM, derkoe
>  wrote:
> >
> > Muhammad Gelbana wrote:
> >>
> >> I have a table with many cells being updated using ajax calls. In the
> >> block returned by the ajax call, I conditionally run some java script
> >> to style the td and div in which the response is rendered.
> >>
> >> For a reason, this javascript isn't executed well. But I when I run
> >> the returned script manually on friebug after the cell is rendered, It
> >> causes the desired effect !!
> >> May be the dom isn't ready for the script to run ? I'm confused !
> >>
> >
> > I guest that's simply a JavaScript problem - did you solve it?
> >
> > Do you add the Script via JavaScriptSupport?
> >
> > --
> > Chris
> >
> >
> > --
> > View this message in context:
> http://tapestry.1045711.n5.nabble.com/Run-javascript-after-a-zone-is-updated-tp4787067p4795128.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
> >
> >
>
>
>
> --
> Regards,
> Muhammad Gelbana
> Java Developer
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Localization Problems

2011-09-13 Thread Rendy Tapestry
Thanks Christian,

In my subsequent reply that become separate thread, it was already corrected
by Thiago, still got the same result (still use US locale instead of what I
change in PersistentLocale). I give up with solution #2 and try solution #1
with success.

Thanks again Christian for your help.

Rendy.

On Tue, Sep 13, 2011 at 12:33 AM, derkoe <
tapestry.christian.koeb...@gmail.com> wrote:

>
> Rendy Tapestry wrote:
> >
> > Hi Christian,
> >
> > Thank you for taking time to help. I try to solve my problem using second
> > approach from your suggestion. Creating LocalizationDispatcher and
> > register
> > it before PageRender. I try to run my application, it seems rendering
> > wasn't
> > happened (blank page is returned).
> >
> > Here is my code snippet.
> >
> > public class LocalizationDispatcher implements Dispatcher {
> > private final PersistentLocale persistentLocale;
> >
> > public LocalizationDispatcher(PersistentLocale persistentLocale) {
> > this.persistentLocale = persistentLocale;
> > }
> >
> > public boolean dispatch(Request request, Response response) throws
> > IOException {
> > if (!persistentLocale.isSet()) {
> > persistentLocale.set(new Locale("in", "ID"));
> > }
> >
> > return true;
> > }
> > }
> >
>
> You have to return "false" in the Dispatcher - otherwise Tapestry will
> think
> the request has been handled  and does not continue in the chain.
>
> --
> Chris
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Localization-Problems-tp4782013p4795034.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: Localization Problems

2011-09-09 Thread Rendy Tapestry
I am afraid that such solution won't work because I read this paragraph from
documentation :

You will see the new locale take effect on the next request. If it is
changed in a component event request (which is typical), the new locale will
be used in the subsequent page render request.

Can anyone explain that this approach will work for my problem or not ?

Thanks,
Rendy.

On Sat, Sep 10, 2011 at 12:02 AM, Rendy Tapestry
wrote:

> Hi Thiago,
>
> Thanks for such fast response, after setting it to false, my page is
> showing up again but, the solution still not working.
>
> For example, if I have page named, test.tml and 2 component message catalog
> test.properties and test_in_ID.properties, after setting PersistentLocale to
> in_ID, tapestry still picking value from test.properties.
>
> What might be wrong with my code ?
>
> Thanks,
> Rendy.
>
>
> On Fri, Sep 9, 2011 at 11:37 PM, Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
>> On Fri, 09 Sep 2011 12:54:23 -0300, Rendy Tapestry <
>> rendy.tapes...@gmail.com> wrote:
>>
>>  Hi Christian,
>>>
>>
>> Hi!
>>
>>  public class LocalizationDispatcher implements Dispatcher {
>>>private final PersistentLocale persistentLocale;
>>>
>>>public LocalizationDispatcher(**PersistentLocale persistentLocale) {
>>>this.persistentLocale = persistentLocale;
>>>}
>>>
>>>public boolean dispatch(Request request, Response response) throws
>>> IOException {
>>>if (!persistentLocale.isSet()) {
>>>persistentLocale.set(new Locale("in", "ID"));
>>>}
>>>
>>>return true;
>>>}
>>> }
>>>
>>
>> It should return false (i.e. this dispatcher didn't generate an answer).
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
>> and instructor
>> Owner, Ars Machina Tecnologia da Informação Ltda.
>> http://www.arsmachina.com.br
>>
>
>


Re: Localization Problems

2011-09-09 Thread Rendy Tapestry
Hi Thiago,

Thanks for such fast response, after setting it to false, my page is showing
up again but, the solution still not working.

For example, if I have page named, test.tml and 2 component message catalog
test.properties and test_in_ID.properties, after setting PersistentLocale to
in_ID, tapestry still picking value from test.properties.

What might be wrong with my code ?

Thanks,
Rendy.


On Fri, Sep 9, 2011 at 11:37 PM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Fri, 09 Sep 2011 12:54:23 -0300, Rendy Tapestry <
> rendy.tapes...@gmail.com> wrote:
>
>  Hi Christian,
>>
>
> Hi!
>
>  public class LocalizationDispatcher implements Dispatcher {
>>private final PersistentLocale persistentLocale;
>>
>>public LocalizationDispatcher(**PersistentLocale persistentLocale) {
>>this.persistentLocale = persistentLocale;
>>}
>>
>>public boolean dispatch(Request request, Response response) throws
>> IOException {
>>if (!persistentLocale.isSet()) {
>>persistentLocale.set(new Locale("in", "ID"));
>>}
>>
>>return true;
>>}
>> }
>>
>
> It should return false (i.e. this dispatcher didn't generate an answer).
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>


Re: Localization Problems

2011-09-09 Thread Rendy Tapestry
Hi Christian,

Thank you for taking time to help. I try to solve my problem using second
approach from your suggestion. Creating LocalizationDispatcher and register
it before PageRender. I try to run my application, it seems rendering wasn't
happened (blank page is returned).

Here is my code snippet.

public class LocalizationDispatcher implements Dispatcher {
private final PersistentLocale persistentLocale;

public LocalizationDispatcher(PersistentLocale persistentLocale) {
this.persistentLocale = persistentLocale;
}

public boolean dispatch(Request request, Response response) throws
IOException {
if (!persistentLocale.isSet()) {
persistentLocale.set(new Locale("in", "ID"));
}

return true;
}
}

And register it in AppModule here.

public static void
contributeMasterDispatcher(OrderedConfiguration configuration) {
configuration.addInstance("Localization", LocalizationDispatcher.class,
"before:PageRender");
}

What seems to wrong here ?

Thanks,
Rendy.


On Fri, Sep 9, 2011 at 12:26 AM, Christian Köberl <
tapestry.christian.koeb...@gmail.com> wrote:

> 2011-09-08 13:22, Rendy Tapestry:
>
>  Yes, I just set as you do, but it doesn't work. This is because what
>> browser
>> send through request  header is US locale. Based on tapestry mechanism
>> looking up for locale, it will search the nearest locale that is en. That
>> why ordering like that doesn't work.
>>
>> Any other idea ?
>>
>
> Tapestry's best guess is to use the browser's locale - how else to find an
> initial Locale?
>
> You could decorate or replace LocalizationSetter. ComponentEventLinkEncoder
> calls LocalizationSetter#**setLocaleFromLocaleName where you could insert
> your own code returning the default you want.
>
> Another way could be to check PersistentLocale and if not isSet() set your
> own default in a Request dispatcher (before PageRenderDispatcher).
>
> --
> Chris
>
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Localization Problems

2011-09-08 Thread Rendy Tapestry
Yes, I just set as you do, but it doesn't work. This is because what browser
send through request  header is US locale. Based on tapestry mechanism
looking up for locale, it will search the nearest locale that is en. That
why ordering like that doesn't work.

Any other idea ?

Sorry forgot to mention, my tapestry version is 5.2.6.

Thank you,
Rendy.

On Thu, Sep 8, 2011 at 5:59 PM, Taha Hafeez wrote:

> I have not used it but I think the first locale in configuration
> parameter tapestry.supported-locales(
> SymbolConstants.SUPPORTED_LOCALES) is used as the default.
>
> So "in_ID,en" will make in_ID as default.
>
> Just a guess :)
>
>
> On Thu, Sep 8, 2011 at 4:13 PM, Rendy Tapestry 
> wrote:
> > Hi all,
> >
> > I build an application that will support two locale, that is in_ID and
> en. I
> > am using PersistentLocale to accomplish this and as consequences all my
> > application url are encoded with selected locale (user set it manually
> > through application menu). So if my application name is xyz and in_ID
> locale
> > is choosed, my url will: localhost:8080/xyz/in_ID/
> > If I directly access localhost:8080/xyz/ it will go to en locale because
> my
> > request header expecting US. What suppose I do to make in_ID the default
> > locale if I access localhost:8080/xyz ?
> >
> > Thank you,
> > Rendy.
> >
>
>
>
> --
> Regards
>
> Taha Hafeez Siddiqi (tawus)
> http://tawus.wordpress.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Localization Problems

2011-09-08 Thread Rendy Tapestry
Hi all,

I build an application that will support two locale, that is in_ID and en. I
am using PersistentLocale to accomplish this and as consequences all my
application url are encoded with selected locale (user set it manually
through application menu). So if my application name is xyz and in_ID locale
is choosed, my url will: localhost:8080/xyz/in_ID/
If I directly access localhost:8080/xyz/ it will go to en locale because my
request header expecting US. What suppose I do to make in_ID the default
locale if I access localhost:8080/xyz ?

Thank you,
Rendy.


Re: Class Transformation problem

2011-08-14 Thread Rendy Tapestry
Yes it works, thank you.

Rendy.

On Fri, Aug 5, 2011 at 11:27 PM, Josh Canfield wrote:

> Right, this is what I was talking about. I use tynamo resteasy in this way.
>
> On Fri, Aug 5, 2011 at 12:27 AM, Taha Hafeez 
> wrote:
> > I don't think you need ComponentClassTransformationWorker. What you
> > need is, as Josh said, a service advice
> >
> > http://tapestry.apache.org/service-advisors.html
> >
> > Now the tricky part is where to apply it. As Josh said, if you expose
> > your resources as services you will be able to apply advises and even
> > use injection.
> >
> > By "exposing as service" I mean create an interface and its
> > implementation and bind using ServiceBinder. Then you can add that
> > resource to resteasy as
> >
> > public static void contributeApplication(Configuration
> > singletons, ObjectLocator locator)
> > {
> >singletons.add(locator.autobuild(MyDomainObjectResource.class));
> > }
> >
> > Disclaimer: I have never used tynamo-resteasy and this information is
> > based on http://tynamo.org/tapestry-resteasy+guide.
> >
> > On Fri, Aug 5, 2011 at 8:16 AM, Rendy Tapestry 
> wrote:
> >> Hi Josh,
> >>
> >> Might you please elaborate your answer ? I don't get it :)
> >>
> >> Thanks,
> >> Rendy.
> >>
> >> On Thu, Aug 4, 2011 at 10:29 PM, Josh Canfield  >wrote:
> >>
> >>> Also, rest resources can be bound as services to use injection and
> advice.
> >>> On Aug 4, 2011 8:05 AM, "Taha Hafeez" 
> wrote:
> >>> > Hi Rendy
> >>> >
> >>> > No ComponentClassTransformWorker will not work outside
> >>> > pages/components package. But class transformation is not the only
> >>> > reason to keep a special packages. You sometime need to scan classes
> >>> > for annotations etc and it is easy if you have specific packages
> >>> > which can be contributed to the scanning service.
> >>> >
> >>> > As far as class transformation is concerned, you can transform an
> >>> > existing class or create a new one by using ClassFab etc classes
> which
> >>> > are based on javassist in 5.2+ (on PlasticClass etc in 5.3+).
> >>> >
> >>> > Can you elaborate on your problem ?
> >>> >
> >>> > On Thu, Aug 4, 2011 at 7:25 PM, Rendy Tapestry <
> rendy.tapes...@gmail.com
> >>> >
> >>> wrote:
> >>> >> Hi all,
> >>> >>
> >>> >> I have problem with class transformation, my question, will this
> class
> >>> >> transformation work outside from special package (pages for
> example). I
> >>> am
> >>> >> using restful integration from tynamo which direct me to put my web
> >>> service
> >>> >> in rest package. Is the package name matter with class
> transformation ?
> >>> If
> >>> >> yes, how could I solve my problem ?
> >>> >>
> >>> >> Thanks,
> >>> >>
> >>> >> Rendy.
> >>> >>
> >>> >> ps. I am using tapestry 5.2.5 (ComponentClassTransformWorker)
> >>> >>
> >>> >
> >>> >
> >>> >
> >>> > --
> >>> > Regards
> >>> >
> >>> > Taha Hafeez Siddiqi (tawus)
> >>> > http://tawus.wordpress.com
> >>> >
> >>> > -
> >>> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >>> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >>> >
> >>>
> >>
> >
> >
> >
> > --
> > Regards
> >
> > Taha Hafeez Siddiqi (tawus)
> > http://tawus.wordpress.com
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Class Transformation problem

2011-08-05 Thread Rendy Tapestry
Thanks Taha & Josh, I will give it a try and later post back the result
here.

Thanks,
Rendy.

On Fri, Aug 5, 2011 at 2:27 PM, Taha Hafeez wrote:

> I don't think you need ComponentClassTransformationWorker. What you
> need is, as Josh said, a service advice
>
> http://tapestry.apache.org/service-advisors.html
>
> Now the tricky part is where to apply it. As Josh said, if you expose
> your resources as services you will be able to apply advises and even
> use injection.
>
> By "exposing as service" I mean create an interface and its
> implementation and bind using ServiceBinder. Then you can add that
> resource to resteasy as
>
> public static void contributeApplication(Configuration
> singletons, ObjectLocator locator)
> {
>singletons.add(locator.autobuild(MyDomainObjectResource.class));
> }
>
> Disclaimer: I have never used tynamo-resteasy and this information is
> based on http://tynamo.org/tapestry-resteasy+guide.
>
> On Fri, Aug 5, 2011 at 8:16 AM, Rendy Tapestry 
> wrote:
> > Hi Josh,
> >
> > Might you please elaborate your answer ? I don't get it :)
> >
> > Thanks,
> > Rendy.
> >
> > On Thu, Aug 4, 2011 at 10:29 PM, Josh Canfield  >wrote:
> >
> >> Also, rest resources can be bound as services to use injection and
> advice.
> >> On Aug 4, 2011 8:05 AM, "Taha Hafeez"  wrote:
> >> > Hi Rendy
> >> >
> >> > No ComponentClassTransformWorker will not work outside
> >> > pages/components package. But class transformation is not the only
> >> > reason to keep a special packages. You sometime need to scan classes
> >> > for annotations etc and it is easy if you have specific packages
> >> > which can be contributed to the scanning service.
> >> >
> >> > As far as class transformation is concerned, you can transform an
> >> > existing class or create a new one by using ClassFab etc classes which
> >> > are based on javassist in 5.2+ (on PlasticClass etc in 5.3+).
> >> >
> >> > Can you elaborate on your problem ?
> >> >
> >> > On Thu, Aug 4, 2011 at 7:25 PM, Rendy Tapestry <
> rendy.tapes...@gmail.com
> >> >
> >> wrote:
> >> >> Hi all,
> >> >>
> >> >> I have problem with class transformation, my question, will this
> class
> >> >> transformation work outside from special package (pages for example).
> I
> >> am
> >> >> using restful integration from tynamo which direct me to put my web
> >> service
> >> >> in rest package. Is the package name matter with class transformation
> ?
> >> If
> >> >> yes, how could I solve my problem ?
> >> >>
> >> >> Thanks,
> >> >>
> >> >> Rendy.
> >> >>
> >> >> ps. I am using tapestry 5.2.5 (ComponentClassTransformWorker)
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Regards
> >> >
> >> > Taha Hafeez Siddiqi (tawus)
> >> > http://tawus.wordpress.com
> >> >
> >> > -
> >> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >> >
> >>
> >
>
>
>
> --
> Regards
>
> Taha Hafeez Siddiqi (tawus)
> http://tawus.wordpress.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Class Transformation problem

2011-08-04 Thread Rendy Tapestry
Hi Josh,

Might you please elaborate your answer ? I don't get it :)

Thanks,
Rendy.

On Thu, Aug 4, 2011 at 10:29 PM, Josh Canfield wrote:

> Also, rest resources can be bound as services to use injection and advice.
> On Aug 4, 2011 8:05 AM, "Taha Hafeez"  wrote:
> > Hi Rendy
> >
> > No ComponentClassTransformWorker will not work outside
> > pages/components package. But class transformation is not the only
> > reason to keep a special packages. You sometime need to scan classes
> > for annotations etc and it is easy if you have specific packages
> > which can be contributed to the scanning service.
> >
> > As far as class transformation is concerned, you can transform an
> > existing class or create a new one by using ClassFab etc classes which
> > are based on javassist in 5.2+ (on PlasticClass etc in 5.3+).
> >
> > Can you elaborate on your problem ?
> >
> > On Thu, Aug 4, 2011 at 7:25 PM, Rendy Tapestry  >
> wrote:
> >> Hi all,
> >>
> >> I have problem with class transformation, my question, will this class
> >> transformation work outside from special package (pages for example). I
> am
> >> using restful integration from tynamo which direct me to put my web
> service
> >> in rest package. Is the package name matter with class transformation ?
> If
> >> yes, how could I solve my problem ?
> >>
> >> Thanks,
> >>
> >> Rendy.
> >>
> >> ps. I am using tapestry 5.2.5 (ComponentClassTransformWorker)
> >>
> >
> >
> >
> > --
> > Regards
> >
> > Taha Hafeez Siddiqi (tawus)
> > http://tawus.wordpress.com
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
>


Re: Class Transformation problem

2011-08-04 Thread Rendy Tapestry
Hi Taha,

Thanks for your response. This my problem in detail,

I am creating a web service using tynamo, in tynamo, they direct us to place
Resource class in rest package. In every service inside the resource, I want
to put an annotation (like your @xhr - ajax graceful degradation) to every
method I want to transform. The transformation itself is simple one, I want
to catch every exeception thrown from invocation.proceed and convert it to a
string. This string will be used to override the result sent to the caller.

Because this package is not the one in controlled package, how do I
accomplish this idea ?

Thanks,
Rendy.

On Thu, Aug 4, 2011 at 10:29 PM, Josh Canfield wrote:

> Also, rest resources can be bound as services to use injection and advice.
> On Aug 4, 2011 8:05 AM, "Taha Hafeez"  wrote:
> > Hi Rendy
> >
> > No ComponentClassTransformWorker will not work outside
> > pages/components package. But class transformation is not the only
> > reason to keep a special packages. You sometime need to scan classes
> > for annotations etc and it is easy if you have specific packages
> > which can be contributed to the scanning service.
> >
> > As far as class transformation is concerned, you can transform an
> > existing class or create a new one by using ClassFab etc classes which
> > are based on javassist in 5.2+ (on PlasticClass etc in 5.3+).
> >
> > Can you elaborate on your problem ?
> >
> > On Thu, Aug 4, 2011 at 7:25 PM, Rendy Tapestry  >
> wrote:
> >> Hi all,
> >>
> >> I have problem with class transformation, my question, will this class
> >> transformation work outside from special package (pages for example). I
> am
> >> using restful integration from tynamo which direct me to put my web
> service
> >> in rest package. Is the package name matter with class transformation ?
> If
> >> yes, how could I solve my problem ?
> >>
> >> Thanks,
> >>
> >> Rendy.
> >>
> >> ps. I am using tapestry 5.2.5 (ComponentClassTransformWorker)
> >>
> >
> >
> >
> > --
> > Regards
> >
> > Taha Hafeez Siddiqi (tawus)
> > http://tawus.wordpress.com
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
>


Class Transformation problem

2011-08-04 Thread Rendy Tapestry
Hi all,

I have problem with class transformation, my question, will this class
transformation work outside from special package (pages for example). I am
using restful integration from tynamo which direct me to put my web service
in rest package. Is the package name matter with class transformation ? If
yes, how could I solve my problem ?

Thanks,

Rendy.

ps. I am using tapestry 5.2.5 (ComponentClassTransformWorker)


Re: javascript & layout problem

2011-07-18 Thread Rendy Tapestry
I was try it, but its still not working.

Thanks,
Rendy.

On Sat, Jul 16, 2011 at 11:26 PM, Taha Tapestry wrote:

> Did you try directly inserting the script in layout by using script tag
> inside head tag
>
> Regards
> Taha
>
> On Jul 16, 2011, at 9:35 PM, Rendy Tapestry 
> wrote:
>
> > Hi Mihail,
> >
> > Thank you for your response. If that is how the correct thing should
> > happened, I will accept it. I come to this question because in Tapestry
> 4, I
> > am using decorator to build a template. In default.jsp I put an import to
> > jquery lib once and never import it again in every page that use the
> > template.
> >
> > Thanks,
> > Rendy
> >
> > 2011/7/16 Михаил Слободянюк 
> >
> >> Hi, Rendy!
> >>
> >> You must import every used script in every page/component class same as
> >> import other used java classes.
> >>
> >> Mihail Slobodyanuk.
> >>
> >> 2011/7/16 Rendy Tapestry 
> >>
> >>> Hi All,
> >>>
> >>> I am using tapestry layout component, in page class I add @Import
> >>> annotation
> >>> to import jquery library. I have another page that is being used along
> >> with
> >>> the layout component and having @Import annotation to import specific
> >>> javascript for that page. That javascript used jquery inside it, the
> >>> problem
> >>> is, jQuery() is not recognized in that script. Solution I have right
> now,
> >>> is
> >>> reimport the same jquery library in the page class, every time I need
> >>> jquery. In my opinion that is bothersome.
> >>>
> >>> Here is the detail :
> >>>
> >>> @Import(library = "context:javascript/jquery-1.6.2.min.js")
> >>> public class Layout
> >>> {
> >>> ...
> >>> }
> >>>
> >>>
> >>> and
> >>> @Import(library = "context:javascript/test.js")
> >>> public class User
> >>> {
> >>> ...
> >>> }
> >>>
> >>> Inside test.js, I used jQuery, but an error show up telling that jQuery
> >> is
> >>> not recognized. But if I change User class to reimport jQuery the
> problem
> >>> solved.
> >>>
> >>> @Import(library = {"context:javascript/jquery-1.6.2.min.js",
> >>> "context:javascript/test.js"})
> >>> public class User
> >>> {
> >>> ...
> >>> }
> >>>
> >>> Any suggestion please ?
> >>>
> >>>
> >>> Thanks,
> >>> Rendy.
> >>>
> >>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: javascript & layout problem

2011-07-16 Thread Rendy Tapestry
Hi Mihail,

Thank you for your response. If that is how the correct thing should
happened, I will accept it. I come to this question because in Tapestry 4, I
am using decorator to build a template. In default.jsp I put an import to
jquery lib once and never import it again in every page that use the
template.

Thanks,
Rendy

2011/7/16 Михаил Слободянюк 

> Hi, Rendy!
>
> You must import every used script in every page/component class same as
> import other used java classes.
>
> Mihail Slobodyanuk.
>
> 2011/7/16 Rendy Tapestry 
>
> > Hi All,
> >
> > I am using tapestry layout component, in page class I add @Import
> > annotation
> > to import jquery library. I have another page that is being used along
> with
> > the layout component and having @Import annotation to import specific
> > javascript for that page. That javascript used jquery inside it, the
> > problem
> > is, jQuery() is not recognized in that script. Solution I have right now,
> > is
> > reimport the same jquery library in the page class, every time I need
> > jquery. In my opinion that is bothersome.
> >
> > Here is the detail :
> >
> > @Import(library = "context:javascript/jquery-1.6.2.min.js")
> > public class Layout
> > {
> > ...
> > }
> >
> >
> > and
> > @Import(library = "context:javascript/test.js")
> > public class User
> > {
> > ...
> > }
> >
> > Inside test.js, I used jQuery, but an error show up telling that jQuery
> is
> > not recognized. But if I change User class to reimport jQuery the problem
> > solved.
> >
> > @Import(library = {"context:javascript/jquery-1.6.2.min.js",
> > "context:javascript/test.js"})
> > public class User
> > {
> > ...
> > }
> >
> > Any suggestion please ?
> >
> >
> > Thanks,
> > Rendy.
> >
>


javascript & layout problem

2011-07-16 Thread Rendy Tapestry
Hi All,

I am using tapestry layout component, in page class I add @Import annotation
to import jquery library. I have another page that is being used along with
the layout component and having @Import annotation to import specific
javascript for that page. That javascript used jquery inside it, the problem
is, jQuery() is not recognized in that script. Solution I have right now, is
reimport the same jquery library in the page class, every time I need
jquery. In my opinion that is bothersome.

Here is the detail :

@Import(library = "context:javascript/jquery-1.6.2.min.js")
public class Layout
{
...
}


and
@Import(library = "context:javascript/test.js")
public class User
{
...
}

Inside test.js, I used jQuery, but an error show up telling that jQuery is
not recognized. But if I change User class to reimport jQuery the problem
solved.

@Import(library = {"context:javascript/jquery-1.6.2.min.js",
"context:javascript/test.js"})
public class User
{
...
}

Any suggestion please ?


Thanks,
Rendy.


Re: Tapestry 5.25 & Spring Integration

2011-06-28 Thread Rendy Tapestry
Chris,

Thank you for your following response. My class defined through spring
applicationContext, and accidentally when doing refactoring of this
applicationContext, some configuration in web.xml also affected. After
fixing this config, everything just fine now.


On Wed, Jun 29, 2011 at 1:46 AM, Christian Köberl <
tapestry.christian.koeb...@gmail.com> wrote:

> On 2011-06-27 13:35, Rendy Tapestry wrote:
>
>> I was follow the instruction here
>> http://tapestry.apache.org/**integrating-with-spring-**framework.html<http://tapestry.apache.org/integrating-with-spring-framework.html>
>> to integrate spring with tapestry.
>>
>> I have one special class that implement Spring's ApplicationContextAware.
>> But when application starting it never invoke
>> setApplicationContext(**ApplicationContext ctx) method. So when my
>> application
>> requiring the class to find specified bean, the program throw null pointer
>> exception.
>>
>
> Is your class a Tapestry service (bound via Module class) or a Spring bean
> (defined in Spring applicationContext.xml)? ApplicationContextAware won't
> work in Tapestry services.
>
> --
> Chris
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Tapestry 5.25 & Spring Integration

2011-06-27 Thread Rendy Tapestry
Hi,

I was follow the instruction here
http://tapestry.apache.org/integrating-with-spring-framework.html
to integrate spring with tapestry.

I have one special class that implement Spring's ApplicationContextAware.
But when application starting it never invoke
setApplicationContext(ApplicationContext ctx) method. So when my application
requiring the class to find specified bean, the program throw null pointer
exception.

It is not the bean that doesn't exist but the applicationContext itself that
never been initialized.

Please help. Thank you.

Rendy

ps. In my case I used default value for
tapestry.use-external-spring-context.