Select Field display in weird ways - extjs

Here is a TAG
The white block is the select field
Here is the select field selected
Here is the code
Why is it expanding out of it's limit ? there is nothing fancy there?

I think the problem is with your layout type.Which layout you are working with?Try it after removing layout config and add
xtype:'textfield',
anchor:50%,
itemId:'field'

If you are to use
selectfield.setHtml() and set it to a String.
It will destroy display and display the String ahs the value.
It's better to use setText() to do so.

Related

xpath for specific code in WebDriverSampler

I have a page with a set of fields I need to edit via WebSamplerDriver.
The difficulty is that field id values are not constant and change from time to time.
So, if I use an xpath like //input[#id='TextField13'],
it works only very limited time while id is actual.
Code snippet is below:
I suppose I need to describe xpath for an element with id='TextField13' (which is not a constant) with relevance to the text "First name" (always the same text) in another branch of parent tag (i.e. label).
What is the right way to do that?
Will be appreciated for tips.
Try this XPath to select input field based on label value
//label[.="First name"]/following::input
The answer is:
//label[contains(text(),'First name')]//following:://input

Embed with out the value field

How can you have an embeded text field with out all I want it to say is "Total Damage" and then display the image...
I have tried just about every combination of leaving it blank value="" or value=None or leaving off the value but then you get an error saying it is required.
diceEmbed.add_field(name='Total Damage', value=None)
image of the embed
You can't actually set a value to None so you have to use a unicode as such:
embed.add_field(name="name", value='\u200')
This probably is not the best way of doing this, but it does work for me.
diceEmbed.add_field(name='Total Damage', value=** **)
You can use the unicode character for zero width space
embed.add_field(name='Total Damage', value='\u200b')
# You can also use it in the name

How do get id & text from a dojo/dijit combobox?

How do you get the id for the underlying record in a combobox with dojo? I've tried altering the following sample but all I can get is the text shown to the user (the "name" property of each array element), and NOT the state's two-letter abbreviation ("id" property).
http://dojotoolkit.org/reference-guide/1.10/dijit/form/ComboBox.html#id3
thanks. PS, I'm a total noob with dojo. This is my first experiment with it.
It's like #CodeCrisis said, you can get the item by using dijit.byId('stateSelect').item. Though I'm not really pleased with how outdated the docs are (the dijit.byId()command is deprecated), this is a proper 1.10 solution:
query("button").on('click', function() {
console.log(comboBox.get('item'));
});
This will return the selected record in the store (containing both the id and name properties in this case).
A full, working example can be found here: http://jsfiddle.net/zt6xggL8/
How about this...
base on the link given
http://dojotoolkit.org/reference-guide/1.10/dijit/form/ComboBox.html#id3
change this onclick function
onClick="alert(dijit.byId('stateSelect').get('value'))"
into
onClick="alert(dijit.byId('stateSelect').item.id)"
i know this is not the best answer but i hope this will help you..
check out the answer of Philippe
Dojo : ComboBox selected and show data id
hehehe... :)
just passing by...
Not the prettiest but this works. Basically need to query the 'store' variable for the name that is being displayed when you just use 'value'. [0] denotes the first object in the store list, so if you have multiples with the same name, you'll need to use the foreach() function.
<button onClick="var namevar=dijit.byId('stateSelect').get('value');
alert(dijit.byId('stateSelect').get('store').query({name:namevar})[0].id);">
Get value
</button>

ExtJS 5: How do I include text after a numberfield?

Just about every field has a fieldLabel and a boxLabel config to set text either before or after the field. However, number field just happens to be one of them that does not. Is there anyway I can set text after a number field?
Example:
[ 1 ^] text goes here
Looks like this did the trick
afterSubTpl: 'this is after'
However it appears below the numberfield instead of directly to the right.
And this
beforeSubTpl: 'this is before'
puts the text above it, instead of to the left.
Working seeing if this can be fixed with styling.

WPF,is there a smart way of replaceing element of Grid?

Grid had been added element by Row and Column,i want to add new element to grid by follow way:
grid.children[i] =element as UieElement;
It is invaild to me.have a error.
I am avoiding refresh in thread,so i have not clear Grid.Children.
try this :
grid.Children.RemoveAt(i);
grid.Children.Insert(i, element as UieElement);
(also, but I think it as a typo : Children should be capital C in grid.Children ...)
To add elements, this is how you would have to do it:
grid.Children.Add(element);
If you want to set the row/column, you can set the properties programmatically before adding it, like so:
element.SetValue(Grid.RowProperty, 1);
You can access an existing portion by index like in your example if you just need to access a specific child.

Resources