Re: How can a component know if it's being rendered as part of Ajax response?

2020-04-04 Thread Vit Rozkovec
Hi, this seems to be a frequent use case, wouldn't there be a good fit 
for some shorthand method?


Like

/getRequestCycle().onAjax(t-> {});/
boolean getRequestCycle().isAjax();

?

Vit


On 4/4/20 11:51 PM, Sven Meier wrote:

Hi,

you can test for the appropriate request handler:

getRequestCycle().find(IPartialPageRequestHandler.class).ifPresent(target 
-> /* do things on partial page update */));


Have fun
Sven


On 04.04.20 23:43, Vilius Vaivada wrote:

Hey guys,

I'm pretty sure I'm missing something obvious here, but I can't 
figure out

a simple way for a component to contribute slightly different Javascript
based on whether it's being rendered for a full page load or a 
partial Ajax

response. Any clues?

Thanks a lot!



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





Re: How can a component know if it's being rendered as part of Ajax response?

2020-04-04 Thread Sven Meier

Hi,

you can test for the appropriate request handler:

getRequestCycle().find(IPartialPageRequestHandler.class).ifPresent(target 
-> /* do things on partial page update */));


Have fun
Sven


On 04.04.20 23:43, Vilius Vaivada wrote:

Hey guys,

I'm pretty sure I'm missing something obvious here, but I can't figure out
a simple way for a component to contribute slightly different Javascript
based on whether it's being rendered for a full page load or a partial Ajax
response. Any clues?

Thanks a lot!



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



How can a component know if it's being rendered as part of Ajax response?

2020-04-04 Thread Vilius Vaivada
Hey guys,

I'm pretty sure I'm missing something obvious here, but I can't figure out
a simple way for a component to contribute slightly different Javascript
based on whether it's being rendered for a full page load or a partial Ajax
response. Any clues?

Thanks a lot!


Re: Wizard vs WicketTester

2020-04-04 Thread Maxim Solodovnik
This is WebSocketAwareCsrfPreventionRequestCycleListener who is unhappy :(
Thanks for the hint :))

On Sat, 4 Apr 2020 at 20:07, Maxim Solodovnik  wrote:

