Entries from February 1, 2008 - March 1, 2008
How to make the FileUpLoad control display as a link to the file.
When using the Advantys file upload, we can display a link to the uploaded file but not allow the user to modify or delete the file. All you need to do is add the following line of code in your c# project: WorkflowFileUpload1.ReadOnly = true;
This could be added to a section of code that checks for a specific WorkflowGen action.
To download the FileUpload component please click here
C#
protected void Page_Load(object sender, EventArgs e) {
switch (this.CurrentWorkflowActionName) {
case "INITIATES":
// write code here
break;
case "SECOND_ACTION":
// set file upload
WorkflowFileUpload1.ReadOnly = true;
break;
}
}
VB
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Select Case (Me.CurrentWorkflowActionName)
Case "INITIATES"
' write code here
Case "SECOND_ACTION"
' file upload
WorkflowFileUpload1.ReadOnly = true
End Select
End Sub
When a web form loads, how can I make the cursor start in a specific text box?
If you want the cursor to start in a specific text box add the following line of code in your application:
C#
this.FIELDNAME.Focus();
VB
Me.FIELDNAME.Focus
You could add it to the page load function as follows:
C#
protected void Page_Load(object sender, EventArgs e) {
switch (this.CurrentWorkflowActionName) {
case "INITIATES":
// If current action is INITIATES, do some work
this.FIELDNAME.Focus();
break;
case "APPROVES":
// If current action is APPROVES, do some work
// write code here
break;
}
}
VB
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Select Case (Me.CurrentWorkflowActionName)
Case "INITIATES"
'If current action is INITIATES, do some work
Me.FIELDNAME.Focus
Case "APPROVES"
'If current action is APPROVES, do some work
' write code here
End Select
End Sub
How can I set the maximum length of a multi-line text box in a web form?
Restricting the length of text on a Multi line textbox is not supported by the standard ASP.NET Web control. This can be done by adding the following Javascript function in your ASPX page.
1. Add a javascript:
At the top of your ASPX page you will see the following tag </ head > . A dd the following code under this tag:
<script language="javascript" type="text/javascript">function Count(text,long){
var maxlength = new Number(long); // Change number to your max length.
if (text.value.length > maxlength){text.value = text.value.substring(0,maxlength);
alert(" Only " + long + " chars");}
}
</script>
2. Change your text controls on your ASPX page
On every multi-line text box where you would like to control the length, add the following code to the asp text box control.
onKeyUp="Count(this,50)" onChange="Count(this,50)"
Your original text control before adding this code:
<asp:TextBox ID="TESTDATA" runat="server" TextMode="MultiLine"></asp:TextBox>
After adding the code:
<asp:TextBox ID="TextBox1" runat="server" onKeyUp="Count(this,50)" onChange="Count(this,50)" TextMode="MultiLine"></asp:TextBox>
How do I change labels in an existing language?
Editing an existing language file in WorkflowGen is similar to the method to add a new language (refer to the link: http://community.workflowgen.com/kb/how-to-support-create-a-new-language.html)
The same caveat applies that software updates may overwrite any changes made to your language resource files. To avoid this, back up the resource files prior to an update, perform the update, and re-apply the changes afterwards.
Special note for the English US language
English US (en-US) is the primary language of WorkflowGen, and as such, does not have a language-denominated resource file associated to it in the same manner as other languages. For example, English Canada (en-CA) has the following resource file for the Portal module: “Advantys.Workflow.Web.UI.Portal.en-CA.resx”, whereas the default “core” language for WorkflowGen (en-US) is maintained in the resource file “Advantys.Workflow.Web.UI.Portal.resx”.
Attempting to modify the file "Advantys.Workflow.Web.UI.Portal.resx", however, will not function as expected. Instead, to create changes to the English US language, copy “Advantys.Workflow.Web.UI.Portal.resx” (and other resource files as described in the link shown above) to the new file “Advantys.Workflow.Web.UI.Portal.en-US.resx” and modify this new file. Changes to labels will then appear as expected.