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 <[email protected]> wrote:

> In old code there was logic to perform different actions based on
> inputName :(
>
>
> On 9 November 2014 18:57, Martin Grigorov <[email protected]> wrote:
>
>> 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 ?
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Sun, Nov 9, 2014 at 2:52 PM, Maxim Solodovnik <[email protected]>
>> wrote:
>>
>> > 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 <[email protected]>
>> > wrote:
>> >
>> > > What instanceof is this submittingButton  ?
>> > >
>> > > François Meillet
>> > > Formation Wicket - Développement Wicket
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > Le 9 nov. 2014 à 13:42, Maxim Solodovnik <[email protected]> a
>> écrit
>> > :
>> > >
>> > > > 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
>> > > > org.apache.wicket.behavior.Behavior == false
>> > > >
>> > > >
>> > > > On 9 November 2014 18:37, Francois Meillet <
>> [email protected]
>> > >
>> > > > wrote:
>> > > >
>> > > >> String inputName = ((FormComponent)
>> submittingButton).getInputName();
>> > > >>
>> > > >>
>> > > >> François Meillet
>> > > >> Formation Wicket - Développement Wicket
>> > > >>
>> > > >>
>> > > >>
>> > > >>
>> > > >>
>> > > >> Le 9 nov. 2014 à 13:08, Maxim Solodovnik <[email protected]> a
>> > > écrit :
>> > > >>
>> > > >>> 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 code:
>> > > >>> submittingComponent.getInputName() worked as expected
>> > > >>> right now it is: Form.delegateSubmit(IFormSubmitter
>> submittingButton)
>> > > and
>> > > >>> it is impossible to get inputName anymore :(
>> > > >>>
>> > > >>> I tried to cast submittingComponent to IFormSubmittingComponent
>> but
>> > it
>> > > is
>> > > >>> not working due to submittingComponent is of type
>> > > >>> "org.apache.wicket.ajax.form.AjaxFormSubmitBehavior$1@33b88671"
>> and
>> > > I'm
>> > > >>> unable to cast it to something useful :(
>> > > >>>
>> > > >>> Thanks in advance!
>> > > >>>
>> > > >>> --
>> > > >>> WBR
>> > > >>> Maxim aka solomax
>> > > >>
>> > > >>
>> > > >
>> > > >
>> > > > --
>> > > > WBR
>> > > > Maxim aka solomax
>> > >
>> > >
>> >
>> >
>> > --
>> > WBR
>> > Maxim aka solomax
>> >
>>
>
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
WBR
Maxim aka solomax

Reply via email to