RE: Submitting id value of a t:select component onChange

2013-08-22 Thread Lance Java
If you are generating a placeholder serverside and replacing it clientside,
there's no need to use a request parameter. You can just use the event
context.

You only need a request parameter when appending to the URL in javascript
rather than replacing a token.

Note that if you have ValueEncoders registered for your types, you don't
need to worry about String / Integer id's… you can use your domain objects
/ enums etc instead and let tapestry do the conversion for you.


PageActivationContext issue

2013-08-22 Thread nn kk
 Hi,
I have the following code:
class Page1 {

  @InjectPage
  private Page2 page2;
  ...

  Object onSuccessFrom...() {
...
ListCat catList = new ArrayList...
catList.add(cat1);
catList.add(cat2);

page2.setCatList(catList);
return page2;
  }
}

class Page2 {
   @PageActivationContext
   @Property(write = false)
   private ListCat catList;

   public void setBaList(ListCat catList) {
 this.catList= catList;
   }

   void onActivate() {
//catList is null   
   }

   void onActivate(ListCat catList)
   {
//catList is null   
   }

  void setupRender() {
//catList is null   
  }
}


If I replace @PageActivationContext with @Persist, I see the list populated, 
but I don't understand how should I use the @PageActivationContext 


-
Само сега спечели смартфон SAMSUNG и още много награди!виж
http://www.specheli.eu/specheli-textgbg.php

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



Re: PageActivationContext issue

2013-08-22 Thread Lance Java
I think I had issues trying to use an array / collection as an EventContext
item. I think I had to resort to using a comma separated string from
memory.
On 22 Aug 2013 15:03, nn kk inv...@abv.bg wrote:

  Hi,
 I have the following code:
 class Page1 {

   @InjectPage
   private Page2 page2;
   ...

   Object onSuccessFrom...() {
 ...
 ListCat catList = new ArrayList...
 catList.add(cat1);
 catList.add(cat2);

 page2.setCatList(catList);
 return page2;
   }
 }

 class Page2 {
@PageActivationContext
@Property(write = false)
private ListCat catList;

public void setBaList(ListCat catList) {
  this.catList= catList;
}

void onActivate() {
 //catList is null
}

void onActivate(ListCat catList)
{
 //catList is null
}

   void setupRender() {
 //catList is null
   }
 }


 If I replace @PageActivationContext with @Persist, I see the list
 populated, but I don't understand how should I use the
 @PageActivationContext


 -
 Само сега спечели смартфон SAMSUNG и още много награди!виж
 http://www.specheli.eu/specheli-textgbg.php

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




Re: PageActivationContext issue

2013-08-22 Thread Lance Java
In your case, I think you will be able to fix it by.

1. Remove @PageActivationContext
2. Add onActivate(EventContext ec)
3. Add ListCat onPassivate()

On 22 Aug 2013 15:18, Lance Java lance.j...@googlemail.com wrote:

 I think I had issues trying to use an array / collection as an
EventContext item. I think I had to resort to using a comma separated
string from memory.


How to implement simple error/exception handling

2013-08-22 Thread nn kk
 Hi,
I read about exceptions and error handling in tapestry, but still can not find 
the best way, to send messages to front-end. I want to be able to send 
exception messages and error codes, as I can do it in jquary ajax success or 
error blocks. When I throw some custom exception I don't want to redirect to 
the exception page, but to show the message in pop-up to the user. Or to send 
different completion messages and to display them in dialogs. I managed to open 
dialogs with callbacks of ajax object as here:
 ajaxResponseRenderer.addCallback(new JavaScriptCallback() {

@Override
public void run(JavaScriptSupport 
javaScriptSupport) {

javaScriptSupport.addScript(showErrorModal(););
}
})

, but still can not make it enough generic. And it is not working working when 
I submit the whole page.

-
Само сега спечели смартфон SAMSUNG и още много награди!виж
http://www.specheli.eu/specheli-textgbg.php

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



Re: How to implement simple error/exception handling

