更改< p:fileUpload mode =" simple">的默认按钮标签 [英] Change default button label of <p:fileUpload mode="simple">
问题描述
我正在使用< p:fileUpload mode =simple>
。 Chrome和Firefox中的按钮标签显示不同。我希望它是不同的浏览器。我尝试通过设置标签
属性来改变它:
I am using <p:fileUpload mode="simple">
. The button label shows differently in Chrome and Firefox. I would like it to be the same across browsers. I tried changing it by setting the label
attribute as follows:
<p:fileUpload label="Browse" ... mode="simple" />
但是没有效果。我怎样才能做到这一点?
However, it had no effect. How can I achieve this?
推荐答案
在当前的PrimeFaces 3.x版本中, 是不可能的。只有当你使用 mode =advanced
而不是 mode =simple
。
That's not possible in current PrimeFaces 3.x version. It's only possible when you use mode="advanced"
instead of mode="simple"
.
至于尝试使用标签
属性,此属性仅用作与输入组件关联的验证错误消息中的标签。使用 label =Browse
尝试,如果 required =true
验证错误,显示为需要浏览而不是formId:inputId是必需的。
As to your attempt to use the label
attribute, this attribute is only used as label in validation error messages associated with the input component. With your label="Browse"
attempt, in case of a required="true"
validation error, the message would appear like so "Browse is required" instead of "formId:inputId is required".
更新: / strong>自PrimeFaces 5.x以来,您可以添加 skinSimple =true
来给 mode =simple
所需的皮肤/ look'n'feel作为其余部分。另外,标签
实际上将用作按钮标签。另请参阅展示。
Update: since PrimeFaces 5.x, you can add skinSimple="true"
to give mode="simple"
the desired skin/look'n'feel as the remainder. Also, the label
will actually be used as button label. See also the showcase.
<p:fileUpload label="Browse" ... mode="simple" skinSimple="true" />
这篇关于更改< p:fileUpload mode =" simple">的默认按钮标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!