You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by arterzatij <ar...@gmail.com> on 2012/04/24 17:22:47 UTC

Tapestry-jQuery

Hi all,

   Just a quick question, how do I do to make dinamic content in an
accordion component.


Thanks!

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-jQuery-tp5662365p5662365.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Tapestry-jQuery

Posted by Chris Mylonas <ch...@opencsta.org>.
That last email was all tapestry5-jquery.  It was a copy of the jqueryui.com demo as an example.
All you have to do is substitute where <h3> begins with your loop.

HTH :D

On 25/04/2012, at 1:43 AM, arterzatij wrote:

> Hi, I actually did in this way an it works, but I want to use the jquery
> accordion provided on Tapestry-Jquery...
> 
> <div id="accordion">
> 	<t:loop t:source="nodes" t:value="node">
> 		
> 
> 			 # ${node.name} 
> 		
> 
> 		<div>
> 			<ul>
> 				<t:loop t:source="node.children" t:value="nodeChild">
> 					<li>
> 						${nodeChild.content}
> 					</li>
> 				</t:loop>
> 			</ul>
> 		</div>
> 	</t:loop>
> </div>
> 
> 
> js:
> 
> $(function() {
> 	$("#accordion").accordion({
> 		fillSpace: true
> 	});
> });
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-jQuery-tp5662365p5662445.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


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


Re: Tapestry-jQuery

Posted by arterzatij <ar...@gmail.com>.
Hi, I actually did in this way an it works, but I want to use the jquery
accordion provided on Tapestry-Jquery...

<div id="accordion">
	<t:loop t:source="nodes" t:value="node">
		

			 # ${node.name} 
		

		<div>
			<ul>
				<t:loop t:source="node.children" t:value="nodeChild">
					<li>
						${nodeChild.content}
					</li>
				</t:loop>
			</ul>
		</div>
	</t:loop>
</div>


js:

$(function() {
	$("#accordion").accordion({
		fillSpace: true
	});
});

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-jQuery-tp5662365p5662445.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Tapestry-jQuery

Posted by Chris Mylonas <ch...@opencsta.org>.
Hi,

Using this demo:  http://jqueryui.com/demos/accordion/

I would take a guess to put an ${accordionPage1} within the first <p> tags in the tml below.
and in the java file have a getAccordionPage1(){ return "Some text goes here" ;}

You can then take it further and get down into your lower layers of the app (Session/DB etc) to fetch what you want.

If that works, can you let me know - I haven't got around to testing that yet...


Following are the files I used:

tml

<html t:type="layout" title="hibernatetesting Index"
	t:sidebarTitle="Framework Version" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"
	xmlns:p="tapestry:parameter">

	<div class="demo">

		<div id="accordion">
			<h3>
				<a href="#">Section 1</a>
			</h3>
			<div>
				<p>
					Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
					ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum
					sit
					amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo
					ut
					odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque
					vulputate.
				</p>
			</div>
			<h3>
				<a href="#">Section 2</a>
			</h3>
			<div>
				<p>
					Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet
					purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis
					porttitor
					velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In
					suscipit faucibus urna.
				</p>
			</div>
			<h3>
				<a href="#">Section 3</a>
			</h3>
			<div>
				<p>
					Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque
					lobortis.
					Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero
					ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna
					quis
					lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis
					dui.
				</p>
				<ul>
					<li>List item one</li>
					<li>List item two</li>
					<li>List item three</li>
				</ul>
			</div>
			<h3>
				<a href="#">Section 4</a>
			</h3>
			<div>
				<p>
					Cras dictum. Pellentesque habitant morbi tristique senectus et netus
					et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in
					faucibus orci luctus et ultrices posuere cubilia Curae; Aenean
					lacinia
					mauris vel est.
				</p>
				<p>
					Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus.
					Class aptent taciti sociosqu ad litora torquent per conubia nostra,
					per
					inceptos himenaeos.
				</p>
			</div>
		</div>

	</div><!-- End demo -->
</html>


java

package org.opencsta.hibernatetesting.pages.test;

import org.apache.tapestry5.annotations.Import;
import org.got5.tapestry5.jquery.ImportJQueryUI;

@Import(library="context:js/accordion.js")
@ImportJQueryUI(value = {"jquery.effects.core","jquery.ui.accordion","jquery.ui.tabs"})
public class Accordion {

}


js in src/main/webapp/js/accordion.js
$(document).ready(function(){
	
	$(function() {
		$( "#accordion" ).accordion();
	});
	
});



On 25/04/2012, at 1:22 AM, arterzatij wrote:

> Hi all,
> 
>   Just a quick question, how do I do to make dinamic content in an
> accordion component.
> 
> 
> Thanks!
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-jQuery-tp5662365p5662365.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>