DateTimePicker - Time only on Unplugged - teamstudio-unplugged

we are developing an app were our technicians can add activities to an ticket.
Therefore they need to choose a date and also the work start time. These should be handeled with to different fields/selections.
For the Date selection we get it running, for the time selection we only get it work via web browser. In Unplugged only a text editbox will be displayed.
Maybe anyone has a running time selector?
Here ́s the code which is not working on unplugged:
<xp:inputText value="#{Activity.work_start}" id="work_start1"
style="margin-top:10.0px">
<xp:this.converter>
<xp:convertDateTime type="time" pattern="HH:mm">
</xp:convertDateTime>
</xp:this.converter>
<xp:this.defaultValue><![CDATA[#{javascript:sessionScope.work_start1
}]]></xp:this.defaultValue>
<xp:dateTimeHelper></xp:dateTimeHelper>
</xp:inputText>
Here ́s the code for the date picker which is working correct:
<xp:inputText value="#{Activity.date}" id="dateTimeHelper"
styleClass="xspInputFieldEditBox" type="date">
<xp:this.converter>
<xp:convertDateTime>
<xp:this.pattern><![CDATA[${javascript:if (Activity.isEditable()){
return "yyyy-MM-dd";
}else{
return "dd MM yyyy";
}}]]></xp:this.pattern>
</xp:convertDateTime>
</xp:this.converter>
<xp:this.defaultValue><![CDATA[#{javascript:if(sessionScope.dateTimeHelper == ""){
return #Today();}else{
return sessionScope.dateTimeHelper}}]]></xp:this.defaultValue>
</xp:inputText>

Apologies for the separate answer - I don't have the reputation to comment yet...
As Rich says, the key to getting a native time-picker to display on the device is setting type="time" on the xp:inputText tag. However, Domino uses the type attribute on the xp:convertDateTime tag to determine whether to render a date picker or a time picker. So the way to get a native picker in Unplugged and a time picker in regular XPages is to add type="time" to both the xp:inputText and the xp:convertDateTime elements. Also, to work properly on iOS, the pattern in the converter must use a 24hr clock, i.e. HH:mm rather than hh:mm.
<xp:inputText value="#{document1.Time}" type="time" style="height:29px">
<xp:this.attrs>
<xp:attr name="id" value="mobiin"></xp:attr>
<xp:attr name="data-mini" value="true"></xp:attr>
</xp:this.attrs>
<xp:dateTimeHelper id="dateTimeHelper2"></xp:dateTimeHelper>
<xp:this.converter>
<xp:convertDateTime type="time" pattern="HH:mm"></xp:convertDateTime>
</xp:this.converter>
</xp:inputText>

This works for me, taking the time from the Time field of the doc - adding a default value for new docs should work:
<xp:inputText value="#{document1.Time}" type="time" style="height:29px">
<xp:this.attrs>
<xp:attr name="id" value="mobiin"></xp:attr>
<xp:attr name="data-mini" value="true"></xp:attr>
</xp:this.attrs>
<xp:dateTimeHelper id="dateTimeHelper2"></xp:dateTimeHelper>
<xp:this.converter>
<xp:convertDateTime pattern="HH:mm"></xp:convertDateTime>
</xp:this.converter>
</xp:inputText>

Related

Why doesn't Element UI datepicker component update its value until I cick again?

I am using an el-datepicker component to filter a list of items on an el-table according to their dates. When I select a new date range, the filter works correctly but the datepicker element does not update to the new dates I selected until I click it again. Has anyone faced this problem before?
<el-date-picker
size="mini"
:value="filters.start_date"
#input="updateFilters({ value: $item, prop: 'start_date' })"
value-format="yyyy-MM-dd"
format="MMMM dd, yyyy"
type="daterange"
align="right"
/>
Then in the methods of my component:
updateFilters(data) {
this.$store.commit('panel/changeFilters', data)
...
}
So the datepicker gets its value from filters.start_date. The thing is, if I do console.log(this.filters.start_date), it shows the correct date range (the one I just selected). However the datepicker does not show that date range until I click again.
The problem is that you are binding the value i.e. using :value instead of v-model. So if you binding the value you have to assign the value to the data by yourself such that it causes reactiveness and hence updates the DOM.
If I with your approach of going with the binding value I would like to change my code something like this:
<el-date-picker
size="mini"
:value="filters.date_range"
#input="updateFilters"
value-format="yyyy-MM-dd"
format="MMMM dd, yyyy"
type="daterange"
align="right"
/>
Notice I have changed the filters.start_date to filters_date_range, as the value for type=daterange takes an array with two items. something like
[startDate, endDate]
Another thing that you should notice is I removed the parameters from updateFilters, because I want to receive the latest daterange whenever it gets selected.
Now in my handler function I just need to do:
updateFilters(data) {
this.$store.commit('panel/changeFilters', data)
this.filters.date_range = data
//data : [startDate, endDate]
}
And, it will update the DOM as soon as u change the picker value.
Another easier approach would be to use v-model instead of :value.
<el-date-picker
size="mini"
v-model="filters.date_range"
#input="updateFilters"
value-format="yyyy-MM-dd"
format="MMMM dd, yyyy"
type="daterange"
align="right"
/>
And it will update the DOM automatically, you don't have to set the value explicitly in the input handler, and can do any other stuff in the handler if you want to.