> As usual everything works in test :(
> Going to check what is the difference
>
> Shall I commit basic test to master?
>
> On Sat, 4 Apr 2020 at 17:32, Sven Meier  wrote:
>
>> Hi Maxim,
>>
>>  > lastRendered page === 'null' after submit
>>  > Maybe I'm doing something wrong?
>>
>> it seems so. Check the log output and/or provide a testcase please.
>>
>> Have fun
>> Sven
>>
>>
>> On 04.04.20 07:35, Maxim Solodovnik wrote:
>> > Hello All,
>> >
>> > I'm trying to to test Wizard with WicketTester
>> > Wizard is the component with "splitted" form which is partially
>> submitted
>> > multiple times
>> > FormTester allows only single submit
>> >
>> > it's not a problem to create second FormTester BUT lastRendered page ===
>> > 'null' after submit :(
>> >
>> > Maybe I'm doing something wrong?
>> >
>> > BTW there is no tests for Wizard in Wicket code base, only WizardModel
>> is
>> > tested
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> --
> Best regards,
> Maxim
>


-- 
Best regards,
Maxim


Re: Wizard vs WicketTester

2020-04-04 Thread Maxim Solodovnik
As usual everything works in test :(
Going to check what is the difference

Shall I commit basic test to master?

On Sat, 4 Apr 2020 at 17:32, Sven Meier  wrote:

> Hi Maxim,
>
>  > lastRendered page === 'null' after submit
>  > Maybe I'm doing something wrong?
>
> it seems so. Check the log output and/or provide a testcase please.
>
> Have fun
> Sven
>
>
> On 04.04.20 07:35, Maxim Solodovnik wrote:
> > Hello All,
> >
> > I'm trying to to test Wizard with WicketTester
> > Wizard is the component with "splitted" form which is partially submitted
> > multiple times
> > FormTester allows only single submit
> >
> > it's not a problem to create second FormTester BUT lastRendered page ===
> > 'null' after submit :(
> >
> > Maybe I'm doing something wrong?
> >
> > BTW there is no tests for Wizard in Wicket code base, only WizardModel is
> > tested
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-- 
Best regards,
Maxim


Re: Wizard vs WicketTester

2020-04-04 Thread Sven Meier

Hi Maxim,

> lastRendered page === 'null' after submit
> Maybe I'm doing something wrong?

it seems so. Check the log output and/or provide a testcase please.

Have fun
Sven


On 04.04.20 07:35, Maxim Solodovnik wrote:

Hello All,

I'm trying to to test Wizard with WicketTester
Wizard is the component with "splitted" form which is partially submitted
multiple times
FormTester allows only single submit

it's not a problem to create second FormTester BUT lastRendered page ===
'null' after submit :(

Maybe I'm doing something wrong?

BTW there is no tests for Wizard in Wicket code base, only WizardModel is
tested



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: best way to get wysiwyg with wicket

2020-04-04 Thread Maxim Solodovnik
Jquery-ui WYSIWYG editor do clean-up of html on server

Custom js before submit is possible (the simpliest way is to store result
of such function in hidden field onchange)

On Sat, Apr 4, 2020, 16:00 Korbinian Bachl 
wrote:

> Hello Maxim,
>
> thank you for the list. However, beside that tinymce3 + 4 are quite
> outdated isn't there anything non html-wysiwyg existing so far?
> My problem is that, after we use tinymce in another part of the project we
> made the experience that letting non-tech people write HTML (even in
> WYSIWYG) mode just doesnt work. They end up copy n pasting from all over
> the web and inserting things they neither see nor understand - thats why we
> need some simplification like markdown (e.g.: https://ui.toast.com/) or
> even pure block-based editors (https://editorjs.io/)...
>
> I've stumbled over toast UI (https://ui.toast.com/), but I'm not sure if
> wicket would be able to execute some kind of JS function
> (editor.getMarkdown()) on before sending the form and catching it into a
> model...?
>
> Best,
>
> KB
>
> - Ursprüngliche Mail -
> > Von: "Maxim Solodovnik"
> > An: "users" 
> > Gesendet: Samstag, 4. April 2020 03:02:07
> > Betreff: Re: best way to get wysiwyg with wicket
>
> > Here are couple examples
> >
> http://www.7thweb.net/wicket-jquery-ui/plugins/wysiwyg/WysiwygEditorPage?1
> > https://github.com/wicketstuff/core/tree/master/tinymce3-parent
> > https://github.com/wicketstuff/core/tree/master/tinymce4-parent
> >
> >
> > On Sat, 4 Apr 2020 at 01:24, Korbinian Bachl
> > wrote:
> >
> >> Hi,
> >>
> >> I need to be able to let complete novices edit and write nicely
> formatted
> >> texts in an backend thats powered by wicket (required e.g.: H1-H4,
> normal
> >> text, bold text, images - only simple stuff mostly).
> >> In the past I used the ckeditor but that outputs html and Im not sure
> that
> >> cluttering font sizes and stuff like that into anything that needs
> later be
> >> to transformed to be used on either desktop or mobile in the year 2020
> is
> >> still as sufficent as it was 10 years ago. So I stumbled over markdown
> that
> >> might be a way to avoid this, but not sure If I missed somthing better?
> >>
> >> Beside, has any of you an idea where to look at to put this together
> with
> >> wicket, especially as I need to be able to have them insert images from
> >> some gallery picker that gets its image-resources from some kind of
> >> dataprovider.
> >>
> >> Any idea or solution is greatly appreciated. I know this is not pure
> >> wicket related stuff but I hope its still ok to ask here.
> >>
> >> Best,
> >>
> >> KB
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >
> > --
> > Best regards,
> > Maxim
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: best way to get wysiwyg with wicket

2020-04-04 Thread Korbinian Bachl
Hello Maxim,

thank you for the list. However, beside that tinymce3 + 4 are quite outdated 
isn't there anything non html-wysiwyg existing so far? 
My problem is that, after we use tinymce in another part of the project we made 
the experience that letting non-tech people write HTML (even in WYSIWYG) mode 
just doesnt work. They end up copy n pasting from all over the web and 
inserting things they neither see nor understand - thats why we need some 
simplification like markdown (e.g.: https://ui.toast.com/) or even pure 
block-based editors (https://editorjs.io/)...

I've stumbled over toast UI (https://ui.toast.com/), but I'm not sure if wicket 
would be able to execute some kind of JS function (editor.getMarkdown()) on 
before sending the form and catching it into a model...? 

Best,

KB

- Ursprüngliche Mail -
> Von: "Maxim Solodovnik" 
> An: "users" 
> Gesendet: Samstag, 4. April 2020 03:02:07
> Betreff: Re: best way to get wysiwyg with wicket

> Here are couple examples
> http://www.7thweb.net/wicket-jquery-ui/plugins/wysiwyg/WysiwygEditorPage?1
> https://github.com/wicketstuff/core/tree/master/tinymce3-parent
> https://github.com/wicketstuff/core/tree/master/tinymce4-parent
> 
> 
> On Sat, 4 Apr 2020 at 01:24, Korbinian Bachl 
> wrote:
> 
>> Hi,
>>
>> I need to be able to let complete novices edit and write nicely formatted
>> texts in an backend thats powered by wicket (required e.g.: H1-H4, normal
>> text, bold text, images - only simple stuff mostly).
>> In the past I used the ckeditor but that outputs html and Im not sure that
>> cluttering font sizes and stuff like that into anything that needs later be
>> to transformed to be used on either desktop or mobile in the year 2020 is
>> still as sufficent as it was 10 years ago. So I stumbled over markdown that
>> might be a way to avoid this, but not sure If I missed somthing better?
>>
>> Beside, has any of you an idea where to look at to put this together with
>> wicket, especially as I need to be able to have them insert images from
>> some gallery picker that gets its image-resources from some kind of
>> dataprovider.
>>
>> Any idea or solution is greatly appreciated. I know this is not pure
>> wicket related stuff but I hope its still ok to ask here.
>>
>> Best,
>>
>> KB
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
> 
> --
> Best regards,
> Maxim

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org