Hi Alexander

question 1:
Tapestry5-jQuery insert a default CSS stylesheet. If you want to override it, 
you need to use the JQuerySymbolConstants.JQUERY_UI_DEFAULT_THEME constant


question 2:
Where this code come from ? JavaScript ?  Template ? do you have a getPageName 
method in your Java class ? or an @property annotated variable, called pageName 
?


-----Message d'origine-----
De : sommeralex [mailto:alexander.som...@gmail.com]
Envoyé : lundi 13 février 2012 16:07
À : users@tapestry.apache.org
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-with-jQuery-tp5479509p5479509.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

Reply via email to