To answer my own question (only partially):

somehow the accessor assignedDropArea() is called at least once when the 
corresponding loopvar is null. Simply trapping this case and returning a dummy 
string fixes the problem. I do get distinct IDs for all dropAreas.

However another problem now arises.

Here is a screen shot from my test page:



The left column contains all available entries whereas the list on the right 
contains the sections into which I want to drag an item from the left. When the 
page is in its inital state I can drag any item from the left and drop it on 
the right. But the drop action is only activated when I drop it onto any of the 
already assigned items or the "Technical Dossier" header. The drop does not 
trigger when I release the item over "General Section". And after a successful 
drop no other drop from the left to the right triggers the action method again, 
no matter where I let go. Reloding the page restores the one-drop-is-possible 
"feature".

What do I miss here? It looks as if the first drop kills the droppableArea. And 
why is "General Section" not droppable at all?

Help, I am lost
---markus---

> On 07.09.2015, at 17:39, Markus Ruggiero <[email protected]> wrote:
> 
> I am trying to adapt the Wonder example DragAndDropLists. The example has 2 
> drop areas with hard coded id. I need to provide 1 source drop area and 
> several destination drop areas. These are inside a WORepetition. I tried to 
> use the repetition loopvar (item binding) to create a unique id attribute but 
> the app crashes with a null pointer exception. Obviously even when the drop 
> area is inside the WORepetition the JavaScript functions in the background 
> seem to create/populate/whatever code/function upfront before the loop 
> actually starts. Any idea how I could create an id for the drop area? 
> 
> Code currently looks something like this (just the relevant snippet):
>             <webobject name = "sectionsRepetition">
>             <webobject name = "assignedIndustryTechdocTypesDropArea">
>             <table style="border:solid 1 red">
>                 <tr>
>                     <td style="border:solid 1px red"><webobject name = 
> "sectionTitle" /></td>
>                 </tr>
>     
>                 <tr>
> 
> with the bindings:
> 
> sectionsRepetition : WORepetition {
>       list = sectionsList;
>       item = sectionsLoopvar;
> }
> assignedIndustryTechdocTypesDropArea   : AjaxDroppable {
>       id = assignedDropArea;
>       updateContainerID = "everythingUpdateContainer";
>       action = droppedOnAssignementArea;
>       droppedObject = droppedObject;
>       onComplete = onCompleteFunction;
> }
> 
> and in the component:
>     public String assignedDropArea() {
>       return "assignedDropArea_" + sectionsLoopvar.shortText();
>     }
> 
> Crash is because sectionsLoopvar is null.
> 
> Thanks for any help
> ---markus---
> 
> 
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/mailinglists%40kataputt.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to