[izpack-users] NotEmptyValidator and PortValidator issue for input field..

Ajay Kumar Gour ajay.g at s7solutions.com
Fri Jan 4 08:04:15 CET 2008

Hello All,

Iam trying to use NotEmptyValidator for the validation in UserInputPanel  
for a field. But when i run the installation it doesn't prompt the error  
message (i tried both the events for inout field i.e. focus lost and Next  
button press on input panel) if i leave the field empty. Actually, i want  
to use PortValidator to check if port is free or not, so i used <validator  
class="com.izforge.izpack.util.NotEmptyValidator" txt="Port is not  
available" /> initially. But it didn't work so i thought of using  
NotEmptyValidator first to make sure iam giving all the required  
attributes. But even NotEmptyValidator is not working. Can anybody help me  
in sorting both the above mentioned issues?

Here is my UserInputSpec.xml file -

<panel order="0">
	<!--field type="staticText" align="left" txt="My comment is here."  
	<field type="text" variable="PORT">
		<spec txt="Proxy Port:" id="PORT" size="5" set="" layout="N:5:5"/>
		<validator class="com.izforge.izpack.util.NotEmptyValidator"  

My configuration file -

<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
	<category name="general">
		<property name="PORT" value=""/>

And finally, install.xml

<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>

<installation version="1.0">
          <appname>Connector Server</appname>
              <author name="Jason Rolles"
email="ajay.g at s7solutions.com"/>

		<variable name="PORT" value="9999"/>

      <guiprefs width="640" height="480" resizable="no"/>

          <langpack iso3="eng"/>

          <res id="LicencePanel.licence" src="Licence.txt"/>
          <res id="InfoPanel.info" src="Readme.txt"/>
          <res id="userInputSpec.xml" src="userInputSpec.xml"/>

          <panel classname="HelloPanel"/>
          <panel classname="InfoPanel"/>
          <panel classname="LicencePanel"/>
          <panel classname="TargetPanel"/>
          <panel classname="UserInputPanel"/>
          <panel classname="PacksPanel"/>
          <panel classname="InstallPanel"/>
          <panel classname="FinishPanel"/>

          <pack name="Base" required="yes">
              <description>The base files</description>
              <file src="Readme.txt" targetdir="$INSTALL_PATH"/>
              <file src="Licence.txt" targetdir="$INSTALL_PATH"/>
              <file src="script.bat" targetdir="$INSTALL_PATH"/>
              <file src="myconfiguration.xml" targetdir="$INSTALL_PATH"/>
              <parsable targetfile="$INSTALL_PATH/myconfiguration.xml"
type="xml"/> <!-- The file will be parsed -->
              <parsable targetfile="$INSTALL_PATH/script.bat"/> <!-- The
file will be parsed -->
          <pack name="Docs" required="no">
              <description>The documentation</description>
              <file src="doc" targetdir="$INSTALL_PATH"/> <!-- Reccursive
adding -->
          <pack name="Sources" required="no">
              <description>The sources</description>
              <file src="src" targetdir="$INSTALL_PATH"/>


More information about the izpack-users mailing list