I'm using color picker from this example:
http://www.7thweb.net/wicket-jquery-ui/slider/ColorPickerPage?2
and I trying force Picker to change color on slide, no on onValueChanged (now it react when sliding end) but I'm fail.
anyone knows hot to do it?
As a general rule, it is a bad practice to send ajax request on mouse move. That's why
AjaxSlider is not designed to handle the 'slide' event; it will send too much ajax requests...
Furthermore, Slider/AjaxSlider are designed to be FormComponent(s). For this to be possible, the Slider component embeds an hidden input and the 'slide' event is - then - used to update the input value as soon as the slider... slides. So you cannot use ColorPicker/AjaxSlider/Slider to achieve this.
You can still do your own (but I am afraid it wont be a FormComponent). If you need to get inspiration, you can have a look on ResizablePanel (& ResizableBehavior). This is one of the simplest component handling ajax requests...
Hope this helps.
Related
I have not found a configuration option in the docs for either widget, but is there a way to implement the noUiSlider or jQuery UI Slider to provide this functionality in a localized way (localized = allow default functionality where needed in other sections of the DOM):
User must click and drag the handle to set a value
User cannot click on the bar to set the value -> value not set to where user clicked
This is for a business requirement, and while I don't mind learning how to re-write a slider from scratch in vanilla JS, it is quite nice to use well-supported widgets. Thanks in advance.
You can do this in noUiSlider by setting behaviour: 'none'. See the documentation for more info.
I am developing a jQuery Mobile application that will run into a Cordova wrapper.
I am struggling to understand the use of each pagecontainerX event and when to use which.
I will post three specific use cases:
1) hook click events:
Say I want to assign a handler to a certain click event on a button.
2) change textual content of the page:
Say I have a page and I want to update some content that might have changed since last time I have shown the page.
3) change graphical content of the page:
Like if I want to draw on some canvas, or in cases where I need to know how things are rendered and their size.
Preliminary answers:
these is what I have found myself, but I would really much appreciate comments:
1) I am using the pagecreate event, as it's only called once. It is also possible to specify what specific page you want to hook the handler to by doing: $(document).on("pagecreate", "#pageid", handler);
2) I am using pagecontainerbeforetransition or pagecontainerbeforehide. Pagecontainerbeforehide has the advantage that is only fired once, while the other is fired twice (dunno why). Other options, like pagecontainershow, will change the content after transition, which is a bit weird to look at.
3) In this case I am employing pagecontainershow, so that things have already been graphically rendered and I can compute heights and widths etc., the drawback is that the user will see the transition, and only after he will see the content of the page being modified.
The way Delphi by default updates the selection with a timer can sometimes look funny if people scroll very fast (losing track), so I would like to disable that.
However, what I would like instead is that it would update selection immediately on the OnItemClick event. (i.e. I would like to force update the selection immediately before hen doing the rest of processing in the click event - that would be quite excellent.) However, after having tried quite a few things, this appears quite a bit more cumbersome to achieve than first expected.
I have tried force update selection, force animations, force updateselection etc. but none update the selection because of internal properties. Has anyone sucessfully done with without making changes to the listbox code directly?
I'm using jQuery UI Sortable behavior and have come upon a situation in which I needed to start the sortable drag behavior from interaction with another element other than the original handle (which is not visible at the time).
I have managed to put together a way to achieve this thanks to suggestions in some posts and the use of jquery.simulate.js (used to run official jQUI tests) and I can procedurally start the sortable drag process in pretty much all browsers except IE8 and below, simulating the events like so:
item.simulate('mousedown',pos).simulate('mousemove',{ clientX: pos.clientX+1, clientY: pos.clientY});
Problem: In IE8 (or below), after the interaction with the outside 'handle' and simulation of mousedown and mousemove events, the drag is indeed correctly started, but as soon as the user really moves his mouse in any way/shape/form, the drag stops or cancels as if the 'mouseup' event had ocurred to finalize it.
I highly think this is due to some fundamental difference in the old fireEvent (IE8-) method vs the dispatchEvent that everything else uses, but cannot quite figure out how to, or if it's possible to prevent it.
What I'm looking for are snippets of what may be done to correct this or suggestions as to why this is happening and if it can have a workaround of some sort to prevent the cancelling (such as is the behavior that occurs in any other browser using dispatchEvent instead of fireEvent).
Have put together a small example for you of the success (any recent browser) or failure of the situation described: demo
TL;DR: Have put together a small way to procedurally start a jQUI sortable drag (through jquery.simulate.js, link above), but it fails to work or cancels itself in IE8-. Need some guidance or suggestions about how to overcome that. Check above demo
I am using the new BrowserField2 in BlackBerry OS5 to display HTML content in my app. There are 3 options available for navigation through links in that content.
CURSOR navigation uses a block cursor and actually moves through the characters of the page. Not very useful for me.
POINTER navigation uses a mouse like pointer that you move around the screen and hover over elements. This could work but there is a bug however in that the browser field captures navigation and never lets go so this mode is effectively broken if you share a screen with any other managers. Once your focus enters the browser field you cannot move focus back out and into neighboring fields. RIM has acknowledged the bug but has no work around.
NONE which is for custom navigation but they offer no explanation as to how you would do this.
What I ideally want is to simply have trackpad movements move the focus through the links and highlight them. Then a click would activate the link. I assume I would select the NONE option above and implement my own focus navigation but I am not clear how this can be accomplished with the new APIs.
Is anyone familiar with the new browser2 component could give some guidance?
Thanks!
There's a workaroudn to getting back the focus out of the BrowserField using the NAVIGATION_POINTER.
I found it in this thread:
http://supportforums.blackberry.com/t5/Java-Development/BrowserField-2-Navigation-Mode/td-p/632172
"farahh" posted this:
I found out a hack..
with the navigation set to pointer mode, a click outside the browserfield manager invokes Manager.invokeAction(int). I used the getFieldWithFocus to verify which field has focus and then switch the focus to something else.
Cheers.
Nahuel
PD: i havent found out how to get the behaviour you want, i need that as well so if you got it working please let me know, its kinda urgent in my project =(
I actually reverted back to the older browser1 (OS4) component because the navigation problems in browserField2 (OS5) were a deal breaker for me. Luckily the OS4 browser does everything I need in terms of functionality and it has the exact navigation behavior I need and there are no focus problems mixing it with other views.