Forums Register Login

Don't know what to pass to a method that takes a generic parameter type.

+Pie Number of slices to send: Send
Hi Guys

This should be really basic stuff but I cannot think of anyway to solve this without ruining everything else, so here it goes:
I am trying to call a method with the following signature:

I call this method in the following way and the only thing the compiler does not like is the first parameter:

And it gives me the following error:
The method visitParents(Class"<"C">", IVisitor"<"C,R">") in the type Component is not applicable for the arguments (Class<SortableTable>, IVisitor<Component,Void>)
The class SortableTable is as follows:

If you are wondering what DataTable is, it is a Wicket 6 class so google the API if you want to know more about it.

What can I pass to as the first parameter so the method would compile?

Many thanks
Ramin
+Pie Number of slices to send: Send
How do you know the problem is in first parameter? Can you show visitor?
+Pie Number of slices to send: Send
I don't remember what I did that made me believe that the issue is the first parameter but now that you mentioned it, when I change the second parameter to null it compiles fine. I am kinda confused now.
This is my visitor:
1
+Pie Number of slices to send: Send
Well since C extends MarkupContainer and Component doesn't extend MarkupContainer , you cannot do this, right?



So, you won't be able to pass visit to a parameter that expects IVisitor <MarkupContainer, Void>
+Pie Number of slices to send: Send
Makes sense, thank you.
+Pie Number of slices to send: Send
The solution is changing component to SortableTable:
Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 770 times.
Similar Threads
How add functionality from another program
Limiting characters and word wrap in JTextArea
Java text fields on a panel in a 2d array
communicating/affecting another class
How to create Generic 2-dimensional array?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:52:16.