Primefaces Mobile 中的日历

发布于 2024-12-04 17:08:36 字数 288 浏览 3 评论 0原文

我正在考虑使用“日历”组件在 Primefaces Mobile 中选择日期: 日历弹出,但看起来很奇怪。它以透明的方式重叠页面内容。

这个问题有解决办法吗?或者有一种方法可以让它在对话框中正确弹出?也许将另一个框架与 Primefaces 结合起来?

顺便说一句,该对话框似乎在 Primefaces Mobile 中也不起作用。

谢谢

I am looking at picking a date in Primefaces Mobile with "calendar" component:
<p:calendar value="#{bean.date}" pattern="MM/dd/yyyy HH:mm" />
The calendar pops up but it looks very odd. It overlaps the page content in a transparent way.

Is there a work around for this issue? Or a way to get it pop up correctly inside a dialog? Maybe to combine another framework with Primefaces?

By the way, the dialog seems not to work too in Primefaces Mobile.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绿光 2024-12-11 17:08:36

Primefaces Mobile 确实很棒,仍在开发中,但它没有实现像“datebox”这样的 Jquery 移动扩展。我找到了一种将两者结合起来的方法。我在 JSF 页面的标头中包含了 jquery-datebox 库(请参阅链接

<f:view xmlns="http://www.w3.org/1999/xhtml"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:pm="http://primefaces.prime.com.tr/mobile"
        xmlns:p="http://primefaces.prime.com.tr/ui"
        contentType="text/html">

    <pm:page title="Faces">

        <f:facet name="postinit">            
            <h:outputStylesheet library="css" name="jquery.mobile-1.0b3.min.css" />
            <h:outputStylesheet library="css" name="jquery.mobile.datebox.min.css" />            
            <h:outputScript library="primefaces" name="mobile/mobile.js" />
            <h:outputScript library="js" name="jquery.mobile.datebox.min.js" />
        </f:facet>

        <!-- Main View -->
        <pm:view id="main" swatch="b">
             <pm:header title="Hello">
                <f:facet name="left">
                    <pm:button value="Back" icon="back" role="back"/>
                </f:facet>
            </pm:header>

            <pm:content>
                <h:form id="myform">
                    <h:outputText value="Input: " />
                    <h:inputText id="input" />                    
                </h:form>                
            </pm:content>

            <label for="mydate">Date: </label>                                                                           
            <input name="mydate" id="mydate" type="date" data-role="datebox" value="#{mybean.date}" 
                   data-options='{"mode": "calbox"}' />

            <div data-role="fieldcontain">
                    <label for="slider">Duration: </label>
                    <input type="range" name="slider" id="slider" 
                           value="#{mybean.duration}" min="1" max="10"  />
            </div>

            <pm:content>
                <h:form id="Form">
               <pm:field>
                    <h:outputLabel for="duration" value="duration: "/>
                    <pm:slider id="duration" min="1" max="10" value="#{mybean.duration}"/>
                </pm:field>
              </h:form>  
            </pm:content>

        </pm:view>
     </pm:page>

</f:view>

: datepicker 工作得很好,但是 pm-view 内部和外部的滑块(参见代码)都像正常输入一样显示!

有什么建议吗?谢谢

PS:@administrator:需要一个新标签:“Primefaces-mobile”

Primefaces Mobile is really great and is still under development but it doesn't implement Jquery mobile extensions like "datebox". I find a way to combine both. I included the jquery-datebox library in the header of a JSF page (see link):

<f:view xmlns="http://www.w3.org/1999/xhtml"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:pm="http://primefaces.prime.com.tr/mobile"
        xmlns:p="http://primefaces.prime.com.tr/ui"
        contentType="text/html">

    <pm:page title="Faces">

        <f:facet name="postinit">            
            <h:outputStylesheet library="css" name="jquery.mobile-1.0b3.min.css" />
            <h:outputStylesheet library="css" name="jquery.mobile.datebox.min.css" />            
            <h:outputScript library="primefaces" name="mobile/mobile.js" />
            <h:outputScript library="js" name="jquery.mobile.datebox.min.js" />
        </f:facet>

        <!-- Main View -->
        <pm:view id="main" swatch="b">
             <pm:header title="Hello">
                <f:facet name="left">
                    <pm:button value="Back" icon="back" role="back"/>
                </f:facet>
            </pm:header>

            <pm:content>
                <h:form id="myform">
                    <h:outputText value="Input: " />
                    <h:inputText id="input" />                    
                </h:form>                
            </pm:content>

            <label for="mydate">Date: </label>                                                                           
            <input name="mydate" id="mydate" type="date" data-role="datebox" value="#{mybean.date}" 
                   data-options='{"mode": "calbox"}' />

            <div data-role="fieldcontain">
                    <label for="slider">Duration: </label>
                    <input type="range" name="slider" id="slider" 
                           value="#{mybean.duration}" min="1" max="10"  />
            </div>

            <pm:content>
                <h:form id="Form">
               <pm:field>
                    <h:outputLabel for="duration" value="duration: "/>
                    <pm:slider id="duration" min="1" max="10" value="#{mybean.duration}"/>
                </pm:field>
              </h:form>  
            </pm:content>

        </pm:view>
     </pm:page>

</f:view>

The datepicker works well but both sliders inside and outside a pm-view (see the code) are displayed like normal inputs!

Any suggestions? Thanks

PS: @administrator: a new tag is needed: "Primefaces-mobile"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文