Change primefaces dialog size on client side - jsf-2

I change the size of a primefaces dialog with:
dialog.css('width', '650px');
The dialog is getting bigger but its content is not resized. When I change the size of the dialog on a corner with the mouse, its content is updated (div with ui-resizable-handle css class).
So probably I have to call another javascript method to emulate the changing how it was done with the mouse?
Unfortunately I haven't found the method. Somebody has done this already?
Regards
Oliver

dialog.trigger('resize'); does it.

Related

jQuery Mobile popup that doesn't move when scrolling the page

I am using jQuery Mobile 1.3.0 RC1. I have a popup that I create programmatically at the bottom of my page and close after a few seconds using setTimeout (toast notification). It works very well, however if I happen to scroll the page while the popup is displayed, the popup gets scrolled too. I would like the popup not to move, i.e. stay in its position relative to the screen, not relative to the page. Is there a way to do that ?
I have tried playing with the data-position-to attribute in the HTML element, with the positionTo option of the "open" method, and tried placing the popup element inside a fixed transparent footer, none of these resulted in the desired behavior.
I had a similar problem last week. Finally solved it using modal dialog instead of popups.
For popups, I could find following.
$("#myPopup").on({
popupbeforeposition: function () {
$('.ui-popup-screen').off();
}
});
Which helped me in prevention of closing the dialog while user touched outside of popup. But scrolling issue was still there. So I changed all popups to modal dialogs. Hope it helps someone.

Highcharts Doesn't Refresh at Colorbox but Automatically Refreshes When Inspected at Firebug

I have highcharts graphic at my main HTML. I put it in a small div so some parts of graphics is not showed. When user clicks a button it opens at colorbox as a popup however doesn't refresh its size. When I click to inspect with Firebug it suddenly refresh its size and everything is normal. When I close colorbox it it still big and I can not see many part of the graphic too.
Is there any idea about how to refresh Highcharts graphic and why it is refreshing itself(what I want) just when I click inspect element with Firebug?
PS: It works when I resize the windows not related to Firebug. There is something here seems same problem with mine: https://github.com/highslide-software/highcharts.com/issues/472
I called window.resize after data loaded and after colorbox closed, it solved the problem.
Without an example to look at its hard to tell, but here is what I think is happening:
First check if the option reflow is set to true. If it is then Highcharts will monitor window.resize events and redraw itself when a resize occurs. My guess is that when activating Firebug, the window is resized and the chart is redrawn.
If you want to manually set a new size of the chart you can use the api method setSize(). To only redraw the chart you should use redraw().

Is there a traditional modal dialog in JqueryMobile 1.0 library (not a plugin)

I was able to use the dialog, but need a typical modal dialog which has the current page in the background and the dialog is on top of the current screen.
The default dialog seems to take the whole screen and the current page is gone with the mobile.changepage call to display the dialog. Even if there was a way to adjust the height and width of the dialog it still wont serve the purpose since the previous page is already gone.
I believe there are some plugins, but I'm wondering if there is one which comes with the default library (1.0 final version) or if there is a way to create one using the library without a lot of coding if it is possible.
At this moment,this support is not there in JQM 1.0 library.But this feature is going to be there in the 1.2 version as per the JQM blog http://jquerymobile.com/blog/ . In the meanwhile you can check http://filamentgroup.com/tests/popup/docs/pages/popup/index.html to see a rough preview.May be you can check the source code and see if it is possible to do so in JQM 1.0
Hope that helps.
Good Luck!!

Using codemirror in jquery.ui.dialog loses focus onload

i try to use codemirror in a jquery ui dialog.
here you can see the result in jsfiddle.
http://jsfiddle.net/HtntY/
the problem is that the content in codemirror does not appear on first load. it only appears after you set focus on the editor and than type something, after that the preloaded content appears.
can this be fixed somehow. i tried to do it with the refresh() function without success.
thanks for you short time.
Looks like jQuery UI hasn't actually unhid the DIV when the opener runs. Putting a refresh call in a timeout (as in http://jsfiddle.net/NP9SL/ ) seems to do the trick.
I ran into the same problem and wound up running the editor.refresh() off the focus event, FWIW. I thought I'd mention another, somewhat related problem. If you try to take advantage of the CodeMirror dialog/search functionality inside of JQueryUI modal dialog, the integrated search dialog fails to get focus and you can't type into it. Interestingly I can paste text into the search field, but I cant type. Have yet to find a way around this other than setting modal to false.

sIFR text getting stretched vertically in IE9

I've got a site that's using sIFR, and some of the replaced text is being stretched vertically in IE9. It's only happening in places where the text wraps 2 lines, and it fixes itself when I hover my cursor over it. The sIFR text is a link, but I'm not sure if that has any correlation.
I've tried various settings changes like fitExactly, forceClear, and forceSingleLine (though I want it to be able to wrap), and those didn't work. I've tried changing the font-size, line-height, and all other dimensions to px instead of em. innerHTML isn't being used anywhere on the page. It's frustrating that it works after being hovered on, but not before.
And I know you're probably thinking "use cufon or #font-face, dummy" but I'm stuck with sIFR for now. The client wants what the client wants...
I've found a solution,
if you try to hover with mouse cursor the text will display correct so..
I write few line of code to put in sifr-config.js
forcing flash reset "onReplacemment" callback only when IE9 is detected
you must use Jquery for browser detection or use another javascript way
see the link below:
http://www.voo-doo.net/robotphobia/2011/05/fix-sifr-ie9

Resources