Mobile Apps. IPad. Hepler in the fields - mobile

I have a very easy application, allowing the users to enter the Data on iPad. However, when the user starts typing the text into the text field (using the xp:inputText), he gets the helper text, which is then automatically taken, if one either presses "space" or "forward" (in german it's called "weiter", hopefully it's the correct translation). So, it happens often, when the user types fast that at the end the wrong data is entered.
I don't know how to avoid it using the iOs own tools. I would be thankful if anybody tells me.
And, basically, is there any way to at least switch off or at the best to control these helpers from XPages side ?
No TypeAhead is used...

You can disable These features by adding two html attributes to your xp:inputText:
autocapitalize="off"
autocorrect="off"
You should check the the autocomplete option too.
Hope this helps
Sven

This example should work. Modified to use the two methods. Field 1 = (svens), Field 2 = change at runtime.
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:inputText id="inputText1">
<xp:this.attrs>
<xp:attr name="autocorrect" value="off" rendered="true"></xp:attr>
<xp:attr name="autocapitalize" value="off" rendered="true"></xp:attr>
</xp:this.attrs></xp:inputText>
<xp:br></xp:br>
<xp:br></xp:br>
<xp:inputText id="inputText2"></xp:inputText>
<xp:eventHandler event="onClientLoad" submit="true"
refreshMode="norefresh">
<xp:this.script>
<![CDATA[document.getElementById("#{id:inputText2}").setAttribute("autocorrect", "off");
document.getElementById("#{id:inputText2}").setAttribute("autocapitalize", "off");
]]></xp:this.script>
</xp:eventHandler>
</xp:view>

Related

how to find the Xpath for below given check box

enter image description here
Please tell me how to get the xpath for check box.
If you are using Chrome browser - one easy way you can use:
Open the Inspect (or just click the F12 key)
Mark the element you need and right click on it (or just right click on the object (the check box) you are looking for)
Choose Copy ---> Copy Xpath
I think the tshirt option is not public yet, did not get it in your site.I tried with shirts, looks like same dev pattern to me, let me know if the solution does not work.
<input id="Classic" class="facetChkBox" type="checkbox" value="brickstyletype:Classic" name=""/>
<label for="Classic"/>
This is the background html code.
As you already know, this is not the classic checkbox html code, so we need to create a xpath for this as shown below
driver.findElement(By.xpath(".//label[#for='Classic']"))
from the point of code reusablity I would suggest a method like this:
public void clickOnCheckbox(String checkbox){
driver.findElement(By.xpath(".//label[#for='"+checkbox+"']")).click();
}
and call it using
clickOnCheckbox("Blousons");
In this way you can use the same code to click on different check boxes, and create a clean code.
to relate more to what I am saying you can go the url
https://www.ajio.com/women-shirts/c/830316016

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.

After you JSENDCODE text, how do I keep the proper format of an apostrophe?

I'm attempting to pre-populate data into a visualforce page utilizing a custom button. In my use case, this is DocuSign custom button logic.
I will be providing Salesforce merge fields as well as text strings.
I've successfully coded URLENCODE in addition with JSENCODE so i do not receive any syntax errors from merged data. However, in my fields and text strings with apostrophe's, it adds a backslash in front \'.
Below is an example of one of my variables:
CES="{!URLENCODE(JSENCODE(Account.Name))} {!URLENCODE(JSENCODE(Opportunity.Name))} - eSignature";
My Account Name in Salesforce = "Dunder Mifflin's".
In the visualforce page it is displayed as "Dunder Mifflin\'s"
Is there any way to ENCODE the apostrophe, but still keep the format the same without the backslash?
Thanks in advance.
Why do you use 2 encoding functions? Sounds like one would be enough. If there are two - well yeah, your output will be double-escaped.
Also if that link is being built on Visualforce page then you can build it in more elegant way and let Visualforce engine figure out the escaping for you:
<apex:page standardController="Account">
<apex:outputLink value="http://google.com/search">
Search Google Images
<apex:param name="q" value="{!account.name}"/>
<apex:param name="tbm" value="isch"/>
</apex:outputLink>
</apex:page>
gives me
http://google.com/search?q=Dunder%20Miffin%27s&tbm=isch

App Engine - why are there PhoneNumber, Link, Rating etc classes?

I haven't found any reason for the existence of a few of the App Engine classes. There's a PhoneNumber, a Link, a PostalAddress, a GeoPt, a Rating, etc. Why are these given special treatment? They don't seem to have any smarts - e.g. geo searching. I know Link has more space than a String property, but the rest?
See:
http://code.google.com/appengine/docs/java/datastore/dataclasses.html
Those types are 'semantic' types. They're present in the Java API for parity with the Python API. In the Python API, they define special behaviour with regards to the .to_xml() method - for example, a PhoneNumberProperty serializes like this:
<property name="foo" type="gd:phonenumber"><gd:phoneNumber>12345-678</gd:phoneNumber></property>
I think they're mostly just there to cover common cases and save developers time. If a lot of apps use a phone number field, why require each developer to have to write them? A developer can still write their own if they need/want to.
Not sure about java, but in python the following model/code (tested on dev server) will throw BadValueError, with the message "Invalid URL: stackoverflow.com"
class foo(db.model):
link = db.LinkProperty()
bar = foo()
bar.link = 'stackoverflow.com'
While:
bar.link = 'http://stackoverflow.com'
Works fine.
I haven't tested, but the other properties may or may not also do validation.
Basically using this types in your models allows to add indirect meta data to your code. This may be useful if you are working with any kind of universal renderer for your model classes or if you are performing validation of user input on your models.
For example if you are using PhoneNumber type for a field named userNumber you reflection based renderer may understand that it should automatically assign corresponding validator to text field which will represent it.
Regards,
Pavel.

Resources