wicket-jquery-ui icon indicating copy to clipboard operation
wicket-jquery-ui copied to clipboard

Feature Request / prepend scripts of DialogBehavior.open()

Open Patrick1701 opened this issue 9 years ago • 14 comments

Hi Sebastien, possibly I have a quite similar issue like in #88.

You added a prependJavascript() to the DialogBehavior.close(...).

Since some weeks I'm working on a JQuery SelectMenu, I would like to contribute to you, when some proof of concept is done. Since the last jquery-ui update I got some rendering problems. It collapses in dialogs, because the jquery-ui guys added some recalculation features for the element size.

To let that work correct, the dialog must be visible.

Due to the appendJavascript() all jqueryui components I try to refresh onOpen() determine a hidden dialog/html container which leads into a 0px calculation (it collapses).

When prepending the onOpen-js the dialog is already visible in DOM and the calculcation can be done correct.

Do you think it would be possibly also preprending the open-js without any api and behavior breaks for your dialogs?

kind regards Patrick

Patrick1701 avatar Nov 24 '15 11:11 Patrick1701

Patrick... it seems I have just forgot this issue! Will try to investigate asap...

sebfz1 avatar Dec 11 '15 14:12 sebfz1

Hi Patrick,

I am not sure to fully see the problem. Do you have a quickstart that could demonstrate to problem?

Thanks in advance, Sebastien

sebfz1 avatar Dec 11 '15 15:12 sebfz1

Hi Sebastien, ok... I think the easiest way to show this is by creating a quickstart with my SelectMenu/DropDownChoice-Component.

As I said, I want to contribute it anyway, so maybe this could be a good moment. :smiley:

I will prepare a branch, add the component and create push request. What I was asking myself since some weeks is, if I should name the component SelectMenu, to be nearer to JQueryUI or DropDownChoice to be nearer to Wicket? (By the way, I'm extendending DropDownChoice) What do you think?

But I need some time to prepare it... just got back from my holidays. Today is my first.

kind regards Patrick

Patrick1701 avatar Dec 14 '15 09:12 Patrick1701

Hi Patrick,

if I should name the component SelectMenu, to be nearer to JQueryUI or DropDownChoice to be nearer to Wicket?

Good question. Usually, I try to be close to Wicket component names. I main idea is that the user can switch from one implementation to another just by changing the import(s)... The rule is if the jQuery UI widget is the graphical representation of the same built-in component (furthermore if it extends it, having same ctors), then I try to keep the same name. Otherwise, I take the name of the widget.. But it is not 100% true. In Kendo UI for instance, the kendoDropDownList widget is named DropDownList but still extends DropDownChoice, whereas the kendoGrid widget is named DataTable even it does not extends the built-in DataTable (but it actually have almost same ctors) :)

Best regards, Sebastien

sebfz1 avatar Dec 14 '15 10:12 sebfz1

Hi Sebastien, I prefer DropDownChoice, because I like the idea of just changing imports.


Concerning my feature request again...

I think, I have a more common problem. Prepending the script is just a work-around for dialogs. Today I had the same problem with Accordions.

Please read my bug report to JQueryUI which has been -unfortunately- closed as not-a-bug. https://bugs.jqueryui.com/ticket/14825 Then you will see why I opened this issue here.

Maybe, do you have an idea concerning this problem?

I don't like the solution scottgonzalez suggested. My first idea was, handling this in your project for dialogs, but it is also a problem for accordions and possibly other components, which are initialized hidden when rendering and containing a select-menu.

I'm not sure, what I should do, now. (hoping for a " sudden inspirations" by you)

kind regards Patrick

Patrick1701 avatar Dec 15 '15 15:12 Patrick1701

Hi Patrick,

Ok, noted. I am waiting for the quickstart so I can investigate...

Best regards, Sebastien.

sebfz1 avatar Dec 15 '15 16:12 sebfz1

Hi Sebastien, I created a further branch (SelectMenuCollapsingInDialogs) for investigating.

I prepared the SimpleDialog sample to show what happens. Just follow my notes in SimpleDialog.onOpen(AjaxRequestTarget target).

best regards Patrick

Patrick1701 avatar Jan 25 '16 15:01 Patrick1701

Hi Sebastien, did you have time to have a look at my SelectMenuCollapsingInDialogs Branch?

kind regards Patrick

Patrick1701 avatar Mar 10 '16 13:03 Patrick1701

Hi Patrick,

Yes, I did had a look some time ago but I did not found a solution... I need to retry but it's rather complex! :)

Thanks for the reminder & sorry for the delay, Sebastien

sebfz1 avatar Mar 10 '16 14:03 sebfz1

Is it possible for you to create a copy of my Branch? I just upgrade to the your newest version and it seems there is a bug in the kendo scheduler, I would like to investigate. But I need the new code and going to delete my fork, and fork again to have the new kendo scheduler code.

Patrick1701 avatar Mar 10 '16 14:03 Patrick1701

Copied.

About the scheduler, I recently did a massive usage of it for "testing purpose"... I did some changes/enhancements, but I hope I did not broke something! :/ Please check out the latest commits / release notes, your kendo-ui version, and open an issue so we can discuss this...

Thanks & best regards, Sebastien.

sebfz1 avatar Mar 10 '16 14:03 sebfz1

It looks like the JQueryUI guys fixed this issue.

Have a look: 1.11.4 with collapsing selectmenu: http://jsfiddle.net/r3z2fn0g/1/

1.12.0 without collapsing selectmenu: http://jsfiddle.net/Patrick1701/vwkq3jpy/

So, It seems to me, I won't need this feature request anymore. I'll do some further tests and close this issue later on.

Patrick

Patrick1701 avatar Nov 24 '16 13:11 Patrick1701

That's a very good news Patrick, because I had no idea how to solve it on my side ! :)

sebfz1 avatar Nov 24 '16 13:11 sebfz1

Lol. I got cheated. Ok, my jsfiddle defined width of 50% for the selectmenu. They added a default width of 14em to any selectmenu by default. 14em are (coincidentally) the half width of the dialog.

Patrick1701 avatar Nov 24 '16 13:11 Patrick1701