-
1. rich:select - Default value selected when loaded?
boy18nj Mar 7, 2011 10:38 AM (in response to jmiazga)time to use Javascript API-
The
<rich:select>
component can be controlled through the JavaScript API.On page load, call this method through JavaScript API,
-
2. rich:select - Default value selected when loaded?
jmiazga Mar 8, 2011 12:51 PM (in response to boy18nj)is this done through the rich:componentControl tag? I can't seem to find an example anywhere.
-
3. rich:select - Default value selected when loaded?
boy18nj Mar 8, 2011 2:35 PM (in response to jmiazga)Add this code to your page, replace id with your rich:select id,
You can modify your code as per your requirements-
<script type="text/javascript">
function setNewValue(){
document.getElementById('form:id').component.setValue('newValue');
}
window.onload = setNewValue;
</script>
-
4. Re: rich:select - Default value selected when loaded?
jmiazga Mar 8, 2011 3:43 PM (in response to boy18nj)That doesn't help too much. I could have multiple elements on one page and I need to set each one based off a value from within a bean. The rich:select is located within an enhancedDataTable which is generated dynamically. Any reason the value attribute was omitted?
inplaceSelect has a value attribute but it unfortunately doesnt allow you to type anything into it.
-
5. rich:select - Default value selected when loaded?
boy18nj Mar 8, 2011 4:19 PM (in response to jmiazga)nest a4j:support inside rich:select and use onload event, and call the javascript function to set the new value from enhancedDataTable bean.