예제 #1
0
        private void RenderInputBoxTextBox(ComponentController paComponentController, InputInfoRow paInputInfoRow, String paActiveValue, bool paMultiline)
        {
            String lcInputType;

            if (paInputInfoRow.MaxLimit > 0)
            {
                paComponentController.AddAttribute(HtmlAttribute.Maxlength, paInputInfoRow.MaxLimit.ToString());
            }
            if (!paInputInfoRow.InputName.StartsWith(ctVirtualColumnPrefix))
            {
                paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_ColumnName, paInputInfoRow.InputName.ToLower());
            }
            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_InputMode, paInputInfoRow.InputMode.Trim());

            if (IsAttributeSet(paInputInfoRow, InputInfoAttribute.DelimitedList))
            {
                paActiveValue = paActiveValue.Replace(ctMultilineDelimiter, ctCR);
                paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Mode, "delimited");
            }

            if (IsAttributeSet(paInputInfoRow, InputInfoAttribute.Mandatory))
            {
                paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Mandatory, "true");
            }

            if (IsAttributeSet(paInputInfoRow, InputInfoAttribute.Identifier))
            {
                paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_IdentifierColumn, "true");
            }

            if (IsAttributeSet(paInputInfoRow, InputInfoAttribute.KeyField))
            {
                paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_KeyField, "true");
            }

            if (IsAttributeSet(paInputInfoRow, InputInfoAttribute.DataMirror))
            {
                paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_MirrorColumn, paInputInfoRow.LinkColumn);
            }

            if (IsAttributeSet(paInputInfoRow, InputInfoAttribute.Persist))
            {
                paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Persist, "true");
            }

            if ((clForceReadOnlyMode) || (IsAttributeSet(paInputInfoRow, InputInfoAttribute.ReadOnly)))
            {
                paComponentController.AddAttribute(HtmlAttribute.ReadOnly, "true");
            }

            if (!String.IsNullOrEmpty(paInputInfoRow.QueryName))
            {
                if (paInputInfoRow.QueryName.Contains("."))
                {
                    paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_QueryName, paInputInfoRow.QueryName);
                }
                else
                {
                    paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_QueryName, paInputInfoRow.InputGroup + "." + paInputInfoRow.QueryName);
                }
            }

            paComponentController.AddAttribute(HtmlAttribute.Style, paInputInfoRow.InputCss);
            paComponentController.AddAttribute(HtmlAttribute.Name, paInputInfoRow.InputName);
            paComponentController.AddElementType(ComponentController.ElementType.InputBox);

            if (!IsAttributeSet(paInputInfoRow, InputInfoAttribute.Password))
            {
                if (IsAttributeSet(paInputInfoRow, InputInfoAttribute.DynamicNumber))
                {
                    paActiveValue = clLanguageManager.ConvertNumber(paActiveValue);
                }
                paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_OriginalValue, paActiveValue);
                paComponentController.AddAttribute(HtmlAttribute.Value, paActiveValue);
                lcInputType = "text";
            }
            else
            {
                paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_OriginalValue, General.Base64Encode(paActiveValue));
                lcInputType = "password";
            }

            if (paMultiline)
            {
                paComponentController.RenderBeginTag(HtmlTag.Textarea);
                paComponentController.Write(paActiveValue);
            }
            else
            {
                //if (IsAttributeSet(lcInputInfoRow, InputInfoAttribute.Password)) paComponentController.AddAttribute(HtmlAttribute.Type, "password");
                //else paComponentController.AddAttribute(HtmlAttribute.Type, "text");
                paComponentController.AddAttribute(HtmlAttribute.Type, lcInputType);
                paComponentController.RenderBeginTag(HtmlTag.Input);
            }
            paComponentController.RenderEndTag();
        }
예제 #2
0
        public void RenderSubGroup(ComponentController paComponentController, String paPrimaryClass, String paSubGroup, MetaDataRow paMetaDataRow)
        {
            DataRow[]    lcDataRow;
            InputInfoRow lcInputInfoRow;
            String       lcActiveValue;

            if ((lcDataRow = GetInputInfoListBySubGroup(paSubGroup)).Length > 0)
            {
                lcInputInfoRow = new InputInfoRow(lcDataRow[0]);

                if (!String.IsNullOrEmpty(lcInputInfoRow.ElementCss))
                {
                    if (!lcInputInfoRow.ElementCss.Contains(ctCSSSeparator))
                    {
                        paPrimaryClass = (paPrimaryClass + " " + lcInputInfoRow.ElementCss).Trim();
                    }
                }

                if (IsAttributeSet(lcInputInfoRow, InputInfoAttribute.PopUpBlock))
                {
                    for (int lcCount = 0; lcCount < lcDataRow.Length; lcCount++)
                    {
                        lcInputInfoRow.Row = lcDataRow[lcCount];
                        if (!IsAttributeSet(lcInputInfoRow, InputInfoAttribute.Title))
                        {
                            RenderElementComponent(paComponentController, lcInputInfoRow, String.Empty);
                        }
                    }
                }
                else
                {
                    if (IsAttributeSet(lcInputInfoRow, InputInfoAttribute.HideBlock))
                    {
                        paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Appearance, "hidden");
                    }
                    paComponentController.AddElementType(ComponentController.ElementType.InputBlock);
                    paComponentController.AddAttribute(HtmlAttribute.Class, paPrimaryClass);
                    paComponentController.RenderBeginTag(HtmlTag.Div);

                    for (int lcCount = 0; lcCount < lcDataRow.Length; lcCount++)
                    {
                        lcInputInfoRow.Row = lcDataRow[lcCount];
                        if (IsAttributeSet(lcInputInfoRow, InputInfoAttribute.Title))
                        {
                            RenderTitle(paComponentController, lcInputInfoRow);
                        }
                        else
                        {
                            if ((paMetaDataRow != null) && (paMetaDataRow.HasPreloadedData))
                            {
                                lcActiveValue = paMetaDataRow.ActiveData.GetData(lcInputInfoRow.InputName, String.Empty);
                            }
                            else
                            {
                                lcActiveValue = ApplicationFrame.GetInstance().ActiveFormInfoManager.TranslateStringExStr(lcInputInfoRow.DefaultValue);
                            }
                            RenderRow(paComponentController, lcInputInfoRow, lcActiveValue);
                        }
                    }

                    paComponentController.RenderEndTag();
                }
            }
        }