Re: Failing to remove item from list when drag and dropping

2010-04-17 Thread Sven Meier

Hi Johan,

seems to me http://code.google.com/p/wicket-dnd/ supports everything you 
need without any hacking.


Regards

Sven

Johan Haleby wrote:
Hi, 


I have a use case that reads as follows: I need two lists next to each
other. When starting up the left list is empty and I add items to it by
dragging them from the right list and dropping them on the left. These items
should be copied, (i.e. _not_ moved, the right list should be static) from
the right list into the selected position in the left list. It should also
be possible to reorder the items in the left list using drag and drop. The
last thing is that you should be able to remove items from the left list by
dragging and dropping them back to the right list. Since the right list is
static the item should _not_ be added to the right list but rather just
removed from the left list. 


After some investigation I've settled on using the YuiDDListView (from the
wicket-yui project) which  extends from a standard Wicket ListView. I've
chosen this component since it supports positioning items in the list (i.e.
you know to which index you dropped the item in the list). After MUCH
hacking around I've managed to get most things working. There are mainly two
things left and here I would really appreciate some help: 


1) I cannot seem to remove _the last_ item in the left list (i.e. by drag
and dropping to the right list). It works fine for all other items but for
the last item it fails saying e.g.: 


Caused by: org.apache.wicket.WicketRuntimeException: component
tabs:panel:panel:list:items:0 not found on page
com.mycompany.MyPageCompany[id = 4], listener interface =
[RequestListenerInterface name=IBehaviorListener, method=public abstract
void org.apache.wicket.behavior.IBehaviorListener.onRequest()] 
at
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426) 
at
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471) 
at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144) 
... 28 more 


What causes this is that in the onDrop method in the left list I remove the
dropped item from the list if it's dropped on the right list. Why is this
happening? What's the best way to resolve it? 


2) When I drag and item from the left to the right it looks like the item is
added to the right list until I reload the page. I figure could be a
javascript error since the javascript doesn't understand that the item
shouldn't be added to the right list at all (it should instead be removed
from the left list). What would be the best way to resolve this? 

I'm using Wicket 1.4.1. 


/Johan



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



Re: Failing to remove item from list when drag and dropping

2010-04-17 Thread Johan Haleby

Hi,

Looks promising indeed. Does it work with Wicket 1.4.1? Do you have any code
examples that I could have a look at?

/Johan
-- 
View this message in context: 
http://n4.nabble.com/Failing-to-remove-item-from-list-when-drag-and-dropping-tp1960968p2013958.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: Failing to remove item from list when drag and dropping

2010-04-17 Thread Sven Meier

Hi Johan,

yes, works with 1.4.x and has an example project in the repository:

http://code.google.com/p/wicket-dnd/source/browse/#svn/trunk/wicket-dnd-examples

Regards

Sven

Johan Haleby wrote:

Hi,

Looks promising indeed. Does it work with Wicket 1.4.1? Do you have any code
examples that I could have a look at?

/Johan



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



Re: my book updated for Wicket 1.4.x

2010-04-17 Thread Ngoc Dao
Hi,

I really like your way of instructing. It is very easy to follow! I
will absolutely buy your book.

I would like to use Wicket from Scala (since Lift seems to be too
complicated). Could your say something about it? Or even add a chapter
about it? (things to notice, pitfalls etc.)

Thanks a lot,
Ngoc


On Sat, Apr 17, 2010 at 12:40 PM, Kent Tong k...@cpttm.org.mo wrote:
 Hi,

 I've updated my book for Wicket 1.4.x. You may check it out or download the
 first two chapters at http://agileskills2.org/EWDW

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



Re: Wicket and JavaFX applet

2010-04-17 Thread Marek Šabo
Thanks for answer,

however I dumped this way as that remote configuration takes awfully
long even in plain html page. So I ran it once and copied the generated
applet markup and inserted into wicket markup and it works (and loads
much faster).

Just for record I tested js and it works 100%, problem seems to be in
loading that remote js file. I once managed to load it succesfully and
js debugger threw this:

Error:
name: Error
message: Security violation
stacktrace:   Line 841 of linked script
http://localhost:8084/neobax/resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js
t.send(null);
  Line 817 of linked script
http://localhost:8084/neobax/resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js
return this.doGet();
  Line 1613 of linked script
http://localhost:8084/neobax/resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js
req.get();   
  ...

Regards,

-- 

Marek Šabo



On 04/17/2010 06:47 AM, Jeremy Thomerson wrote:
 Use Firebug and add a breakpoint in your JS to see if it is getting
 executed.  If it's not, you may try adding a semi-colon after your
 startApplet() - because I don't remember if you need it when it's run in
 an eval.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Fri, Apr 16, 2010 at 7:25 PM, Marek Šabo ms...@buk.cvut.cz wrote:

   
 Hi all,

 I have problems with running javaFX applet inside wicket page. I call a
 loading function from ajaxLink
 (target.appendJavascript(startApplet());) and in html:

wicket:head
script src=http://dl.javafx.com/1.2/dtfx.js;
 type=text/javascript/script
script type=text/javascript
function startApplet() {
fxstring = javafxString({
archive: /neobax/TrafficApplet.jar, //placed in
 root next to WEB-INF
draggable: true,
width: 640,
height: 480,
code: trafficapplet.Main,
name: TrafficApplet
});
document.getElementById('taContainer').innerHTML=fxstring;
}
/script
/wicket:head
 div id=taContainer /

 Last thing In ajax debug is:
 INFO: Initiating Ajax GET request on http://dl.javafx.com/1.2/dtfx.js
 INFO: Invoking pre-call handler(s)...

 Is there any way to know more about the process for better debugging?

 TIA,

 --
 Marek Šabo



 



Maven Resource Question

2010-04-17 Thread hill180
In Netbeans, in the Maven pom.xml I have the following:

resource

filteringfalse/filtering

directorysrc/main/html/directory

targetPathcom/mydomain/myproject/targetPath

excludes

exclude**/public//exclude

/excludes

/resource

resource

filteringfalse/filtering

directorysrc/main/html/public/directory

targetPath${project.build.directory}/${project.build.finalName}/public/targetPath

/resource


This same pom.xml does not work with eclipse.  Does anyone know why.


Why, you ask?


in the src/main/html folder I have all of the html pages for the site.  This
way I can just zip up the folder and send it over to the designer without
remove the .java/property files.  In the html folder there is a public
folder used for css/image files, or none dynamic pages.


In netbeans:


Files in the src/main/html get copied to the class folder excluding the
public.

Public folder is copied to the target root, accessible to all (no special
coding for images, or css).


In eclipse this works if I remove the


resource

filteringfalse/filtering

directorysrc/main/html/public/directory

targetPath${project.build.directory}/${project.build.finalName}/public/targetPath


Any eclipse experts out there :).


Thanks!