Re: Is there any way to get the selected item's index in loop after layout has been done?

2012-03-14 Thread karthi
I've seen your answer, Thank you very much for continuously helping me... Was
looking for some tapestry code or a trick...

Atlast one of my friends suggest me to add a property called position in
pojo class  set the value of the index to that when setting values for
other items  in tml page inside the loop in the action link asked me to add
t:context=musicItem.pos and get this value as a paramater in java class.
This works great!!



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Is-there-any-way-to-get-the-selected-item-s-index-in-loop-after-layout-has-been-done-tp5557270p5563662.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: Is there any way to get the selected item's index in loop after layout has been done?

2012-03-14 Thread Lance Java
I'm not sure why you would want to pass an index around... surely an id is
better?

eg
t:loop source=videoDatas value=videoItem
   t:pagelink page=someOtherPage t:context=videoItem.videoId /
/t:loop


If you NEED to pass the index (I strongly advise against this, what happens
if you decide to let the user sort the list) then you could do the
following:

t:loop source=videoDatas value=videoItem index=currentIndex
   t:pagelink page=someOtherPage t:context=currentIndex /
/t:loop

As suggested in this thread, I think that this example is what you want
http://jumpstart.doublenegative.com.au/jumpstart/examples/tables/linkingloop1

On Wednesday, 14 March 2012, karthi rathinasamy@snovabits.net wrote:
 I've seen your answer, Thank you very much for continuously helping me...
Was
 looking for some tapestry code or a trick...

 Atlast one of my friends suggest me to add a property called position in
 pojo class  set the value of the index to that when setting values for
 other items  in tml page inside the loop in the action link asked me to
add
 t:context=musicItem.pos and get this value as a paramater in java class.
 This works great!!



 --
 View this message in context:
http://tapestry.1045711.n5.nabble.com/Is-there-any-way-to-get-the-selected-item-s-index-in-loop-after-layout-has-been-done-tp5557270p5563662.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




Getting the HTML markup string from a RenderCommand

2012-03-14 Thread Lance Java
Hi people, there have been a few threads around lately about getting the
HTML string from a block / render command on the serverside including:

http://tapestry.1045711.n5.nabble.com/Rendering-components-in-Alerts-td5543434.html
http://tapestry.1045711.n5.nabble.com/How-does-MultiZoneUpdateEventResultProcessor-get-a-html-string-from-a-RenderCommand-td5518968.html

http://tapestry.1045711.n5.nabble.com/tml-parameter-rendered-into-a-JavaScript-string-td5512889.html

I have come up with what I think to be the most elegant solution.

Please find below the source for a component which does the following:
1. Takes a count parameter and a render command parameter
2. For each count, updates a current property which can be referenced by
the render command and adds the render command to the render queue

3. Removes the elements from the DOM in @AfterRender and uses the HTML in a
javascript alert

Page.html
===
t:tmlToString t:count=5 t:id=tmlToString
p:renderMe
divfoo ${tmlToString.current} bar/div
/p:renderMe
/t:tmlToString

Page.java
===
@InjectComponent
@Property
private TmlToString tmlToString;


TmlToString.java

public class TmlToString {
@Parameter
@Property
private RenderCommand renderMe;

@Property
@Parameter(defaultPrefix=BindingConstants.LITERAL, required=true)
private int count;

@Property
private int current;

@Inject
private JavaScriptSupport javaScriptSupport;

private Element wrappingDiv;

@BeginRender
RenderCommand beginRender() {
return new RenderCommand() {
public void render(MarkupWriter writer, RenderQueue
queue) {
wrappingDiv = writer.element(div);
ListRenderCommand commands = new
ArrayListRenderCommand();
for (int i = 0; i  count; ++ i) {
final int finalI = i;
commands.add(new RenderCommand() {
public void
render(MarkupWriter writer2, RenderQueue queue2) {
current = finalI;

queue2.push(renderMe);
}
});
}
Collections.reverse(commands);
for (RenderCommand command : commands) {
queue.push(command);
}
}
};
}

@AfterRender
void afterRender(MarkupWriter writer) {
writer.end();
String html = wrappingDiv.getChildMarkup();
wrappingDiv.remove();
javaScriptSupport.addScript(alert(\%s\), html);
}
}

