tags:

views:

227

answers:

1

I am customizing the calendar in the Work Effort application where I have to limit the number of fields displayed while adding a new event (event type - EVENT). I modified the EditWorkEffort form in the WorkEffortForms.xml to ignore the fields which I don't want to display. I am using the use-when attribute to check if the context keys workeffort,workEffortId is null and workEffortTypeId is EVENT. If the above conditions return true then I am ignoring the field using the ignored tag. Otherwise, the fields are displayed as they were before i.e. when the new workeffort is getting created for a new task (event type - TASK) or when a new work effort (event type - AVAILABLE) is getting created.

Now the above logic is giving me the desired result in case of a new event (event type - Event). But when I am adding a new task (event type - Task) or a new work effort (event type - Available) then all fields of the WorkEffort entity are getting displayed (which is correct) but the layout gets distorted (which is my problem). When I checked the final generated html source, I see that a colspan=4 is added to the html td for the corresponding fields wherever I have used use-when tag.

I hope I have explained my problem statement. I need to correct the layout problem. And also am I doing the right thing for my customization or there is any better way to do that?

A: 

If you want fields to not display better use the <ignore> tag, then they will never be displayed. If you still want to use 'usewhen' then watch the 'position' parameters which can easily get confusing.

If you also have a look at the 'sort' option you can display the fields in a particular order.