This should work because we use YUI, so you shouldn't have any Javascript 
conflict with JQuery, but i haven't tried.
To test, add exanpe-t5-lib dependency, annotate your module class with 
@SubModule(ExanpeLibraryModule.class) and declare the exanpe namespace on your 
page (xmlns:ex="tapestry-library:exanpe").
More informations here : 
http://exanpe.github.com/exanpe-t5-lib/getting_started.html


-----Message d'origine-----
De : sommeralex [mailto:alexander.som...@gmail.com] 
Envoyé : lundi 13 février 2012 17:56
À : users@tapestry.apache.org
Objet : Re: implementing a sortable list with jQuery

HI Laurent,

thanks! can i mix this with jQuery? And if so, how? I need jQuery because of 
the multiple file upload component..

alex

2012/2/13 Guerin Laurent [via Tapestry] <
ml-node+s1045711n5479777...@n5.nabble.com>

> Hi,
> We have a such component in exanpe-t5-lib, but not implemented with 
> JQuery.
> You can have a look at our online demo here :
> http://exanpe-t5-lib.appspot.com/components/listsorter/example1
>
> Laurent
>
> -----Message d'origine-----
> De : sommeralex [mailto:[hidden 
> email]<http://user/SendEmail.jtp?type=node&node=5479777&i=0>]
>
> Envoyé : lundi 13 février 2012 16:07
> À : [hidden email] 
> <http://user/SendEmail.jtp?type=node&node=5479777&i=1>
> Objet : implementing a sortable list with jQuery
>
> Hi!
>
> I need to have sortable list by dragging the list elements and would 
> like to store the order at the end.
>
> The http://tapestry5-jquery.com/core/docsgrid does not provide a 
> component, so i thought i could take this one:
>
> http://blogs.fau.de/pp/2010/09/01/sortierbare-elemente-in-tapestry-per
> -jquery-ui/
>
> What i did, so far, is this:
>
> <html t:type="layout" t:title="Welcomes" t:tabTitle="Scrollstory"
>       t:sidebarTitle="Menu"
>       xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd";
>       xmlns:p="tapestry:parameter"
>     xmlns:j="tapestry-library:jquery">
>
>
>
>
>
> <ul id="sortable">
> <li t:type="loop" source="fileElements" value="fileElement"
> id="${fileElement.id}">${fileElement.id} ${fileElement.name}</li> 
> </ul> # ${message:save} <t:actionlink t:id="save"
> context="literal:dummy"></t:actionlink>
>
> </html>
>
> And my class file:
>
> @Property
> private List<FileElement> fileElements;
>
> @Property
> private FileElement fileElement;
>
>         void pageAttached(){
>                 System.out.println("page attached");
>                 uploadedFiles = new ArrayList<UploadedFile>();
>                 fileElements = new ArrayList<FileElement>();
>
>                 fileElements.add(new FileElement(1, "test"));
>                 fileElements.add(new FileElement(2, "test2"));
>         }
>
> the class FileElement is just a class with id as int and name as 
> String with getters / setters.
>
> so, now, two questions:
>
> question 1:
>
> http://blogs.fau.de/pp/2010/09/01/sortierbare-elemente-in-tapestry-per
> -jquery-ui/
> says we have to implement
>
> <link type="text/css"
> href="${asset:jqueryui/themes/base/jquery.ui.all.css}"
> rel="stylesheet" />
>
>
>
>
>
>
> but, is this not implicit in xmlns:j="tapestry-library:jquery ? if i 
> have to add this that way, how can i reference my jquery asset which 
> is stored in my mvn. folder?
>
> question 2:
>
> if i am adding the second part of code
>
> function storeOrder() {
> var result = $('#sortable').sortable('toArray');
> var context = "";
> for (var id in result) {
> if (context == "") {
> context = result[id];
> } else {
> context = context + "_" + result[id];
> }
> }
> window.location = "/${pageName}" + ".save/" + context; }
>
> i get the exception
>
> Exception assembling root component of page Gallery: Could not convert 
> 'pageName' into a component parameter binding: Exception generating 
> conduit for expression 'pageName': Class com.scrollstory.pages.Gallery 
> does not contain a property (or public field) named 'pageName'.
>
> .. so, sorting my list does not work.. :-(
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/implementing-a-sortable-list-wit
> h-jQuery-tp5479509p5479509.html Sent from the Tapestry - User mailing 
> list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden 
> email]<http://user/SendEmail.jtp?type=node&node=5479777&i=2>
> For additional commands, e-mail: [hidden 
> email]<http://user/SendEmail.jtp?type=node&node=5479777&i=3>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden 
> email]<http://user/SendEmail.jtp?type=node&node=5479777&i=4>
> For additional commands, e-mail: [hidden 
> email]<http://user/SendEmail.jtp?type=node&node=5479777&i=5>
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the 
> discussion
> below:
>
> http://tapestry.1045711.n5.nabble.com/implementing-a-sortable-list-wit
> h-jQuery-tp5479509p5479777.html  To unsubscribe from implementing a 
> sortable list with jQuery, click 
> here<http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?ma
> cro=unsubscribe_by_code&node=5479509&code=YWxleGFuZGVyLnNvbW1lckBnbWFp
> bC5jb218NTQ3OTUwOXwxMDUzMzQxMzM4>
> .
> NAML<http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?ma
> cro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.nam
> l.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-n
> abble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%2
> 1nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant
> _email%21nabble%3Aemail.naml>
>


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

Reply via email to