Result
==
alert(divfoo 0 bar/divdivfoo 1 bar/divdivfoo 2 bar/divdivfoo
3 bar/divdivfoo 4 bar/div);


Cheers,
Lance.


Re: Rendering components in Alerts

2012-03-14 Thread Lance Java
See
http://tapestry.1045711.n5.nabble.com/Getting-the-HTML-markup-string-from-a-RenderCommand-td5564418.html

On Thursday, 8 March 2012, Magnus Kvalheim mag...@kvalheim.dk wrote:
 Thanks Kalle,

 For alerts I created issue:
https://issues.apache.org/jira/browse/TAP5-1863


 For the more general renderer for blocks:
 https://issues.apache.org/jira/browse/TAP5-1864

 --magnus

 On Wed, Mar 7, 2012 at 8:20 PM, Kalle Korhonen
 kalle.o.korho...@gmail.comwrote:

 On Wed, Mar 7, 2012 at 12:17 AM, Magnus Kvalheim mag...@kvalheim.dk
 wrote:
  We've just upgraded to 5.3.2 and checked out some of the new
components.
  The Alerts seems pretty useful, but looks like it's only possible to
pass
  on strings.
  I'm thinking a pretty common use-case would be to render some
  components/markup in it - like links.
  I experimented a little by manually rendering a block and pass that on
to
  alertManager. Got some inspiration from this thread about rendering
 blocks
  *alertManager.info(markupWriter.toString());*
  That seems to work, but it's a bit clumsy and don't know if it's
  the recommended approach for rendering blocks. Does a convenience
method
  exist for rendering blocks/components?
  Not sure if it's possible, but how about if one could pass blocks to
 alerts
  directly. That could be pretty flexible as well...

 Certainly the recommended approach is to use the provided render
 queue, rather than create your own - but obviously the current
 implementation doesn't always allow to do so. Completely agree with
 you that rendering links, and, in general, rendering blocks would be
 very useful for alerts. I don't see any major issue why it couldn't be
 supported. Please open an issue for it.

 Kalle

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





Re: tml parameter rendered into a JavaScript string

2012-03-14 Thread Lance Java
See
http://tapestry.1045711.n5.nabble.com/Getting-the-HTML-markup-string-from-a-RenderCommand-td5564418.html

On Friday, 24 February 2012, Lance Java lance.j...@googlemail.com wrote:
 I am writing a google maps component which can display markers on a map,
each marker has an info window when it is clicked on. I'd like to pass a
parameter to the component containing the tml to render each marker's info
window.

 eg:

 Page.java
 
 @InjectComponent
 @Property
 GoogleMap mygooglemap

 public ListGoogleMapMarker getMarkers() {
...
 }

 Page.tml
 
 t:googlemap markers=markers t:id=mygooglemap
p:infowindow
   div
style=infowindow-title${mygooglemap.currentmarker.data.title}/div
   div
style=infowindow-body${mygooglemap.currentmarker.data.body}/div
/p:infowindow
 /t:googlemap

 The only thing is that the google maps api wants each marker's infowindow
html to be a javascript string so I somehow need to use tapestry's template
engine to generate strings for each marker's infowindow which I can then
use to generate javascript.

 I have seen that the new Tree component can accept a label property
which allows the user to provide a custom template for rendering each
label. The label parameter is of type RenderCommand and RenderCommand has a
single method:

 void render(MarkupWriter writer, RenderQueue queue);

 So, I was hoping that I could do the same sort of thing except that
instead of rendering to the response MarkupWriter, I could pass an empty
MarkupWriter to this method and then extract the generated markup somehow
into a string to then use it to generate my javascript.

 Has anyone done this sort of thing before?
 Am I on the right track or is there a simpler way?


T5.2.6 jquery2.6.0 jquery dialog close from included component

2012-03-14 Thread resign
Hi,
is it possible to close the jquery dialog from included coponent?

...
t:jquery.dialog t:clientId=myDialog t:params=dialogParam
div id=searchSC 
t:searchScForContactComponent  smdId=smdId /
/div
/t:jquery.dialog
...

