我如何在 xpages 中添加样式类到表单标签 [英] how can i add styleclass to form tag in xpages
本文介绍了我如何在 xpages 中添加样式类到表单标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将 StyleClass
添加到 xPages
中生成的表单标签中.
I need to add StyleClass
to a form tag generated in xPages
.
我不知道是否可以在新主题中更改此控件,但我的应用中只需要一个 xPage
,这是生成的代码:
I don't know if can change this control in new theme but I only need for one xPage
in my app, this is the code generated:
<form id="view:_id1" method="post" action="/blabla.nsf/index.xsp"
class="xspForm" enctype="multipart/form-data">
我需要这个修改类,例如:
And I need this modify class e.g:
<form id="view:_id1" method="post" action="/blabla.nsf/index.xsp"
class="newclass otherclass" enctype="multipart/form-data">
推荐答案
您可以将以下内容添加到您的主题中以更改表单标签的类:
You can add the following to your theme to change the class of the form tag:
<control mode="override">
<name>Form</name>
<property>
<name>styleClass</name>
<value>newclass otherclass</value>
</property>
</control>
更新:使用以下内容仅在名为 index.xsp 的 XPage 上使用它:
Update: use the following to only use this on an XPage called index.xsp:
<control mode="override">
<name>Form</name>
<property>
<name>styleClass</name>
<value>#{javascript:(view.getPageName() == '/index.xsp')?'newClass otherClass':'xspForm'}</value>
</property>
</control>
这篇关于我如何在 xpages 中添加样式类到表单标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文