3

I need to add StyleClass to a form tag generated in xPages.

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">
4

3 回答 3

7

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>

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>
于 2012-11-03T20:19:20.530 回答
5

You can add your own xp:form on the XPage:

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" createForm="false">
    <xp:form styleClass="newclass otherclass">
         ... add your components here ...
    </xp:form>
</xp:view>
于 2012-11-03T20:21:41.040 回答
0

If you disable form creation in Xpage >All Properties > createForm > False, you can create your own form with your own styleClasses; and that will replace the default form.

enter image description here

于 2016-03-01T01:38:53.480 回答