• Home
  • Functionality
  • Functions
  • Pricing
  • News
  • Blogs
Download
Login
Skip Navigation LinksBlogs
Follow timecockpit on Twitter

How to create a custom form for an action parameter

By Alexander Huber in Category:
Wednesday, July 28, 2010

In our last blogpost (see here), we covered how to create actions with parameters. We described how to create an action, how to define exececution conditions and of course, how to create action parameters. As we mentioned in our last blogpost, time cockpit auto-generates a form for each parameter entity that is used with an action. However, it is also possible to define custom forms for action parameters. For creating a customely defined form, the following steps are necessary.

  • Creating a new form
  • Editing the markup
  • Assigning the form to a parameter entity

In the following, we describe the steps in more detail, but beforehand, we want to take a quick glimpse at our UpdateTimesheet action again. As you may remember, we have created an action with a parameter, but with no specific form for the parameter. As you can see in the below screenshot, the combobox for choosing a form for the UpdateTimesheetParameter entity is empty. This is because the UpdateTimesheetParameter has no corresponding form yet. We are going to change that now.

No form set

Creating a form

In order to create a new form, we need to switch to the "Server" context. By right-clicking on Forms, we can create a new form UpdateTimesheetParameterForm. Besides entering the name, we must assign the form to an entity. When we hit save, we are presented with a split-pane. The upper pane holds the markup of the new form, whereas the lower pane shows the graphical result of the markup. As you may have noticed, time cockpit generated default markup code representing the properties and relations of an entity, in our case UpdateTimesheetParameterForm.

Creating a form

Editing the markup

In the upper pane, we can now edit the markup as we desire. For demonstration purposes, we introduced an new Tab that is one represents the description and the other represents the user, just to show you what is possible. Further we changed a view headers to show other texts (see screenshots below). Of course, you could introduce other types of cells for other types of properties (see help). Now that we are done with editing our form, we can save the form. The lower pane now shows the graphical result of the markup. You can see that we now have a form that contains two tabs and it shows the updated texts.

Editing the markup

Assigning the form to a parameter entity

To be able to use the UpdateTimesheetParameterForm in our action, we need to reopen the UpdateTimesheet action for edit again. Please keep in mind that the reopening of the action is necessary for the changes to the model (the creation of the form) take effect. If we change to the parameter section in the edit pane of our action, we can now choose the UpdateTimesheetParameterForm from the combobox. Please mind that we can only choose from those forms, which have been created for the UpdateTimesheetParameter entity. After we have saved the action, we have replaced the auto-generated parameter dialog with our customly designed one.

Assigning the form to a parameter entity

When we run a query against our timesheets and call the Update Timesheet action, we can see, that time cockpit does not present us the auto-generated parameter dialog, but our customized UpdateTimesheetParameterForm.

Customized form

  • Facebook
  • Twitter
  • DZone It!
  • Digg It!
  • StumbleUpon
  • Technorati
  • Del.icio.us
  • NewsVine
  • Reddit
  • Blinklist
  • Add diigo bookmark

Comments  6

  • Elyza 14 Jan

    Yo, good looikn out! Gonna make it work now.
  • Satchel 14 Jan

    I tohught finding this would be so arduous but it's a breeze!
  • gqxytmtnf 15 Jan

    v37Wk7 , [url=http://tgoqwyqpzofb.com/]tgoqwyqpzofb[/url], [link=http://qibwrpqtyrtw.com/]qibwrpqtyrtw[/link], http://dlmwopyimrla.com/
  • woidhkdvr 15 Jan

    tL7WTy , [url=http://ntfxhscdpzep.com/]ntfxhscdpzep[/url], [link=http://krdhzrignjcg.com/]krdhzrignjcg[/link], http://uhmkzzqcfkfx.com/
  • lhcldj 19 Jan

    4tCZnn , [url=http://opxepeskxgtz.com/]opxepeskxgtz[/url], [link=http://rqwgitsijygd.com/]rqwgitsijygd[/link], http://mbxlerrphipx.com/
  • zwjdhmohsp 19 Jan

    OyAYZ5 , [url=http://lgshrcetsjya.com/]lgshrcetsjya[/url], [link=http://dqyaubwpqeqc.com/]dqyaubwpqeqc[/link], http://ccpbzmluygzo.com/
Post a comment!
  1. Formatting options
       
     
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
     
     
     
       

Bloggers

  • Alexander Huber (1)
  • Karin Huber (3)
  • Philipp Aumayr (10)
  • Rainer Stropek (39)
  • Simon Opelt (5)

Categories

  • .NET (7)
  • Azure (3)
  • IronPython (5)
  • Screencasts (12)
  • time cockpit (27)

Archive

  • 2012 (1)
    • January 2012 (1)
  • 2011 (14)
    • October 2011 (1)
    • September 2011 (1)
    • July 2011 (1)
    • June 2011 (2)
    • April 2011 (1)
    • March 2011 (2)
    • February 2011 (5)
    • January 2011 (1)
  • 2010 (25)
    • December 2010 (5)
    • November 2010 (2)
    • October 2010 (2)
    • September 2010 (2)
    • August 2010 (2)
    • July 2010 (7)
    • May 2010 (1)
    • April 2010 (2)
    • March 2010 (2)

About Us  |  Legal Notices  | © 2010 software architects gmbh. All rights reserved.