New user problem with forms

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

New user problem with forms

Philip W. Dalrymple
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.