Thanks,
resign

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-2-6-jquery2-6-0-jquery-dialog-close-from-included-component-tp5564657p5564657.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.2.6 jquery2.6.0 jquery dialog close from included component

2012-03-14 Thread Demey Emmanuel
How do you want to close it ? with a link ?

$('selector). .dialog( close ) in JavaScript

http://jqueryui.com/demos/dialog/

Manu



-Message d'origine-
De : resign [mailto:sergejb...@yahoo.de]
Envoyé : mercredi 14 mars 2012 14:19
À : users@tapestry.apache.org
Objet : T5.2.6 jquery2.6.0 jquery dialog close from included component

Hi,
is it possible to close the jquery dialog from included coponent?

...
t:jquery.dialog t:clientId=myDialog t:params=dialogParam
div id=searchSC
t:searchScForContactComponent  smdId=smdId /
/div
/t:jquery.dialog
...

Thanks,
resign

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-2-6-jquery2-6-0-jquery-dialog-close-from-included-component-tp5564657p5564657.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




Ce message et les pièces jointes sont confidentiels et réservés à l'usage 
exclusif de ses destinataires. Il peut également être protégé par le secret 
professionnel. Si vous recevez ce message par erreur, merci d'en avertir 
immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant 
être assurée sur Internet, la responsabilité d'Atos ne pourra être recherchée 
quant au contenu de ce message. Bien que les meilleurs efforts soient faits 
pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne 
aucune garantie à cet égard et sa responsabilité ne saurait être recherchée 
pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for 
the addressee; it may also be privileged. If you receive this e-mail in error, 
please notify the sender immediately and destroy it. As its integrity cannot be 
secured on the Internet, the Atos liability cannot be triggered for the message 
content. Although the sender endeavours to maintain a computer virus-free 
network, the sender does not warrant that this transmission is virus-free and 
will not be liable for any damages resulting from any virus transmitted.


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



RE: T5.2.6 jquery2.6.0 jquery dialog close from included component

2012-03-14 Thread resign
hi Manu,

in my component i have a form.
And onFail the dialog should stay on top, onSuccess the dialog should
disappear.

Thanks,
resign

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-2-6-jquery2-6-0-jquery-dialog-close-from-included-component-tp5564657p5564685.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.2.6 jquery2.6.0 jquery dialog close from included component

2012-03-14 Thread WINDEY Pieter AWL-IT
Just put your form in a zone, on error - return zone
On success - return page

-Original Message-
From: resign [mailto:sergejb...@yahoo.de]
Sent: Wednesday 14 March 2012 14:29
To: users@tapestry.apache.org
Subject: RE: T5.2.6 jquery2.6.0 jquery dialog close from included component

hi Manu,

in my component i have a form.
And onFail the dialog should stay on top, onSuccess the dialog should
disappear.

Thanks,
resign

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-2-6-jquery2-6-0-jquery-dialog-close-from-included-component-tp5564657p5564685.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




Atos Worldline SA/NV - Chaussee de Haecht 1442 Haachtsesteenweg
- 1130 Brussels - Belgium
RPM-RPR Bruxelles-Brussel - TVA-BTW BE 0418.547.872
Bankrekening-Compte Bancaire-Bank Account 310-0269424-44
BIC BBRUBEBB - IBAN BE55 3100 2694 2444

The information contained in this e-mail and any attachment thereto is 
confidential and may contain information which is protected by intellectual 
property rights.
This information is intended for the exclusive use of the recipient(s) named 
above.
This e-mail does not constitute any binding relationship or offer toward any of 
the addressees.
If you are not one of the addressees , one of their employees or a proxy holder 
entitled to hand over this message to the addressee(s), any use of the 
information contained herein (e.g. reproduction, divulgation, communication or 
distribution,...) is prohibited.
If you have received this message in error, please notify the sender and 
destroy it immediately after.
The integrity and security of this message cannot be guaranteed and it may be 
subject to data corruption, interception and unauthorized amendment, for which 
we accept no liability.


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



RE: T5.2.6 jquery2.6.0 jquery dialog close from included component

2012-03-14 Thread resign
pieter...you are my hero 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-2-6-jquery2-6-0-jquery-dialog-close-from-included-component-tp5564657p5564817.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: Zone update triggers update on parent Zone

2012-03-14 Thread nquirynen
Ok, 
thanks for the explanation, also on the constructing of zone updates.

I tested it with the time and your right. Is there any way I can know if in
the ZONE_UPDATED_EVENT of the inner zone (zone1) comes from a zone1 or zone2
update? Because I have javascript code in the zone1 update event, that
should not be fired everytime zone2 is updated.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Zone-update-triggers-update-on-parent-Zone-tp5541247p5564937.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: Zone update triggers update on parent Zone

2012-03-14 Thread nquirynen
Found a solution for my problem (not sure if it's a good solution, but it
works):


In the update event of the parent zone (zone1 in my example) I added an if
statement to know if it's not just an inner zone that's getting updated:

$('#zone1').bind(Tapestry.ZONE_UPDATED_EVENT, function(event) { 
   if(event.target['id'] == 'zone1) {
// do stuff only when zone 1 is getting updated
   }
}); 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Zone-update-triggers-update-on-parent-Zone-tp5541247p5564976.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: Getting the HTML markup string from a RenderCommand

2012-03-14 Thread Lenny Primak
Can you put this up in the Tapestry Wiki?
It's trivial to do and IMHO very useful
On Mar 14, 2012, at 8:11 AM, Lance Java wrote:

 Hi people, there have been a few threads around lately about getting the
 HTML string from a block / render command on the serverside including:
 
 http://tapestry.1045711.n5.nabble.com/Rendering-components-in-Alerts-td5543434.html
 http://tapestry.1045711.n5.nabble.com/How-does-MultiZoneUpdateEventResultProcessor-get-a-html-string-from-a-RenderCommand-td5518968.html
 
 http://tapestry.1045711.n5.nabble.com/tml-parameter-rendered-into-a-JavaScript-string-td5512889.html
 
 I have come up with what I think to be the most elegant solution.
 
 Please find below the source for a component which does the following:
 1. Takes a count parameter and a render command parameter
 2. For each count, updates a current property which can be referenced by
 the render command and adds the render command to the render queue
 
 3. Removes the elements from the DOM in @AfterRender and uses the HTML in a
 javascript alert
 
 Page.html
 ===
t:tmlToString t:count=5 t:id=tmlToString
p:renderMe
divfoo ${tmlToString.current} bar/div
/p:renderMe
/t:tmlToString
 
 Page.java
 ===
@InjectComponent
@Property
private TmlToString tmlToString;
 
 
 TmlToString.java
 
 public class TmlToString {
@Parameter
@Property
private RenderCommand renderMe;
 
@Property
@Parameter(defaultPrefix=BindingConstants.LITERAL, required=true)
private int count;
 
@Property
private int current;
 
@Inject
private JavaScriptSupport javaScriptSupport;
 
private Element wrappingDiv;
 
@BeginRender
RenderCommand beginRender() {
return new RenderCommand() {
public void render(MarkupWriter writer, RenderQueue
 queue) {
wrappingDiv = writer.element(div);
ListRenderCommand commands = new
 ArrayListRenderCommand();
for (int i = 0; i  count; ++ i) {
final int finalI = i;
commands.add(new RenderCommand() {
public void
 render(MarkupWriter writer2, RenderQueue queue2) {
current = finalI;
 
 queue2.push(renderMe);
}
});
}
Collections.reverse(commands);
for (RenderCommand command : commands) {
queue.push(command);
}
}
};
}
 
@AfterRender
void afterRender(MarkupWriter writer) {
writer.end();
String html = wrappingDiv.getChildMarkup();
wrappingDiv.remove();
javaScriptSupport.addScript(alert(\%s\), html);
}
 }
 
 Result
 ==
 alert(divfoo 0 bar/divdivfoo 1 bar/divdivfoo 2 bar/divdivfoo
 3 bar/divdivfoo 4 bar/div);
 
 
 Cheers,
 Lance.


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



Re: Server Side Validation with ajax form loop

2012-03-14 Thread George Christman
Hi David, I created a jira issue related to this bug. 

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

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Server-Side-Validation-with-ajax-form-loop-tp5120576p5565297.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: Getting the HTML markup string from a RenderCommand

2012-03-14 Thread Lance Java
I've added a wiki page here
http://wiki.apache.org/tapestry/Tapestry5HowToGetAnHTMLStringFromARenderCommandParameter

On Wednesday, 14 March 2012, Lenny Primak lpri...@hope.nyc.ny.us wrote:
 Can you put this up in the Tapestry Wiki?
 It's trivial to do and IMHO very useful
 On Mar 14, 2012, at 8:11 AM, Lance Java wrote:

 Hi people, there have been a few threads around lately about getting the
 HTML string from a block / render command on the serverside including:


http://tapestry.1045711.n5.nabble.com/Rendering-components-in-Alerts-td5543434.html

http://tapestry.1045711.n5.nabble.com/How-does-MultiZoneUpdateEventResultProcessor-get-a-html-string-from-a-RenderCommand-td5518968.html


http://tapestry.1045711.n5.nabble.com/tml-parameter-rendered-into-a-JavaScript-string-td5512889.html

 I have come up with what I think to be the most elegant solution.

 Please find below the source for a component which does the following:
 1. Takes a count parameter and a render command parameter
 2. For each count, updates a current property which can be referenced
by
 the render command and adds the render command to the render queue

 3. Removes the elements from the DOM in @AfterRender and uses the HTML
in a
 javascript alert

 Page.html
 ===
t:tmlToString t:count=5 t:id=tmlToString
p:renderMe
divfoo ${tmlToString.current} bar/div
/p:renderMe
/t:tmlToString

 Page.java
 ===
@InjectComponent
@Property
private TmlToString tmlToString;


 TmlToString.java
 
 public class TmlToString {
@Parameter
@Property
private RenderCommand renderMe;

@Property
@Parameter(defaultPrefix=BindingConstants.LITERAL, required=true)
private int count;

@Property
private int current;

@Inject
private JavaScriptSupport javaScriptSupport;

private Element wrappingDiv;

@BeginRender
RenderCommand beginRender() {
return new RenderCommand() {
public void render(MarkupWriter writer,
RenderQueue
 queue) {
wrappingDiv = writer.element(div);
ListRenderCommand commands = new
 ArrayListRenderCommand();
for (int i = 0; i  count; ++ i) {
final int finalI = i;
commands.add(new RenderCommand() {
public void
 render(MarkupWriter writer2, RenderQueue queue2) {
current = finalI;

 queue2.push(renderMe);

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




Difference between tml and java importing js

2012-03-14 Thread TechniciuM
Hi, as title denotes, I would like to know what is the difference between tml
and java importing javascript. Examples shown below.

JAVA page
@Import(library=../dimitriy/bogdanov/bootstrap-dropdown.js)

and 

TML page


Discussion about this topic is appreciated. :)

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Difference-between-tml-and-java-importing-js-tp5565945p5565945.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: Difference between tml and java importing js

2012-03-14 Thread Michael Gentry
How about this, instead:

JAVA *component*
@Import(library=../dimitriy/bogdanov/bootstrap-dropdown.js)

and

TML *component*

If your component is rendered multiple times in a page, then the TML
method will import the JS repeatedly.  Tapestry is smart enough, even
in the Java component, to know if it has already been imported and not
import it multiple times.  This applies to CSS, too.

mrg


On Wed, Mar 14, 2012 at 3:40 PM, TechniciuM a1098...@rppkn.com wrote:
 Hi, as title denotes, I would like to know what is the difference between tml
 and java importing javascript. Examples shown below.

 JAVA page
 @Import(library=../dimitriy/bogdanov/bootstrap-dropdown.js)

 and

 TML page


 Discussion about this topic is appreciated. :)

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Difference-between-tml-and-java-importing-js-tp5565945p5565945.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



[t5.3.1 - AjaxFormLoop] How to prevent removing the last row ?

2012-03-14 Thread Muhammad Gelbana
Greetings to this magnificent mailing list and tapestry developers :)

I have a perfectly operating ajax form loop but I'm trying to find a way to
prevent the user from removing the last row in the form.
In an annotated method to handle the remove row events from the ajax form
loop, I've done the proper checks and tried returning false and null but
nothing worked. Has anyone done this before ?

My goal is to prevent the removal of the last ajax form loop row and
display a java script alert to clarify the error.

Thanks.

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


Re: Zone update triggers update on parent Zone

2012-03-14 Thread Paul Stanton
like i said, this could be a bug. why not log it in jira and see what 
the big heads think?


On 15/03/2012 1:44 AM, nquirynen wrote:

Found a solution for my problem (not sure if it's a good solution, but it
works):


In the update event of the parent zone (zone1 in my example) I added an if
statement to know if it's not just an inner zone that's getting updated:

$('#zone1').bind(Tapestry.ZONE_UPDATED_EVENT, function(event) {
if(event.target['id'] == 'zone1) {
 // do stuff only when zone 1 is getting updated
}
});

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Zone-update-triggers-update-on-parent-Zone-tp5541247p5564976.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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




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



Capturing user input data

2012-03-14 Thread Az Madu
Hi guys,

I have a query about how to capture data from a tml page and pass it back
into it's corresponding java file so that it can be processed and displayed
on another new page (or even on the same page after redrawing the same
page).

I have 2 pages currently, Page1.java and Page2.java where Page1 sets up
some information and passes it to Page2 by way of a service that I've
created for an external application in the AppModule.  Page1 simply has an
onActionFromStart method with a link that returns Page2 and on Page2 I
display an authentication dialog (username/password) inside an iFrame in
the page2.tml created by the service created in AppModule.

Now what I want to know how to do is to capture the users' 'username' so
that I can store it in a field on Page2.java and then pass it to a new page
(Page3.java) to indicate to the user that they have successfully
authenticated by displaying the username they entered and their sessionid.

On my Page2 do I make use of RequestGlobals (can I get such information
from this) or do I make use of any other classes in the Tapestry library
that I'm not aware of.  I'm still relatively new to how it all works and
I've managed to pass data to my tml pages (thanks to Thiago for earlier
assistance) but now I need a return ticket so to speak :-).

So my questions are:

1 - Can I capture data input (a username) from a tml page and pass it back
into the .java file bearing in mind I don't know the name of the field into
which the username is being entered, only that it is inside an iFrame
object.
2 - How do I extract this information along with any other that I may want
and display it on a new page (Page3.java).  Since I have no links to click
how would this captured data result in the creating of Page3.java?  Could I
use :

public class Page2{

@InjectPage private Page3 page3

@SessionAttribute
private String userName

Object onSomeMethodName(){ //how would this be called, should I use
onPassivate()?
page3.initialise(userName, sessionid); //for example
return page3;
}
}

I've asked many question so I'm grateful for any assistance from Tapestry
users.

Regards

Az


Tapestry-jpa 5.3 vs Tapestry-Hibernate

2012-03-14 Thread George Christman
Hello everyone, I figured it's been a while since this topic has been brought
up, so I'd like to come back to it again. I've finally managed to find some
free time to play with my personal project yay, which means I'll be doing
a full rewrite. I'd like to hear what Tapestry-JPA users have to say about
it in comparison to hibernate. For the past couple years, I've used
Tapestry-Hibernate which has been really nice to work with, however I was
recently turned on to Tapestry-JPA. I was told I wouldn't need to use value
encoders with Tapestry-JPA, something I need to do all the time with
Hibernate. This seemed pretty appealing, is there any other advantages I
should know about? Thanks Guys. 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-jpa-5-3-vs-Tapestry-Hibernate-tp5566580p5566580.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: Tapestry-jpa 5.3 vs Tapestry-Hibernate

2012-03-14 Thread Robert Zeigler
Disclaimer: I haven't used tapestry-jpa. :)
But, Tapestry uses value encoders. tapestry-hibernate uses them, tapestry-jpa 
uses them.
Tapestry uses them. The only question is whether you need to write custom value 
encoders.
tapestry-hibernate will provide default encoders for entities with a single pk 
column.
tapestry-jpa can evidently handle multi-column pks. 

So you'll write fewer custom value encoders with tapestry-jpa than you 
will/might otherwise with tapestry-hibernate.

Not sure about other advantages.

HTH,

Robert

On Mar 14, 2012, at 3/147:10 PM , George Christman wrote:

 Hello everyone, I figured it's been a while since this topic has been brought
 up, so I'd like to come back to it again. I've finally managed to find some
 free time to play with my personal project yay, which means I'll be doing
 a full rewrite. I'd like to hear what Tapestry-JPA users have to say about
 it in comparison to hibernate. For the past couple years, I've used
 Tapestry-Hibernate which has been really nice to work with, however I was
 recently turned on to Tapestry-JPA. I was told I wouldn't need to use value
 encoders with Tapestry-JPA, something I need to do all the time with
 Hibernate. This seemed pretty appealing, is there any other advantages I
 should know about? Thanks Guys. 
 
 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Tapestry-jpa-5-3-vs-Tapestry-Hibernate-tp5566580p5566580.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 


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



Re: Tapestry-jpa 5.3 vs Tapestry-Hibernate

2012-03-14 Thread George Christman
Thanks Robert for your reply. Yes I was referring to custom value encoders,
perhaps I'm misusing them. I seem to be writing custom value encoders for
components like the AjaxAddRow which is nothing more than a single column
pk. The reason I use them is to generate a temp id 's for the component to
use. I was hoping to get away from writing custom value encoders for simple
component implementations like the one stated above. 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-jpa-5-3-vs-Tapestry-Hibernate-tp5566580p5566606.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: Tapestry-jpa 5.3 vs Tapestry-Hibernate

2012-03-14 Thread Robert Zeigler
Not sure how tapestry-jpa handles un-persisted instances. That is certainly 
another area where tapestry-hibernate does not give you a useable ValueEncoder.
To clarify my last post: tapestry-hibernate will give you a functional default 
value encoder if:
  1) The entity has a single column pk
  2) The entity is persistent

Robert

On Mar 14, 2012, at 3/147:28 PM , George Christman wrote:

 Thanks Robert for your reply. Yes I was referring to custom value encoders,
 perhaps I'm misusing them. I seem to be writing custom value encoders for
 components like the AjaxAddRow which is nothing more than a single column
 pk. The reason I use them is to generate a temp id 's for the component to
 use. I was hoping to get away from writing custom value encoders for simple
 component implementations like the one stated above. 
 
 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Tapestry-jpa-5-3-vs-Tapestry-Hibernate-tp5566580p5566606.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 


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



memory leaks

2012-03-14 Thread dick_hu
Live Class and Template Reloading
One of the great features of Tapestry 5 is automatic reloading of changed
classes and templates. Page and component classes will automatically reload
when changed. Likewise, changes to component templates and other related
resources will also be picked up immediately. In addition, starting in
version 5.2, your service classes will also be reloaded automatically after
changes (if you're using Tapestry IoC).

above is from the Apache Tapestry  Documentation  User Guide  Class
Reloading 

there is trouble always with me, when I change a page or a component  ofen
cause significant memory leaks
and I must restart the server.

Is there any way to solve that.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/memory-leaks-tp5566822p5566822.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: xhr requests and thread safety

2012-03-14 Thread Paul Stanton
In our application, many ajax requests are processed in the same 
session, sometimes causing conflicts when they update shared session 
information. I found synchronizing the logic within my event handlers to 
be useless since many components access shared objects from property 
bindings within the tml - outside of the scope of my synchronized block.


In order to combat this globally, I am considering synchronizing all 
component event requests on the session:


public static void 
contributeAjaxComponentEventRequestHandler(OrderedConfigurationComponentEventRequestFilter 
configuration)

{
configuration.addInstance(SessionSynch, 
SessionSynchFilter.class);

}


public class SessionSynchFilterimplements ComponentEventRequestFilter
{
@Inject
private HttpServletRequest request;

@Override
public void handle(ComponentEventRequestParameters parameters, 
ComponentEventRequestHandler handler) throws IOException

{
synchronized (request.getSession())
{
handler.handle(parameters);
}
}
}

Is this a crazy approach?

Thanks, Paul.

On 30/12/2011 3:43 PM,  Josh Canfield wrote:

unless you're dealing with concurrent requests to objects in a users
session. When you're dealing with shared resources, protecting them
from concurrent access is in the developers hands. 


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