updatepanel never triggers the OnSelectedIndexChanged function when I use fullcalendar - updatepanel

I want to develop a fullcalendar based web, and all goes well until I met this question, I use a jQuery dialog when fullcalendar day click,and I plan to use updatepanel to make my dropdownlist linkage in jQuery dialog. But I found the OnSelectedIndexChanged function never triggered. I found when I add this code style="display:block"on the <div>, all code works well, when I use the jQuery dialog, the updatepanel never triggers the OnSelectedIndexChanged function.
So, is it means that I cannot use the updatepanel in the jQuery dialog?

Related

How to re-init kartik-v editable rendered via ajax

I have set up a controller to renderAjax() and JS function to load() into a modal.
The problem occured upon re-opening the modal. I've searched through the issues in kartik-v github and he said that the Editable plugin needs to be reinitialized. Also he mentioned about a destroy() function.
How should I do it?

Difference between ng-click and on-touch in ionic 1 framework

which click event is best in ionic HTML page?
I had developed ionic 1 framework. I had used ng-click and on-touch on the HTML page.
ng-click code:
<ion-floating-button ng-click ="vm.addExpense()" has-footer="false" icon="ion-plus" iconColor="#fff">
on-touch code:
<ion-floating-button on-touch="vm.addnewCharge()" has-footer="false" button-color="rgb(84, 44, 99)" icon="ion-plus" iconColor="#fff">
The difference according to the docs is that on-touch fires immediately on touch and does not wait for the release event.
Called immediately when the user first begins a touch. This gesture
does not wait for a touchend/mouseup.
Here's a reference to the docs:
http://ionicn.com/docs/nightly/api/directive/onTouch/
ng-click is definitely the best choice.
ng-click is the way to go with ionic and it will take care of the touch/click 300ms-delay. The Ionic devs have put a lot of work in this to be so simple.
So no need to use the external module ngTouch
http://ionicframework.com/blog/ionic-huge-update/431 -- see the paragraph with Adamclick!

Is there a way to see helpful information regarding event listeners in chrome/firefox developer tools?

Since I am binding to a click event with jQuery, it is really hard to figure out where that code is in my application.
The event listeners panel in chrome looks like this:
However, when clicking on the definition, I am taken to jquery. There is no way to figure out which function was sent to jQuery, even if I blackbox the jquery script.
In firefox developer edition is see something similar:

Website button click - Perl WWW::Mechanize

I try to use the perl script to automate the interaction with a website.
I use module WWW::Mechanize to realize my design. But I cannot perform the button click in my perl script by using command as below.
$mech->click( $button [, $x, $y] )
$mech->click_button( ... )
It is because this button does not belongs to any form and without name, I can not call or locate this button in my perl script. How can I make it possible to click this button in my perl script like I interact with browser? Thank you.
<button class="button transactional" id="checkout-now"><span>Check Out Now</span></button>
If button does not belong to any form it should have onclick event defined, like #Bilzac and #hijack mentioned. In this case you are not able to reproduce browser's behavior because WWW::Mechanize does only html analysis.
Dealing with JavaScript events it's more easy to implement browser's network activity rather then implementing whole JavaScript events and DOM interaction.
Well sometimes all you need is $mech->post() because it's harder to find what going on with JavaScript when you click some element.
So you need to find what request is performed when you click this button (you may use Firefox HttpFox for this) and after that construct same request using WWW::Mechanize:
$mech->post($request_url, Content => {FORM_FIELDS...});
You can add onclick event on this button. like this:
<button onlick="alert('hello');">Click Me</button>
Clicking the button in a browser only runs a piece of JavaScript. You can't do that in WWW::Mechanize, because it has no JavaScript support.
What you could do, however, is find the JavaScript code that's being run when the button is clicked and write some Perl code to do the same thing. Unfortunately, it can sometimes be hard to find which JavaScript event handlers apply to an element. Even the otherwise excellent Firebug doesn't seem to have any simple way to list all event handlers associated with an element. (There does exist an Eventbug extension, but at a glance it doesn't seem to work very well.) The Visual Event bookmarklet might also be worth trying.
I am not 100% sure what you are asking for, but I am going to swing at it.
You do not need the button to be part of a form for any sort of interactivity. You can do this with just JavaScript & HTML.
$('#checkout-now').click( function() {
alert('Hello!');
//Do other stuff here, regarding the form! (Call Perl scripts etc.)
});
http://jsfiddle.net/fCdxR/1/
Quick example of how it works!
Hope this solves your problem.

Primefaces - using dialogs and layouts

I have a (JSF 2.0/ Primefaces 2.2RC-SNAPSHOT) app that has
<p:layout>
I use a lot of dialog in my application and before the newest version of primefaces came out there was no way to display a dialog with a modal on top of the layout without putting the dialogs outside of the tags.
So I did just that. The issue I am having now is I am noticing that constructors and postcontructs are being called when my application is loaded. This is because the view with the layout is being loaded and therefore all my dialogs are being loaded.
I don't want these constructors being called until I am actually dealing with the appropriate views in my application.
I have been testing the appendToBody attribute on the
<p:dialog>
tag but it seems really buggy. Everything works fine on the initial rendering of a view. I can open a dialog close it etc and it works fine. If I navigate away to another view and then come back to the initial view and open the dialog, everything is running off the page. The dialog window is in the correct place but the content is not.
My question is 1. Is there a way I can have the dialog windows outside of my layout as a child of the
<h:body>
without having all the managed bean constructors associated with them initiated when the application loads?
Or does anyone know how to fix the alignment issue when using the appendToBody tag? Thanks.
When using layout and dialog, I usually place my dialogs outside of the layout as a direct child of the body element. I have a special ui:insert part in my page template for this.
appendToBody was added to make this easier, if it doesn't work well for you, give this approach a try. I know modal dialogs and layout can work this way.
without having all the managed bean constructors associated with them
initiated when the application loads
Maybe the managedbean gets loaded when your dialog is rendered.
Try rendering the dialog only after the button click, perhaps byputting rendered="#{mybean.flagLoadMyDialog}" on the dialog, and set the flagLoadMyDialog when the button is clicked using ajax.
Also remember to ajax-update the dialog after the button click.