I'm stuck.  I created a page where the user enters some data, I then want to 
process the data based on button that is pressed.  To do this I have created a 
js file that contains this function:

function startRequestItem()
{
  var handle = cocoon.request.get("handle");
  var itemId = cocoon.request.get("itemId");
  var bitstreamId = cocoon.request.get("bitstreamId");
  var result;

 do 
  {

    
sendPageAndWait("request-item/main",{"handle":handle,"itemId":itemId,"bitstreamId":bitstreamId},result);

    if (cocoon.request.get("submit_send_request_item"))
    {
      var item = Item.find(getDSContext(),itemId);
      
cocoon.redirectTo(cocoon.request.getContextPath()+"/handle/"+item.getHandle(),true);
      getDSContext().complete();
      item = null;
      cocoon.exit();
    }
    if (cocoon.request.get("submit_cancel_request_item"))
    {
      var item = Item.find(getDSContext(),itemId);
      
cocoon.redirectTo(cocoon.request.getContextPath()+"/handle/"+item.getHandle(),true);
      getDSContext().complete();
      item = null;
      cocoon.exit();
    }
  }
  while (true);

}

But what I'm seeing is that the request-item/main is processed but when a 
button is hit you don't return from the sendPageAndWait function.  The same 
page is just refreshed.

Here is what I have in the sitemap:

              <map:match pattern="request-item">
                <map:match type="request" pattern="artifact-continue">
                 <map:call continuation="{1}"/>
                 </map:match>
                 <map:call function="startRequestItem"/>
              </map:match>


AND


              <!-- requested item -->
              <map:match pattern="request-item/main">
                 <map:transform type="RequestItem"/>
                   <map:serialize type="xml"/>
              </map:match>


I hope this is enough info to get some suggestions.

Thank you!  Jose



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to