2013-08-22 Thread Martin Kersten
This is outside the scope of Tapestry (or at least as far as I am aware
off). Take a look at this example:

http://jumpstart.doublenegative.com.au/jumpstart/together/easycrud/persons

If you hit the Delete on any row it opens a modal dialog asking you whether
or not the item should be really deleted. In your case you need a info box
with a meaningful Information message explaining the error to the user.

You can use jQuery UI for this (check the jQuery for Tapestry modul) or use
what they used in the above example. The Keypart is confirm.js here.

If you need a tapestry only usage you might want to consider a component /
mixin that is returned in case of a XHR request (ajax) and opens the
infobox and vanishes (removes itself from the DOM) after the ok button was
clicked. I dont know if such a component exist and the use would be limited
to zone updates and alike. Also I am not aware of Tapestry providing such a
component (or something similar).

Lets wait what the Tapestry Pros come up with.


2013/8/22 nn kk inv...@abv.bg

  Hi,
 I read about exceptions and error handling in tapestry, but still can not
 find the best way, to send messages to front-end. I want to be able to send
 exception messages and error codes, as I can do it in jquary ajax success
 or error blocks. When I throw some custom exception I don't want to
 redirect to the exception page, but to show the message in pop-up to the
 user. Or to send different completion messages and to display them in
 dialogs. I managed to open dialogs with callbacks of ajax object as here:
  ajaxResponseRenderer.addCallback(new
 JavaScriptCallback() {

 @Override
 public void run(JavaScriptSupport
 javaScriptSupport) {

 javaScriptSupport.addScript(showErrorModal(););
 }
 })

 , but still can not make it enough generic. And it is not working working
 when I submit the whole page.

 -
 Само сега спечели смартфон SAMSUNG и още много награди!виж
 http://www.specheli.eu/specheli-textgbg.php

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




TransactionHandling

2013-08-22 Thread Martin Kersten
Hi there,

   I just wonder how Tapestry handles nested transactions. From the
@CommitAfter annotation one learns that there is no such detection unless
we are using a PersistenceContext.

This seams to be unimpropriated.

I want something like this (Similar to the Spring transactional annotation).

I want a method to define a transaction by begin on start and commit /
roolback on the end. If a method is called doing the same the inner
'transaction' is treated as part of the outertransaction so actually it is
ignoredl

Currently @CommitAfter is definied to commit the transaction on the end of
the mehtod.

Since there is a PersistenceContext, I asked myself if I can get the ignore
inner transaction pattern?



Thanks,

Martin (Kersten),
Germany


[ANNOUNCEMENT] tynamo-federatedaccounts 0.4.3 released!

