You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by "Philip W. Dalrymple III" <pw...@mdtsoft.com> on 2007/02/25 20:47:44 UTC

New user problem with forms

I am just starting out with ofbiz and have had good luck till this 
morning. I am trying to create a form
that has some fields that can only be edited if the status (another 
field) is in a "new" state. I was able
to get the business logic in the service (update) to work without 
problems so that now if a user where
to change the field (server name) and the state is anything other than 
LICST_NEW they will correctly
receive an error. I would like to cause the form to not allow editing on 
this field as well. I think that this
must be a common pattern but when I tried the below code (commented out 
in the example, replace with
working code) I get exceptions when I go to the update screen.


                <field 
                        name="serverName"
                        tooltip="Insert FQDN [Status = 
${license.statusId}]"
                        title="Server Name">
                </field>
<!--

                <field  use-when="&quot;LICST_NEW&quot;.equals(statusId)"
                        name="serverName"
                        tooltip="Insert FQDN [Status = 
${license.statusId}]"
                        title="Server Name">
                </field>


                <field  
use-when="&quot;LICST_ACTIVE&quot;.equals(statusId) || 
&quot;LICST_RETIRED&quot;.equals(statusId)"
                        name="serverName"
                        tooltip="Can't be changed Unless Status is New 
[${license.statusId}]"
                        title="Server Name">
                <display/>
                </field>

-->


I am running the weekly snapshot SVN version 505358 (from a few weeks 
ago), the rest of the system appears to be working
well. I found what I assume the same sort of pattern in the webtools app 
and copied the code from there (at least the use-when
part of the code.