why not use models, see how the ajax dropdown example works.

-Igor


On 7/6/06, Nino Wael <[EMAIL PROTECTED] > wrote:
I solved the problem by requiring a interface instead of the object. But that means that, every where my component are used the user needs to implement the interface. That doesnt seem to be a really nice solution.

The thing I need are for you guys(developers of wicket) to extend the propertymodel class so that it can take parameters also instead of just calling setters and getters... :)



-regards Nino


-----Original Message-----
From:   [EMAIL PROTECTED] on behalf of Nino Wael
Sent:   Thu 06-07-2006 14:01
To:     wicket-user@lists.sourceforge.net
Cc:
Subject:        Creating a component / dynamic casting / implicit casting

Hi

Im currently working on a component that consists of a dropdown list and two listbox's, lb1 and lb2. This is pretty simple to do. My issue isnt really a wicket one, but I guess it has relevance since this is something I need to solve to create my component.

The hard part is that the contents of lb1 depends of the contents of the dropdown. So I looked towards java.lang.reflect(Reflection), wich lets me define a certain method to use.

my constructor looks something like this

dualForm_form(String id, ItemContainer drop, List DropList, ItemContainer myCont,       Class myProvider, String sMethod)

The things that regards reflect are these:
myProvider, which is the class that I need to call
sMethod, which is the name of the method that I need to call
To keep stuff simple lets just assume that method bla only takes one parameter, the one which is provided by the onselectionchange method of my dropdown.

The above things are fine. But I also need to provide an instanciated object of the Class myProvider. I thought that I would use the class Object to carry the object. But calling reflect gives an error that the method defined in sMethed does not exist, I guess this is because reflection is looking in the object Class and not the true class which carries the method? What should I do instead?


As said earlier, this has nothing to do with wicket, but is very interresting when creating components that needs to update themselfes.

-Regards Nino





Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to