Title: Issue with reusing a form/page

The following code is used to display the results using a table/repeating view.

The last column is used to add a link to do another lookup. I am having two problems.

1. When the link "getTasks" is called regardless of which iteratation user[0] always returns the last value in the users arraylist.

2. On the subsequent page that it gets passed off to, GetTasksPanel runs another query and if the resultset of that is empty I call error("Not results found") which throws the following exception:

    java.lang.IllegalStateException: No Page found for component [MarkupContainer [Component id = getTasksForm, page = <No Page>, path = getTasksForm.GetTasksPanelForm]]

The call to error works fine if you go directly to that page and use the input field there…

Any suggestions?


  public LookUpUserResults(String id, ArrayList users) {
        super(id);
        if (users != null){
            RepeatingView repeating = new RepeatingView("repeating");
            add(repeating);
           
            for (int x = 0; x < users.size(); x++){
               
                WebMarkupContainer item = new WebMarkupContainer(repeating.newChildId());
                repeating.add(item);
               
                user = (String[] )users.get(x);
               
                item.add(new Label("username",user[0] ));
                item.add(new Label("osname",user[2] ));
                item.add(new Label("email", user[1]));
               
                item.add(new Link("getTasks") {
                    public void onClick() {
                        log.debug("Setting up link for " + user[0]);
                        MarkupContainer p = this.getParent();
                       
                        for (int x=0; x < 10; x++){
                           
                            if (p instanceof UtilitiesPanel){
                                String username = user[0] ;
                                log.debug("Setting up button for " + user[0]);
                                p.replace(new GetTasksPanel("mainContent",username));
                               
                                break;
                            }else{
                                p = p.getParent();
                            }
                        }
                       
                    }
                });
            }
           
           
           
        }
    }

Jeremy Levy
Morgan Stanley
75 Varick Street - 7th Floor
New York, NY  10013
212-219-4737
[EMAIL PROTECTED]

 
 
 

Important Notice to Recipients:
It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to