tapestry-user@jakarta.apache.org
[Top] [All Lists]

Dynamic Property Selection List

Subject: Dynamic Property Selection List
From: Chris Chiappone
Date: Thu, 5 Jan 2006 12:36:15 -0500
I having trouble creating a dynamic selection list with tap 4.  I am trying
to do this using annotations, which may be part of my problem.  Here is the
code for my page:

 @Component(id = "clientSelections", type="PropertySelection",
   bindings = {"model=clientSelections", "value=clientName"})
 public IPropertySelectionModel getClientSelections(){
  ISponsorHome ish = getSponsorHome();
  Collection clients = ish.getAllClients();
  Iterator<Client> clientIt = clients.iterator();
  String[] clientArr = new String[clients.size()];
  int i = 1;
  while(clientIt.hasNext()){
   Client c = clientIt.next();
   clientArr[i] = c.getLongname();
   i++;
  }
  Arrays.sort(clientArr);
  clientArr[0] = appMess.getString("default.selection");
  return new StringPropertySelectionModel(clientArr);
 }


And here is the exception:

  org.apache.hivemind.ApplicationRuntimeException Component
OpenCase/clientSelections is not assignable to type
org.apache.tapestry.form.IPropertySelectionModel. location: Annotation @
org.apache.tapestry.annotations.Component(inheritInformalParameters=false,
bindings=[model=clientSelections, value=clientName], id=clientSelections,
type=PropertySelection) of public
org.apache.tapestry.form.IPropertySelectionModel
view.pages.OpenCase.getClientSelections() Stack Trace:

   - org.apache.tapestry.TapestryUtils.getComponent(TapestryUtils.java:304)


Thanks in advance for the help.


--
~chris
<Prev in Thread] Current Thread [Next in Thread>