2013-08-22 Thread Kalle Korhonen
Federatedaccounts takes another leap forward by integrating with a new,
Scribe-based module, Pac4j by Jérôme Leleu https://github.com/leleuj/pac4j.
See, the problem with Scribe, and Oauth in general, is that there's no
standard way of getting any unique identifier with Oauth (unlike in
OpenID). So there are several different provider specific extension and it
quickly becomes a mess (read what the author of Scribe thinks about
thishttps://github.com/fernandezpablo85/scribe-java/wiki/Scribe-scope-revised).
Anyway, it's great somebody, and in this case, Jérôme, still bothers to
generalize the approach because otherwise I would have needed to do it. The
new Federated Accounts module, tynamo-federatedaccounts-pac4jbasedoauth,
simply provides UI components (Oauth sign in components, callback pages)
around Pac4j, handles the Oauth all automatically and bakes in
Tapestry-style configuration around it so all you need to do is to just add
your Oauth app credentials for your provider of choice. The primary use
case for the new module is authentication and user profile federation, for
other uses cases, you typically still want to use provider specific APIs
and libraries. Documentation is also updated although a bit thin still.
Read more at tynamo-federatedaccounts
guidehttp://docs.codehaus.org/display/TYNAMO/tynamo-federatedaccounts+guide
.

Release notes:
Improvement

   - [TYNAMO-211 http://jira.codehaus.org/browse/TYNAMO-211] - Allow
   parametrized configuration in federated login components for setting
   rememberMe in the token
   - [TYNAMO-220 http://jira.codehaus.org/browse/TYNAMO-220] - Implement
   rolling tokens support for federated accounts
   - [TYNAMO-181 http://jira.codehaus.org/browse/TYNAMO-181] - Implement
   DefaultJpaFederatedAccountServiceImpl
   - [TYNAMO-182 http://jira.codehaus.org/browse/TYNAMO-182] - Support
   GitHub federated login

New Feature

   - [TYNAMO-93 http://jira.codehaus.org/browse/TYNAMO-93] - Support for
   Google OAuth 2.0

Bug

   - [TYNAMO-217 http://jira.codehaus.org/browse/TYNAMO-217] -
   returnPageName is required since there's no defaultReturnPage prop in
   AbstractOauthSignIn


Enjoy,

Tynamo Team


Re: [ANNOUNCEMENT] tynamo-federatedaccounts 0.4.3 released!

2013-08-22 Thread Howard Lewis Ship
Terrific work as always!


On Thu, Aug 22, 2013 at 4:43 PM, Kalle Korhonen
kalle.o.korho...@gmail.comwrote:

 Federatedaccounts takes another leap forward by integrating with a new,
 Scribe-based module, Pac4j by Jérôme Leleu 
 https://github.com/leleuj/pac4j.
 See, the problem with Scribe, and Oauth in general, is that there's no
 standard way of getting any unique identifier with Oauth (unlike in
 OpenID). So there are several different provider specific extension and it
 quickly becomes a mess (read what the author of Scribe thinks about
 this
 https://github.com/fernandezpablo85/scribe-java/wiki/Scribe-scope-revised
 ).
 Anyway, it's great somebody, and in this case, Jérôme, still bothers to
 generalize the approach because otherwise I would have needed to do it. The
 new Federated Accounts module, tynamo-federatedaccounts-pac4jbasedoauth,
 simply provides UI components (Oauth sign in components, callback pages)
 around Pac4j, handles the Oauth all automatically and bakes in
 Tapestry-style configuration around it so all you need to do is to just add
 your Oauth app credentials for your provider of choice. The primary use
 case for the new module is authentication and user profile federation, for
 other uses cases, you typically still want to use provider specific APIs
 and libraries. Documentation is also updated although a bit thin still.
 Read more at tynamo-federatedaccounts
 guide
 http://docs.codehaus.org/display/TYNAMO/tynamo-federatedaccounts+guide
 .

 Release notes:
 Improvement

- [TYNAMO-211 http://jira.codehaus.org/browse/TYNAMO-211] - Allow
parametrized configuration in federated login components for setting
rememberMe in the token
- [TYNAMO-220 http://jira.codehaus.org/browse/TYNAMO-220] - Implement
rolling tokens support for federated accounts
- [TYNAMO-181 http://jira.codehaus.org/browse/TYNAMO-181] - Implement
DefaultJpaFederatedAccountServiceImpl
- [TYNAMO-182 http://jira.codehaus.org/browse/TYNAMO-182] - Support
GitHub federated login

 New Feature

- [TYNAMO-93 http://jira.codehaus.org/browse/TYNAMO-93] - Support for
Google OAuth 2.0

 Bug

- [TYNAMO-217 http://jira.codehaus.org/browse/TYNAMO-217] -
returnPageName is required since there's no defaultReturnPage prop in
AbstractOauthSignIn


 Enjoy,

 Tynamo Team




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


Need help: in displaying text with html character entities and new line

2013-08-22 Thread Giridhar reddy
Hello,

I have the input string which contains price range10-100\n least price =
20

I need the output as:
price range10-100
least price=20

I tried jwcid=@InsertText. But, it is still printing the output in one line
as
price range10-100\nleastprice=20

If I keep raw=true, I am not getting replaced  with lt. again, output is
not coming as expected.

Any ideas over this how to get the desired output.

Thanks!
Giri