How can I add a title to a disabled icefaces commandbutton? - icefaces

I would like to display a title (tooltip) on a disabled icefaces commmand button, to explain to the user why the button is disabled. But icefaces seems not to render the title when disabled is true

As a workaround, you can use an image for the button which will have it's title even when the button is disabled.
<ice:commandButton id="cmdBtn" title="Submit Form"
disabled="#{bean.disabledBtn}"
action="#{bean.submitAction}">
<ice:graphicImage title="#{bean.disabledBtn?
'Button disabled':'Button enabled'}"
style="border:0; vertical-align:middle;" url="#{bean.btnImgURL}"/>
</ice:commandButton>

Related

Disable add to cart button before modal confirmation is shown in prestashop 1.7

On my prestashop 1.7.6.8 I am noticing a very slow timing to add the product to the cart and then to show the modal popup of confirmation.
Is it possible to avoid users click on button during this latency?
Thank you
Hi I done it like that:
$(document).ajaxStart(function(){
$( '.add-to-cart' ).addClass("sending");
});
$(document).ajaxStop(function(){
$( '.add-to-cart' ).removeClass("sending");
});

Add text next to UI Form action icon in toolbar?

Is there a way to add text next to the action icon in the toolbar of an eclipse RCP UI Form? If you do not assign the Action an ImageDescriptor, the action will be displayed containing only text. If you do give it an ImageDescriptor, it displays only the image. I want to display both side by side, within one button - is there a way to do this?
This will have only the text "Description" in the button on the toolbar:
myAction = new Action("Description", SWT.PUSH) {
#Override
public void run() {}
};
myForm.getToolBarManager().add(myAction);
But adding an image will cause the the text to be replaced:
myAction.setImageDescriptor(newImage);
I was eventually able to find an answer to my issue, hopefully it's helpful to anyone else who runs into this problem. I found this in the Eclipse Rich Client Platform (2nd Ed.) book.
The Action must be converted to an ActionContributionItem with its mode set to MODE_FORCE_TEXT. This will display both the text and the image in the toolbar.
ActionContributionItem aCI = new ActionContributionItem(myAction);
aCI.setMode(ActionContributionItem.MODE_FORCE_TEXT);
myForm.getToolBarManager().add(aCI);

Customize button clear in Orbeon

Is it possible to customize 'clear' button in form runner? I want to keep some default values in form (after user clics on this button), and I want to 'clear' button leave those values and doesn't clear them.
Now I want to add refresh button or add refresh action to clear button. In my properties I have line:
<property
as="xs:string"
name="oxf.fr.detail.buttons.*.*"
value="refresh pdf save-draft review workflow-send"/>
But unfortunately in form runner I don't see refresh button
If you add 'fr:buttons' tag into your form, you're able to add your own buttons. This tag should be placed in '<fr:view>' just after the '</fr:body>'. If you have configured the property oxf.fr.detail.buttons.*.* to define the buttons that you want to show, it will override it. You have to explicitly place the buttons that you want to show, e.g. <fr:save-button/>.
I've created a quick example to show it. The following fr:buttons would show a custom clean button together with Orbeon's 'Save' and 'PDF' buttons:
<fr:buttons xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:p="http://www.orbeon.com/oxf/pipeline"
xmlns:xbl="http://www.w3.org/ns/xbl">
<fr:button>
<xf:label ref="'Clear'"/><!--You can change it to a localized path-->
<xf:action ev:event="DOMActivate">
<!--Clean fields, but keep values for lastname and phone fields-->
<xf:setvalue xxf:iterate="instance('fr-form-instance')/section-1/*[name()!='lastname' and name()!='phone']"/>
</xf:action>
</fr:button>
<fr:pdf-button/> <!--Orbeon PDF button-->
<fr:save-button/> <!--Orbeon save button-->
</fr:buttons>
You can see another example about custom buttons in the following link: http://wiki.orbeon.com/forms/how-to/fb-fr/form-builder-wizard

Add a popup Pane to crossrider add-on icon and bliking icons to the add-on icon

I wanted to migrate my existing add-on for firefox and chrome to crossrider in order to have it also with safari and IE, but i've a few doubts that mayble Schlomo (or any Crossrider developercan) can help me to solve them.
Questions :
Can i add a popup pane when someone clicks on the add-on button showing some kind of options inside it?
Can i add a blinking icon to the actual icon showing some kind of event happened like incoming chat or so?
Is there a way to add the red text box like in chrome showing at the bottom right of the icon some kind of text?
Thanks a lot!
When you pose the question like that, I can only hope the following answers will serve to allay your doubts and enlighten :)
First off, I would recommend familiarizing yourself with How to add a browser button to your Crossrider extension in general and the button popup feature specifically.
In answer to your specific questions:
You can use the button popup feature and build the required options in there. Take a look at the Button Popup Menu demo extension to get you started.
Whilst you can't make the button blink, you can alternate the button icon to make it look like blinking (see example).
In short, yes. Simply use the appAPI.browserAction.setBadgeText and appAPI.browserAction.setBadgeBackgroundColor methods (see example).
The following example bring together the key elements in the background.js code required to achieve the solutions mentioned. Look at the popup.html file in the Button Popup Menu for an example of how to build the options page.
appAPI.ready(function() {
var sid, // Blink interval id
alt=0, // Blink alternation state
icon = { // Blink icons
0: 'icons/icon0.png',
1: 'icons/icon1.png'
};
// Set the initial icon for the button
appAPI.browserAction.setResourceIcon(icon[0]);
// Sets the popup for the button
appAPI.browserAction.setPopup({
resourcePath:'html/popup.html',
height: 300,
width: 300
});
if (true) { // blink condition, set to true for this example
// Blink icon
sid = appAPI.setInterval(function() {
alt = 1 - alt;
appAPI.browserAction.setResourceIcon(icon[alt]);
}, 1 * 1000);
} else {
appAPI.clearInterval(sid);
}
if (true) { // show button text condition, set to true for this example
// Add red text box to icon
appAPI.browserAction.setBadgeText('ext', [255,0,0,255]);
}
});
[Disclosure: I am a crossrider employee]

Fancybox Modal control location

I'm using Fancybox afterShow to display image descriptions on the side via overlay like so:
afterShow : function (){
var description = "<div class='hidden_tab'>"+$("#tab").html()+"</div>"
$('#fancybox-overlay').html(description);
}
The problem is that I need modal to be false so users can click out. But the hidden_tab tabs, when clicked, also exit fancybox.
Is there a way to section where modal takes affect? Or a workaround? I have tried setting z-index for the hidden_tab to be high but this did not do the trick.
If you need to set modal : false then try adding closeClick : false (which prevents closing when clicking INSIDE fancybox)
BTW, the default value of modal is false. Don't assume that people will necessarily understand why modal was set to true in your script.