Can't you set the relevant property on the DocumentModel before rendering the page?

Sean

[email protected] wrote:
Hi, I've found a solution although it's not very pretty as involves javascript. 
Here's the code:

        <c:if test="#{widget.mode == 'create' or field_0 == null}">
                <h:selectOneMenu name="#{widget.id}_selectyear" id="#{widget.id}_selectyear" 
value="#{field_0}">
<f:selectItems value="#{calendarBean.selectItems}" /> </h:selectOneMenu>
                        
                <script>
                        var 
combo=document.getElementById(getRealId("#{widget.id}_selectyear"));
                        combo.options[0].value=#{calendarBean.selectedItem};
                        combo.options[0].text=#{calendarBean.selectedItem};

                        function getRealId(partialid){
                                var re= new RegExp(partialid,'g');
                                var elems = document.getElementsByTagName('*'), 
i=0, el;
                                while(el=elems[i++]){
                                        if(el.id.match(re)){
                                                return el.id;
                                        }
                                }
                        }
                </script>
        </c:if>
--
Posted by "aldago" at Nuxeo Discussions <http://nuxeo.org/discussions>
View the complete thread: 
<http://www.nuxeo.org/discussions/thread.jspa?threadID=3314#9993>
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm



--
Dr. Sean Radford, MBBS, MSc
http://www.tacola.com/
t: +44 (0)845 KEY HELP
t: +44 (0)845 539 4357
m: +44 (0)7802 24 24 86

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm

Reply via email to