Hello All,
I'm trying to migrate project from Wicket 1.4 to Wicket 6.
previously Form.delegateSubmit was Form.delegateSubmit(
IFormSubmittingComponent
http://ci.apache.org/projects/wicket/apidocs/1.4.x/org/apache/wicket/markup/html/form/IFormSubmittingComponent.html
submittingComponent) and the
String inputName = ((FormComponent) submittingButton).getInputName();
François Meillet
Formation Wicket - Développement Wicket
Le 9 nov. 2014 à 13:08, Maxim Solodovnik solomax...@gmail.com a écrit :
Hello All,
I'm trying to migrate project from Wicket 1.4 to Wicket 6.
previously
Thanks for the quick response!
Unfortunately this solution is not working due to:
submittingButton instanceof
org.apache.wicket.markup.html.form.FormComponent == false
submittingButton instanceof org.apache.wicket.Component == false
submittingButton instanceof submittingButton instanceof
What instanceof is this submittingButton ?
François Meillet
Formation Wicket - Développement Wicket
Le 9 nov. 2014 à 13:42, Maxim Solodovnik solomax...@gmail.com a écrit :
Thanks for the quick response!
Unfortunately this solution is not working due to:
submittingButton instanceof
unfortunately I'm unable to guess :(
submittingButton instanceof IFormSubmitter
I'm out of ideas, this is why i wrote to the list :(
On 9 November 2014 18:49, Francois Meillet francois.meil...@gmail.com
wrote:
What instanceof is this submittingButton ?
François Meillet
Formation Wicket -
Hi,
It is an anonymous instance -
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormSubmitBehavior.java#L159
And there is no way to get an inputName because it is not associated
with IFormSubmittingComponent
Why do you need the inputName ?
In old code there was logic to perform different actions based on inputName
:(
On 9 November 2014 18:57, Martin Grigorov mgrigo...@apache.org wrote:
Hi,
It is an anonymous instance -
Multi-submit button form, and the logic should be in onSubmit method but
should be different based on button
On 9 November 2014 19:00, Maxim Solodovnik solomax...@gmail.com wrote:
In old code there was logic to perform different actions based on
inputName :(
On 9 November 2014 18:57, Martin
I don't see a clean way how to accomplish what you need :-/
What I would try is to use the special variable this$0 via reflection to
get a reference to the AjaxFormSubmitBehavior instance
I see a way to simplify this code so it will be possible to do what you
need:
1) AjaxFormSubmitBehavior
Done: https://issues.apache.org/jira/browse/WICKET-5753
Thanks a lot Martin, will try to use the special variable this$0 via
reflection
On 9 November 2014 19:14, Martin Grigorov mgrigo...@apache.org wrote:
I don't see a clean way how to accomplish what you need :-/
What I would try is to use
one more thing: getComponent() is protected and not accessible :(
On 9 November 2014 19:27, Maxim Solodovnik solomax...@gmail.com wrote:
Done: https://issues.apache.org/jira/browse/WICKET-5753
Thanks a lot Martin, will try to use the special variable this$0 via
reflection
On 9 November 2014
True.
Another approach is to add getFormSubmittingComponent() to IFormSubmitter
interface.
But this is definitely only for 7.x.
Did it work with this$0 ?
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Sun, Nov 9, 2014 at 3:52 PM, Maxim Solodovnik
Yes, Thanks!
currently adding another reflection call to get component :)
On 9 November 2014 19:59, Martin Grigorov mgrigo...@apache.org wrote:
True.
Another approach is to add getFormSubmittingComponent() to IFormSubmitter
interface.
But this is definitely only for 7.x.
Did it work with
Somehow component field is not accessible via reflection:
Field f = submittingButton.getClass().getDeclaredField(this$0);
if (!f.isAccessible()) {
f.setAccessible(true);
}
Object o = f.get(submittingButton);
if (o instanceof AbstractAjaxBehavior) {
AbstractAjaxBehavior aab =
Use getField() instead
On Nov 9, 2014 4:34 PM, Maxim Solodovnik solomax...@gmail.com wrote:
Somehow component field is not accessible via reflection:
Field f = submittingButton.getClass().getDeclaredField(this$0);
if (!f.isAccessible()) {
f.setAccessible(true);
}
Object o =
aab.getClass().getField(component)
NoSuchFieldException :(
Debugger displays component field
aab.getClass().getMethod(getComponent)
NoSuchMethodException
not sure what's happening
On 9 November 2014 21:33, Martin Grigorov mgrigo...@apache.org wrote:
Use getField() instead
On Nov 9,
AbstractAjaxBehavior.class.get[Declared]Field()
On Nov 9, 2014 5:44 PM, Maxim Solodovnik solomax...@gmail.com wrote:
aab.getClass().getField(component)
NoSuchFieldException :(
Debugger displays component field
aab.getClass().getMethod(getComponent)
NoSuchMethodException
not sure
Thanks!
AbstractAjaxBehavior.class.getField(component) - fails
AbstractAjaxBehavior.class.getDeclaredField(component) - works!
Thanks a lot!
On 9 November 2014 21:46, Martin Grigorov mgrigo...@apache.org wrote:
AbstractAjaxBehavior.class.get[Declared]Field()
On Nov 9, 2014 5:44 PM, Maxim
18 matches
Mail list logo