如何在JavaScript标签中编写JSF循环?

时间:2016-10-06 11:06:11

标签: javascript jsf

我正在为JSF编写循环到javascript。 此代码块 标题:'#{userBean.userList [0] .name}' 正在运行,但我想在循环中使用。例如 title:'#{userBean.userList [i] .name}'

 <script>


        $(document).ready(function () {

            var events = [];
            for(var i =0; i &lt; #{userBean.userList.size()}; i++) 
            {
                events.push( {
                    title: '#{userBean.userList[i].name}', 
                    start: new Date('#{userBean.userList[i].createDate}'), 
                    end: new Date('#{userBean.userList[i].date}')
                });
            }

            $('#calendar').fullCalendar({
                defaultDate: new Date(),
                editable: true,
                eventLimit: true, // allow "more" link when too many events
                events: events,
                eventColor: '#3A87AD',
            });

        });

    </script>

0 个答案:

没有答案