Of course  Here is part of the code

The hiercarchy is
webpage
  ----  border
        ---------  (WebMarkupContainer)  RMAsContainer  rmaList
                    ----- PageableListView rmaView ,   AjaxPagingNavigator



public class RMARecords extends WebPage {
private static final long serialVersionUID = 1L;

private Request rmaRequest = new Request();

private RequestDetail requestDetail;

private RMAsContainer rmaList;

private PageableListView rmaView;

private WebMarkupContainer dContainer;

public RMARecords(final PageParameters pps) {
 Border border = new RMABorder("rmaBorder");
 add(border);

 rmaList = new RMAsContainer("showRequests");
 border.add(rmaList);

 rmaList.add(new AjaxPagingNavigator("navigator", rmaView) {
  @Override
  protected void onAjaxEvent(AjaxRequestTarget target) {
   target.addComponent(rmaList);
  }
 });

 dContainer = new WebMarkupContainer("DContainer");
 dContainer.setOutputMarkupId(true);

 requestDetail = new RequestDetail("requestDetail");
 requestDetail.setVisible(false);

 dContainer.add(requestDetail);

 border.add(dContainer);

}





class RMAsContainer extends WebMarkupContainer {

 public RMAsContainer(String id) {
  super(id);

  setOutputMarkupId(true);

  IModel itemList = new LoadableDetachableModel() {
   protected Object load() {
    String email = SecurityContextHolder.getContext()
      .getAuthentication().getName();
    return ((RMAApplication) getApplication()).getRMAService()
      .getRMAs(email);
   }
  };

  add(rmaView = new PageableListView("request", itemList, 10) {
   protected void populateItem(ListItem item) {
    // display the text of the item
    Request req = (Request) item.getModelObject ();
    String time = req.getDate().toString().substring(0, 19);
    AjaxLink idLink = new IDLink("idLink", req.getId());
    idLink.add(new Label("id", req.getId().toString()));
    item.add (idLink);
    item.add(new Label("time", time));
    item.add(new Label("reference", req.getLine_reference()));
    item.add(new Label("status", req.getStatus()));
    item.add (new Label("note", req.getNote()));

   }
  });

 }

 class IDLink extends AjaxLink {
  Long reqid;

  public IDLink(String id, Long reqid) {
   super(id);
   this.setOutputMarkupId(true);
   this.reqid = reqid;
  }

  @Override
  public void onClick(AjaxRequestTarget target) {
   if (reqid != null) {
    setRmaRequest(((RMAApplication) getApplication())
      .getRMAService().getRequestByID(reqid));
   }
    requestDetail.setVisible(true);
   target.addComponent(dContainer);

  }

 }

}
}


On 7/6/07, Conglun Yao <[EMAIL PROTECTED]> wrote:

Dear all,

I have met such a headache problem, when trying to use wicket's ajax in my
project.

I'm using wicket 1.2.6.

JS error 'Object expected' in html code happens when

 I first submit a form (no matther it is submitted from ajax button or
normal button),

 then click the page link ( there are AjaxPagingNavigator in this page)

finally I click the ajax component,   error happens.


Further more, after more testings, I found errors also happened when I
click AjaxPagingNavigator  twice or three times, then click page link  to
view page which contains ajax components.


Thanks for any help.


Regards,

conglun



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to