English 中文(简体)
如何将投入限制在数量可变的水平上,只有法斯·马什克总理才投入。
原标题:How to restrict an input to a variable amount of numbers only with PrimeFaces inputMask element

我需要界定类似于这一规定的内容:

[0-9]{1, 5}

On a PrimeFaces <inputMask> 内容:

<p:inputMask mask="regexGoesHere" value="#{someBean.val}"/>

我审视了总理府的情况,但我无法说明如何做到这一点。

因此,任何人都知道如何除 Java文外以任何方式这样做?

I m不确切地寻找与<inputMask>任何将我从客户方意见中的打字函中限制的内容均为科索沃。

增 编

最佳回答

如果你想要或需要限制时间,你可以做这样的事情:

<p:inputMask 
   mask="9?9999"
   maxlength="5"
   slotChar=" "
   value="#{someBean.val}" />

用户只能进入1至5位数,或4位数以下,等等

<p:inputMask 
   mask="9?999"
   maxlength="4"
   slotChar=" "
   value="#{someBean.val}" />

问题回答

The following Masked Input Plugin is the original jquery plugin that is being used by Primefaces , you can find much more information about its usage, also there are several p:input-mask code example in this PDF PrimeFaces: More Input Elements look at page 24

KeyFilter from PrimeFaces Extensions looks exactly as something you need: http://fractalsoft.net/primeext-showcase-mojarra/views/keyFilter.jsf

根据文献和实例,它受reg制驱使,其职能完全应当:阻止生产不转至reg的物品的能力。

仅审判:

<p:inputMask maxlength="5">
        <pe:keyFilter regEx="/[d]/" />
</p:inputMask>

maxlength : limit the number of caracters to 5 max regEx : only authorize decimal caracter on key press

nb:

您可以使用有效者。 或者确定最低和最高标准。





相关问题
JSF a4j:support with h:selectManyCheckbox

I m having trouble with a JSF selectManyCheckbox and A4J support. The purpose is to run some action when a checkbox is selected. This works perfectly in Firefox. Yet, when testing in any IE (ie6 / ie7 ...

Mojarra for JSF Encoding

Can anyone teach me how to use mojarra to encode my JSF files. I downloaded mojarra and expected some kind of jar but what i had downloaded was a folder of files i don t know what to do with

如何拦截要求终止?

在共同基金中,如果用户要求终止,就需要采取一些行动。 我需要某种拦截器,但我不知道如何这样做。 我需要帮助。 增 编

ICEFaces inputFile getting the file content without upload

Is there any way of just getting the content of the browsed file without any upload/file transfer operations? I currently use ICEFaces inputFile component but I do not need the default uploading ...

Weird behaviour of h:commandLink action (MethodExpression)

I have two JSPs where I am displaying some info from database in a h:dataTable. One of them is showing all the info, and one of them user specifically. I have showXML.jsp that shows the "XML" column ...

How to correctly use ResultSet with h:dataTable

The problem is, that after displaying the ResultSet with <h:dataTable>, the connection is left open. If I close it, it closes the ResultSet too. I m thinking about copying the ResultSet data ...

热门标签