I have a notificationBar and a commandButton to show it. It works fine, but I need the notificationBar hide itself without the need to click a commandButton to hide it.
Is this possible?
Thanks.
Generally what you have to do to close the notificationbar is the following is to call notificationWidget.hide() when you specified widgetVar="notificationWidget" as a attribute of the notificationbar.
If you would like to have a cross inside the bar to close it, you have to put a commandButton or just a button inside the notificationbar and which calls notificationWidget.hide() on click.
To close the notificationbar after some fixed time you have to register a timer when the notificationbar shows. I.e. setTimeout(notificationWidget.hide, 3000) to close it after 3 seconds.
If you know more exactly what you want to do give some more information or some code, so that i can give you some more concrete answer.
Related
With vaadin 23.1.x you can set a itemClickHandler when a user click on a item/row in the grid with myGrid.addItemClickListener(..)
This works fine.
But if you have a component column, with a button in it, then the ClickEvent of the Button is fired and also the itemClickListener of the grid row.
Is there a way to prevent the button click from also triggering the itemClickListener?
You must use this method to add the listener them you can
myGrid.getElement().addEventListener("item-click",
event -> ...)
.addEventData("event.stopPropagation()");
I'm not 100% sure if the even is item-click or just click.
I'm having issues getting a TToolbar Button to appear "enable"
The button has an Action assigned to it - which is fire by the OnClick event
It is also setup with a Drop Down Menu, which has 2 options on it, both of which are enabled, and both of which fire off when clicked.
Despite all this the TToolbar Button steadfastly remains greyed out, but accepts the clicks.
Any suggestions?
You're doing things wrong. :-)
When using actions, you don't use the button's OnClick event - you put the code in the action's OnExecute event instead (because that's what's executing - the action - and not the button). When an action is assigned to the control, the control cannot be enabled until there's a handler for the TAction.OnExecute.
The reason for using actions is so you can put the code in a single place (events related to the action), and then every single control attached to that action uses that common code to perform the same functionality. Editing the code in that single location means all controls attached to that action see the same changes.
If there's nothing attached to the TAction.OnExecute event, the control has nothing to do if it was selected (clicked), and so there's no reason to enable it in the first place.
In case someone else comes across this, I just had this problem (using Delphi 10.2 Tokyo).
For some reason, the "EnableDropdown" property on the TToolButton caused the button to to be greyed out when set to true. Setting this property to false seems to have resolved the problem for me (the dropdown menu remains functional anyway).
Let's say I have two tabs tabA and tabB. When I click on tabA the first page of that section appears, call it tabA1. If I click on a link on that page then page tabA1 is replaced with tabA2. If I then click on another tab, say tabB, and then go and click on tabA again I get an image of tabA2 lingering for a bit.
How can I make it so that clicking tabA will always show tabA1 straight away? Is it saving it in the cookies for fast access?
Before switching additionally try setting the content in the tab (or equivalent wrapper) to display : none.
This is happened to me and that's how I fixed it. Although I know it fixes the symptoms and not the exact problem.
I've ran into a problem with something quite simple. When I click #mybutton I want to trigger a click on another button.
$('#mybutton').click(function(){
$('#otherbutton').trigger('click');
});
When I first click #mybutton the #otherbutton will trigger once. When I click #mybutton the second time the #otherbutton will trigger twice. When I click #mybutton the third time the #otherbutton will trigger three times...and so on.
How can I stop this so that #otherbutton will only trigger once for each click of #mybutton?
EDIT
Aha! I've just realised this is due to fancybox (where the buttons live).
The buttons are clicked from fancybox popop, which is also triggered to open every time before the buttons are clicked.
$('#planApp-link').fancybox().trigger('click');
I'm still not sure how to prevent this from happenning.
instead of using trigger("click") u can use
$('#otherbutton').click();
this function it ll trigger the click function
$(".clas1").on("click",function(){
$(".clas2").click();
});
$(".clas2").on("click",function(){
alert("div2");
});
.
how can I animate only a part of an element?
I show/hide a div using jquery-ui's show method but I'd like to start/end the animation from/to a given height of the element.
My dev website can be seen here (link removed). When clicking on the 'Contact' button the contact page shows up or hides if it's already open. Since I couldn't find how to starts my animation from a given height I added a fixed button when it's closed, but when the contact button of the contact page overlaps the fixed button when it's closing...
Any help welcome!
looking for something like this??
http://jsfiddle.net/rlemon/F6Efp/8/
You can also add any fade or whatever effects. This is using a single button to animate both open and close. You could also attach a attribute to the button tag to define it's current state.