Getting the q-item-label text - node.js

I have this code using Quasar/VueJS. What I want to do is update the dropdown text label (keyDropDownLabel) based on the selected <q-item-label>.
So in this example below, I want the newLabelGoesHere part to be Key 1/2/3, depending on which was clicked.
<q-btn-dropdown stretch flat :label="keyDropDownLabel">
<q-list>
<q-item v-for="n in 3" :key="`x.${n}`" clickable v-close-popup tabindex="0">
<q-item-section #click="keyDropDownLabel = 'newLabelGoesHere'">
<q-item-label>Key {{ n }}</q-item-label>
<q-item-label caption>1234567890</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
Anyone help please??

Just modify the q-item-section click method like below:
<q-item-section #click="keyDropDownLabel('Key'+n)">

Related

How to click on the second instance of drop down box with similar html code - Selenium VBA Excel

I am trying to download two xls files from two dropdown boxes which are located in two similar data boxes.
The first data box:
<div id="contain" style="height: 400px" data-highcharts-chart="2">
…several containers…
<g class="highcharts-exporting-group" data-z-index="3</g>
The full path:
/html/body/div[2]/div/div[3]/div[1]/div/div[2]/div[1]/div/div[2]/div/div/svg/g[6]
The second data box:
<div id="containB2C" style="height: 400px" data-highcharts-chart="3">
…several containers…
<g class="highcharts-exporting-group" data-z-index="3</g>
The full path:
/html/body/div[2]/div/div[3]/div[1]/div/div[2]/div[2]/div/div[2]/div/div/svg/g[6]
I can click the first dropdown box with the code:
obj.FindElementByClass("highcharts-exporting-group").Click
and select the item:
obj.FindElementByXPath("//*[text()='Download XLS']").Click
But I cannot click the second drop down box in the second data box with similar code. Would appreciate any tips on how to do it.
As two dropdown boxes are similar, you could get a list or set of elements instead of a single element.
The below is just a demo and maybe has syntax error.(sorry I am not good at vba)
Dim titles As Object
Set titles = bot.findElementsByClass("highcharts-exporting-group")
For each item in titles
item.Click
Next item

Python Selenium: Select input with dynamic id in form

I want to make a Python program with Selenium to fill out a form. Part of the process involves filling out a title. I used xpath to find the input associated with title, but then found out that it only works sometimes because its id is dynamic and keeps changing. Here is the html code associated with the title input box:
<div class='g5ia77ul buofh1pr d2edcug0 l9j0dhe7'>
<span class="m9osqain t5a262vz a8c37x1j b5fwa0m2 jagab5yi knj5qynh fo6rh5oj d2edcug0 ni8dbmo4 stjgntxs hzruof5a pmk7jnqg re5koujm ltmttdrg fgv6swy9 dd2scrzq ms05siws flx89l3n b7h9ocf4 g0qnabr5">Title</span>
<input dir="auto" aria-invalid="false" id="jsc_c_6" class="oajrlxb2 rq0escxv f1sip0of hidtqoto lzcic4wl g5ia77u1 gcieejh5 bn081pho humdl8nn izx4hr6d oo9gr5id qc3s4z1d knj5qynh fo6rh5oj osnr6wyh hv4rvrfc dati1w0a p0x8y401 k4urcfbm iu8raji3" type="text" value="">
</div>
Other boxes in the form have similar id, they all seem to start with "jsc_c_" like "jsc_c_a" or "jsc_c_8". Here is a picture of what part of the form looks like:
[][1
This is some of the code I have tried to select the title box:
titlePath = '//*[#id="jsc_c_6"]'
titleText = 'myTitle'
titleBox = driver.find_element_by_xpath(titlePath)
titleBox.send_keys(titleText)
I think that perhaps I could select the title input box by checking for the presence of the text "Title" in the box. However, I am not sure how this can be done. Any help or suggestions would be greatly appreciated.
Probably you can give it a try with
//span[text()='Title']/following-sibling::input

How to get the Telerik RadGrid footer row value?

Using C#, how do I get values from a textbox which is in a RadGrid Footer?
I am getting an error in the following code. How do I solve it?
TextBox texte=(TextBox)RadGrid1.FooterRow.FindControl("textempno");
You should do it like this:
if (e.Item is GridFooterItem)
{
TextBox texte = (TextBox)RadGrid1.FooterRow.FindControl("textempno");
}
Also, you can do it like this:
GridFooterItem footerItem = (GridFooterItem)RadGrid1.MasterTableView.GetItems(GridItemType.Footer)[0];
TextBox texte=(TextBox)footerItem.FindControl("textboxid");//accessing Button inside FooterTemplate
I have give the index [0] while getting the grid footer item as the text box is the one and only item in my grid footer. If you have multiple footer items, you can give the index of the item you want to find.

ExtJs layout + Window

While adding component dynamically, 'this.container is null' is displayed in firebug.
I have a window with some combo boxes say combo1, combo2, combo3 and a label. Based on the selection value of combo3 the 'label' field is removed and replaced with combobox or text field. i do this my using
form.items.removeAt(4);
form.items.insert(4, newItem); #here newItem can be combox/textfield
form.doLayout();
The form resides inside a panel.
When above lines are execueted. 'this.container is null' is displayed and component fails to insert/add in appropiate position.
Any suggestions?
You should not be modifying the underlying items collection. Use the remove/insert methods on the container.
Try to comment those lines line-by-line to see which one produces error like
form.items.removeAt(4);
//form.items.insert(4, newItem); #here newItem can be combox/textfield
//form.doLayout();
form.items.removeAt(4);
form.items.insert(4, newItem); #here newItem can be combox/textfield
//form.doLayout();
form.items.removeAt(4);
form.items.insert(4, newItem); #here newItem can be combox/textfield
form.doLayout();
Your problem could take place because of inserted/replaced object is no yet prepared when you try to insert it. Give us your newItem initilization code.
Upd
Or you can wrap your changing components (label, combobox, textfields) in a panel with card layout. And on change of combo3 simply select exact card in that panel.

Set value for YUI Menu Button

I'm trying to set the assigned value to a YUI Menu Button in order to use values from previous operations.
Something like remembering previous choices.
For label I already know that I can change it with:
button.set("label", "my label")
unfortunatelly I cannot change the value using: button.set("value", "my value")
Any ideia on how can I do this?
Other way would be to force a selection, but I have no ideia on how to do that.
Thanks
just found out that you can use:
var menu = button.getMenu();
var item = menu.getItem(index);
button.set("selectedMenuItem", item);
all that is left for me now is finding the needed index

Resources