How display my errors default for Stripe?

I use this vue-stripe-checkout (Vue.js), all works fine but if i write a fake number of card a automatic message is display and say "you'r number is incorrect".
Is what i want but i don't know how to add style on that, because is as 0 style and is very ugly.
The style object don't work on that, i found in documentation a Slots for "card-errors" but i don't know what means.
If someone can help me ?
<stripe-elements
:styleObject="style"
ref="elementsRef"
:pk="publishableKey"
locale="fr"
#token="tokenCreated"
#loading="loading = $event"
>
</stripe-elements>
<button class="btn btn-success px-5" #click="submit">Payer</button>

Readonly attribute doesn't work on 'o_website_form_date' class in website. - Odoo10

I created a date picker using the following code and set to readonly. The field in the website looks like readonly but when i click on the filed the date picker shows up. i need to disable it too. how can i achieve this?
< input type="text" class="form-control o_website_form_input o_website_form_date" name="name" readonly=""/>
Here is the screenshot:
EDIT: When i remove the class "o_website_form_input" it works fine.
You have to give 1 to the field readonly.
< input type="text" class="form-control o_website_form_input o_website_form_date" name="name" readonly="1"/>

XPages Dojo HorizontalSlider onchange

I've been looking for a couple of days now on how to implement a Dojo HorizontalSlider control on my xpage. I've found about 4 different examples of code. I have also tried over and over to simply drag the control from the the Dojo Form list of controls and adjust the properties. I can't get it to work no matter how simple I try to make it.
I want to slide between 0 and 10 and capture the integer into a Edit box control.
Does anyone have an example of this and the code for it?
This is an example for a slider for values between 0 and 10 which writes the current integer value to an edit box on change:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view
xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xe="http://www.ibm.com/xsp/coreex">
<xe:djHorizontalSlider
id="djHorizontalSlider1"
value="#{viewScope.sliderNumber}"
style="margin: 5px;width:200px; height: 20px;"
minimum="0"
maximum="10">
<xp:this.converter>
<xp:convertNumber
integerOnly="true"></xp:convertNumber>
</xp:this.converter>
<xe:djSliderRule
id="djSliderRule2"
style="height:5px;"
count="11"
container="bottomDecoration">
</xe:djSliderRule>
<xe:djSliderRuleLabels
id="djSliderRuleLabels2"
container="bottomDecoration"
style="height:10px;font-size:75%;color:gray;">
<li>0</li>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
</xe:djSliderRuleLabels>
<xp:eventHandler
event="onChange"
submit="true"
refreshMode="partial"
refreshId="inputText1">
<xe:this.action><![CDATA[#{javascript:
viewScope.inputNumber = viewScope.sliderNumber
}]]></xe:this.action>
</xp:eventHandler>
</xe:djHorizontalSlider>
<xp:inputText
id="inputText1"
value="#{viewScope.inputNumber}">
<xp:this.converter>
<xp:convertNumber
integerOnly="true"></xp:convertNumber>
</xp:this.converter>
</xp:inputText>
</xp:view>
On event onChange a partial refresh is executed for edit field "inputText1". Slider's current value gets converted to an integer value and is written to viewScope.sliderNumber. From there it is copied to viewScope.inputNumber which is bound to the edit field. After partial refresh the value is visible in edit field.

ModX Eform: Captcha not generating image

I am trying to get CAPTCHA working on the eForm plugin. I have added the input form field:
<label for="cfCaptcha">Captcha:<br />
<img src="[+verimageurl+]" alt="verification code"><br />
<input id="vericode" name="vericode" class="text" type="text">
and I have added
&vericode=`1`
to the eForm call.
and have added the Template Variable [+verimageurl+] to my template.
However, when I preview the form all I see in the image area is <img src="" alt="verification code">
Would anyone know what I am doing wrong?
Did you get this fixed?
Check that you ended the label code. Run it through w3c code checker too.
A few times I have left a element un-closed and it breaks the whole thing.