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
Related
As title says I am attempting to identify a new element that is added to a page after an add new button is clicked that shares an xpath the same as many other elements.
To give some background there is a list of items on the page. You can interact with the list in the following ways. Add New, Edit and Delete.
You can add a new row to the list. When you click add new you type in text to name the item in the list and then have the option to save or cancel.
The cancel element (new row) is the same as the delete element (existing row) in terms of xpath (except where it is on the list).
I can't use the specific list element because this is an automation script that would run everyday and the position on the list could change.
Any thought on what I could do to do identify the xpath of the new cancel button when add new is clicked.
The button itself does not contain words but is an image of a trashcan, so I can't use something like text to find a cancel button.
I saw some ways to add text to find by but the issue I'd run into is that a user could generate this new row at anytime.
Any thoughts would be helpful! :)
Thanks!
To identify the new cancel button, you can try and tweak (it's a wild guess) one the following XPath expressions :
If the trash is an image, we look for an element which child contains a #src attribute (the name of the image : trash.gif for example).
//*[./*[contains(#src,"trash.gif")]]
If the trash is an icon, we can search the same way as before (you need to identify the name of the icon) :
//*[./i[contains(#class,"trash")]]
In my Repeat Grid I have
1. First Dropdown
2. Second Dropdown
3. Input Area
When I select value from First Dropdown, data of Second Dropdown will be loaded. (I'm using On Value Change Action)
When I click on Plus (+) the value of Second Dropdown of First Row changes!
Similarly if I change any row First Dropdown, the values getting bounded for all the Second Dropdowns. Whatever I selected initially will be reloaded again!
Is this the bug in Orbeon or is there a way to load them differently?
This was the behavior prior to Orbeon Forms 2016.1. You can read more details in issue #1770. You can consider upgrading to Orbeon Forms 2016.1, or using the Dynamic Data Dropdown control as a workaround.
I want to use <p:focus> in two ways:
1. Move to the input field if that field fails validation, i.e. is required
2. If on a page that has an input field that is visible when the page loads then move to that field. But if the page has a lot of introduction text and the input field is way down the page then don't move to the field as the user has to then scroll up to read the start of the page.
How can I have both cases handled? It seems that if I have <p:focus> I cannot avoid the page scrolling automatically way down the page if the first input field is there but I also want to move to the required field if a value has not been given.
Thanks
First, don't use the attribut for to select the default focused element.
Second, you only have to update your p:focus, and it will automatically select the first field where error occured.
For 1: See the answer above or http://www.primefaces.org/showcase/ui/misc/focus.xhtml
For 2: The only solution I know of that can achieve this is to not use the <p:focus/> and implement your own focus code (not to difficult). Detect the position of the first input and if it is far down, don't 'focus' it.
This may be a followup to this question Possible to make jqGrid Search Box Stay on Page? - Or it may be unrelated because clicking the search button manually shows the same behavior.
We have a dynamically generated grid that is created by a) making an ajax request to get the grid columns based on a report id and then b) setting up the grid model and fetching the data. When the page loads initially, we pass in a starting report id, but there is a dropdown box on the page that lets the user change reports.
When the dropdown changes, I unload any existing grid, make the ajax request to get the columns, set up the grid model, and then get the data. The columns change, the data changes, and everything looks correct - except the search columns do not change in the search dropdown.
If I close the search box and reopen it, it still has the old search columns. Likewise, if I click the reset button or reload the entire grid.
I found it after a bit more poking around. I needed to set the recreateFilter option to true
prmSearch = {recreateFilter:true,multipleSearch:true,overlay:false,sopt:['cn','eq','ne','lt','le','gt','ge','in','ni','nc']};
I'm working on an InfoPath 2007 form. I have two drop-down lists and i need the second to be populated with items bases on the value chosen in the first list. I use c# to populate the drop-dpwn lists from external sources. I've tried to use the OnChange event to make all this, but the second list is still empty.
If anyone knows, please tell me.
You can filter the entries for the second drop-down list based on your first list (but only if the entries are based on a data source, not manually entered).
Bring up the properties window for
your second drop-down list.
Select your data source.
Click on the button to the right of the Entries text box.
Select the repeating node you wish to use for the basis of your list entry.
Click the Filter Data button. From here you can enter a filter to limit the entries displayed based on the value of your first drop-down list.
Your question was a bit ambiguous. You may be trying to populate a secondary data source based off of your first drop-down list. This should work fine with an OnChange event. Can you post the code you are using to do this?
Some additional tips that may help:
The change event will not fire until focus moves off of the list box. So, for the second drop down to populate, you will need to set the first drop-down then hit tab or click elsewhere in the form.
I don't know the size or nature of the data source you are using for the second drop-down list, but you may consider downloading the entire data source and filter it using the method I described above. This may be a better solution as you won't need to make a database query between entering the first list box and the second one.