I am trying to get the default selected value from a dropdown list. There are no Options or Values in the HTML code that I can see when I inspect the code.
This is what the screen looks like when the user enters it.
If you click the dropdown, you will see that the value 8 is highlighted because it is the default value
The HTML code does not show the value 8 anywhere nor any of the other values listed that can be selected. I need to verify that the default value is 8 but I'm having a hard time finding the correct code to do this.
This is the html:
I can use this Xpath to click on the dropdown button:
//[contains(#class,'label')][text()='Minimum Length']/ancestor::/following-sibling::1//[#role='combobox']//*[contains(#class,'filterselect-button')][#role='button']
This will also click on the combo box and allow the dropdown list to appear
//[text()='${Name}']/parent::/following-sibling::1//[contains(#type,'text')]
Related
In shopify, I want when image is selected, its corresponding selected variant value must appear in the select box. However, vice-versa is happening i.e. when value is selected from select box, it scrolls to that image.
Here is the link:
https://www.statementoutfit.com/collections/brillen/products/steampunk-trendy-zonnebril-design-modern-double-dubbel-hip-en-eye-catching-statement?variant=18146439069793
Anyone please help me to get the desired results.
I want to add an option to the row of the view: the possibility to open the document when clicking on the row. It is possible? How can I achieve this?
Add displayAs="link" to viewColumn. Then it is rendered as link and opens the document if you click on it. You can also choose to open it in edit or read mode.
Set the attributes in properties panel:
Update:
You can open the corresponding document clicking somewhere on a viewPanel's row (not just on a column's link) if you add a rowAttrs property.
Add the following code to your viewPanel:
<xp:viewPanel
rows="30"
id="viewPanel1"
var="row">
...
<xp:this.rowAttrs>
<xp:attr
value="window.open('#{javascript:row.getOpenPageURL(null, true)}', '_self')"
name="onclick"
rendered="#{javascript:!(row.isCategory() | row.isTotal()) }">
</xp:attr>
</xp:this.rowAttrs>
</xp:viewPanel>
Set viewPanel's row variable to var="row". The attribute attr gets rendered for all rows which are represent a document. It adds an individual onclick event to those rows and executes CSJS code defined in value. This CSJS code contains a SSJS part which inserts the URL of the document as window.open's parameter.
If you set getOpenPageURL's second parameter to false then document will be opened in edit mode.
Look here for a detailed description.
I think there is no easy way ;-) Maybe JQuery is your friend to add a on click event to the row with needed
I am using rich:select component in my xhtml page
My requirements are :
1) rich:select should be searchable.
2) But should show all elements in the list when clicking the down arrow, irrespective of the search string present.
For making component searchable, I set enableManualInput=true. But,when I search and select some value, and later click on the down arrow (the dropdown expand) it does not show all items in the Dropdown list, but shows only the item currently selected. What happens is, the value of the currently selected item is set as the search prefix.
I need to manually remove all characters on the search field and start searching again.
Is there a workaround for this? Where I want a dropdown of list and also should be able to search through the list. If this component does not support this functionality, is there another alternative component?
I use richfaces 4 and JSF 2.0
Thanks.
You can have the value deleted each time the list is shown (i.e. when you click the input field or the button):
<rich:select id="select" value="#{bean.selectValue}" enableManualInput="true"
onlistshow="#{rich:component('select')}.setValue('')">
It is a bug in RichFaces:
https://issues.jboss.org/browse/RF-11088
It is planned to be fixed in 4.5.0, meanwhile you can take a fix from the pull request:
https://github.com/richfaces4/components/commit/79657a54c90e99bfa1fb5f42eab8bf6f29fc9091
I would like to have a textfield input with a datalist of e.g. 10 fixed options.
Instead of the usual autocomplete behavior, I would like the dropdown to always show the complete list.
Especially, if the input has a pre-filled value, and the user clicks, I would like the dropdown to open and show the unfiltered list of options, so the user can use it like a select element.
Any idea how to do that?
I want to simulate the user clicking on a text field, using the dropdown and selecting an item.
I can get them on the field and the dropdown working with:
click //input[#id='select_students']
keyPress //input[#id='select_student'] \40
but I can't seem to get 'picking' an item in the dropdown.
I've tried using keyPress with Keys.ENTER as the value but I get forced to put in a Target (selenium IDE in firefox this is) and I don't know what to use as the target.
I could use something that press Enter regardless regardless of target if it's available.
Below logic might be useful for you.
click css=select[id="select_students"]
select css=select[id="select_students"] label=student10
click css=option[value="student10"]