How to xdt:locator match() a node's text? - web-config

I want to use the InsertIfMissing function with a locator of the node's text().
I tried the following:
<SessionItem xdt:Transform="InsertIfMissing" xdt:Locator="Match(text())">new_item</SessionItem>
But it looks like the xdt doesn't recognize the text() function.
How can I make it work?

Possible with xdt:Locator="Condition(boolean(XPATH EXPERSSION)".
For example,
<SessionItem xdt:Transform="InsertIfMissing" xdt:Locator="Condition(boolean(//SessionItem[text()="new_item"]))">new_item</SessionItem>

Related

Is there a way to specify first-day-of-week for Vuetify Date picker globally?

Is there a way to specify first-day-of-week for Vuetify Date picker globally?
I don't want to specify the props on each separately.
No, there isn't a way to do that
You have to use the widget as per documentation (https://vuetifyjs.com/en/components/date-pickers) with the first-day-of-week property.
<v-date-picker
v-model="picker"
:first-day-of-week="1"
></v-date-picker>
if you look into code, you'll notice that the param default is 0, so there's no magical global setting for this.
https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/components/VDatePicker/VDatePicker.ts#L64
As for few other components' defaults, you can simply wrap it in new component (let's call it MyDatePicker) and use that one across the application instead.
To harness all event handlers intended for Vuetify component VDatePicker upon your custom MyDatePicker, you'll need to add v-on="$listeners".

How to display a simple wicket message with one simple parameter with StringResourceModel

I have one Wicket text property in the WicketApplicationProperties.properies
<entry key="dataMniejszaNizMinimalna">Wybrano datę, która jest mniejsza niż minimalna akceptowalna data '${minimalnaData}'. Nie można zapisać danych."</entry>
How to substitute a parameter {minimalnaData} with a use of a class
StringResourceModel. I don't want to create any models i want to just display a message with provided one attribute. The Wicket StringResourceModel is so complicated.
new StringResourceModel(resourceKey).setParameters(params)
how to provide this one parameter is a simplest way.
The simplest way could be:
new StringResourceModel(resourceKey, this, Model.ofMap(Map.of("minimalnaData", "some value")))
The model object could be a Java Bean or a java.util.Map.
StringResourceModel also supports java.text.MessageFormat. You can use its #setParameters() method to pass an array of values for the placeholders.
I think wicket:message should fit your need. Take a look at the wiki:
https://cwiki.apache.org/confluence/display/WICKET/Wicket%27s+XHTML+tags
You can nest components within textual content.

How to prevent writing before prefix in GWT valuebox

I am using GWT ValeBox with GWT Renderer to show amount with $ as prefix.
Now I want not to allow user to type any thing before dollar sign. I tried various GWT event handlers like ValueChangeHandler and some others but unable to achieve goal.
Still struggling for it. If anybody know good solution for it, please share here.
Regards,
The easiest would be to not include the currency as part of the value, but next to the field.
Alternatively, you could replace the value with a numeric-only value on focus, and reformat it as a currency on blur.
Couple of solutions:
Use a label before the valuebox. Label value will be $ and valuebox will contain the numeric value.
You can use empty text in the valuebox. Empty text will specify user to enter $ value.

binding locator in Protractor

I have a problem with ng-binding locator in Protractor code:
<h1 class="blackText ng-binding">some_link</h1>
I tried to use:
element(by.binding('some_link')).click();
but it's not finding anything.
This works:
element(by.cssContainingText('.ng-binding', 'some_link')).click();
but I would like to use binding locator.
Any ideas ?
See this for an example: https://docs.angularjs.org/api/ng/directive/ngBind
Note that in the example you're doing element(by.binding('name')), and not element(by.binding('Whirled')). Basically don't use what the binding evaluates to, but the binding's name.

How to run multiple calculations using `oninput` (HTML5)?

I need a way of running a few calculations based on the contents of a single text box. I'm currently using a form, with the text box what accepts numeric values. I then use the oninput to calculate the other values eg.
<form oninput="x.value=7+y.value">
However I need a way of running multiple calculations using oninput. Is this possible? If so how? If not, what are my other options?
I solved this issue. You can do something like so:
<form oninput="x.value=7+y.value;z.value=y.value+300">