Cq5 building a number increment/decrement box - combobox

the above picture is what i need to build in CQ5, I have been digging around in adobe cq api,
all i have found is Class CQ.Ext.form.NumberField
but that number field only provide something like textfield for you to manually entering number(this is not what i need)
can anyone guide me how to create such number increment/decrement box in cq5 dialog? with some code example please, thanks

You can try CQ.form.Spinner with xtype spinner.
This is a trigger field for numeric, date or time values.
The spinner uses CQ.form.Spinner.Strategy which defines its behavior.
The dialog config snippet is shown here.
<numfield xtype="spinner" name="./numfield" editable="false">
<strategy xtype="number" allowDecimals="false" maxValue="50" />
</numfield>
For further info, check this Spinner API and NumberStrategy API

Have a look at the Spinner Widget with the xtype="spinner". There you can define the strategy of the spinner, e.g. the increment value. I never used it myself though, so I can't provide you with a running code example.

Related

RangeSlider component does not work inside Filter's shortcut in Polaris Library

I am using the Polaris library by Shopify to build an app. I am using RangeSlider with dual thumb for the filter.
However, when I add it as a shortcut inside my Filters, the slider does not work, i.e., I am not able to drag the ends of the slider
Note - If you go to More Filters -> Money Spent, the slider works fine without any issues, and I am able to drag both ends.
I tried manipulating the callback, but it didn't help and also does not throw any errors while debugging.
Reproducible Code Link to CodeSandbox => check Money spend filter
The problem seems to be that you are saving the data the user enters into rangeValue, but the code you have to add the filters (Line 198) is looking at moneySpent instead. Since moneySpent is never set, the filter is never added.

Codename One DateSpinner

I created a DateSpinner in my Desktop app,but the spinner is not displaying the month,day or year properly.half of the part was not visible to the user.
Can you please help to resolve the issue?
![DateSpinner Image][![Below link shows how the date spinner visible to the user]1]1
The DateSpinner class has been deprecated for a while. I suggest using the Picker component which is better looking overall. See: https://www.codenameone.com/javadoc/com/codename1/ui/package-summary.html

How to custom placeholder in international phone number plugin

I have problem with custom placeholder. I am using this https://github.com/mareczek/international-phone-number I want to add more ex. E.g. 131123456789 to my place holder which default gave something like this 131123456789. I read the document they use customPlaceholder to custom place holder, but they do not have any example with angularjs, so could someone show me example code with custom place holder like this.
Here my code that I added to my app
app.config([
'$stateProvider',
ipnConfig,
register_form_state
])->ipnConfig.customPlaceholder = 'E.g. 131123456789'
but it doesn't work for me.
This will solve this problem
http://hodgepodgers.github.io/ng-intl-tel-input/
Please refer this link & this is angularJS plugin
https://github.com/hodgepodgers/ng-intl-tel-input
On selection of country, placeholder will change
The documentation for http://hodgepodgers.github.io/ng-intl-tel-input/ is lacking, but it seems like it could be a good tool. I think I would personally like to see a working implementation inside of an existing application before I'd rule it as the solution to use. I'm still having trouble implementing this one compared to the one by mareczek.
edit To answer your question, I think that it changes the placeholder based on the flag you have selected. If you have it set to a default country, can you not just change the placeholder in the html? Or can you target it directly using css?

DNN - Custom Registration Form Field Does Not Validate for Required After Upgrade

I am upgrading a DNN site from version 5.06.00 to version 7.03.02. I followed the recommended upgrade path, and worked out all of the kinks with the custom modules. The registration form has a custom boolean field, which is required to be set to TRUE. This used to validate correctly pre-upgrade, but now it is not post-upgrade. The user can submit the form without selecting the "TRUE" radio button.
The custom field is displaying properly. The required asterisk is also displaying. The DOM even has an error message element with the correct custom required message:
<span class='dnnFormMessage dnnFormError'>[required message]</span>
However, this field is set to "display:none" by default and never displays as inline like the other error message elements.
I am not a DNN expert and I did not create this site. I am upgrading it for a client and don't know a ton about how these custom fields all work. I see the custom field enabled in Admin > Site Settings > User Account Settings > Profile Settings. I also see a file called "Profile.ascx.Portal-0.resx" that contains the custom field's main text, help text, and required text. It lives in DesktopModules\Admin\Security\App_LocalResources. I don't know what else I would need to configure or check that would be different from version 5.6 to 7.3.
Thanks for your help!
It seems like you've checked all of the requirements, but you didn't mention wheter or not the checkbox to require a valid profile for registration is checked. Is it?
Can you verify that the custom field is marked as Required?
It may be worth your while to upgrade to the current version of DNN 7, which is 7.04.02.
I'd recommend making a full site backup before doing the upgrade as that is always the right way to proceed.
The .resx file aren't going to affect the functionality, just the texts that are displayed.
I assume that you are doing much of this work on a test copy of the production site. That being the case, you might want to add another custom boolean field, make it required and see if that one works.
This isn't the ideal answer, but since I can't figure out what's wrong DNN-wise, I'm just writing some custom jQuery to find the checked radio button span element, then show/hide that error message based on that. If there is more than one thing wrong with the form, it will only show this message. Then if you corrected that boolean, it would show all other messages. It's not great, but at this point it's better than nothing.
$(".dnnPrimaryAction").click(function (e) {
var $checkedRadioSpan = $(".dnnRadiobutton-checked");
var $checkedRadioInput = $checkedRadioSpan.prev();
var $errorMessage = $checkedRadioInput.siblings(".dnnFormError");
if($checkedRadioInput.val() === "False") {
e.preventDefault();
$errorMessage.show();
}
else {
$errorMessage.hide();
// continue on with other validation
}
});
I had quite the same problem. It seems that the error message is not displayed for the first form item, as there is not enough place for it.
After adding a header (h2) above the form, it worked fine.
See Validator errormessage is not displayed in the DNN Community forums for more information.

click marker into a map instead of fill out the addressfield

I am using the openlayers addressfield, geocode and geofield modules in Drupal7 to let the users create content with relevant geodata. But for some content there is no streetname available. So i would like to have a prezoomed maparea where the user can click in and flag the right position, instead of typing in the addressfield.
I tried to use the geofield with the "Openlayers Widget Map", but it's not exactly what i need.
Does anybody know how to use the modules for that?
Is there a tutorial for that?
Kind Regards
Michi
thx for answering!
Yes, in theory it works. I tried it befor with the geofield module.
And yes, i could see the map in the contenttype form while creating a node.
But i havn't found a way to prezoom the map into relevant places (or use the geolocate bevahior for that) or change the marker style for that geofield map. The only mapstyle i can choose in the contenttype field setting is the "geofield widget map". So i have no choice to use an individual prezoomed map with own marker styles.
Changing the "OpenLayers Default Map" in the openlayers settings makes no difference.
So maybe i've overlooked something to customize the geofield, but the module has no configuration link. So without some more configurations, the module is not practicable for users to flag a node with geofield.
Any other ideas or informations?
You can do this with the Geofield module: http://drupal.org/project/geofield
When you enable that module, you can add a Geofield field on your content type and set the widget to be an 'Openlayers Map'... the geofield field lets you input geographic information in a variety of ways, but just clicking on a map is one way. It probably uses the default zoom and center you have saved for your Openlayers map.
Try that out and let us know if it worked!!
Here are the options for entering in address information via Geofield:

Resources