[CLOSED] DisplayField with multiple fields

  1. #1

    [CLOSED] DisplayField with multiple fields


    We set up a read only form to display customer information like this using DisplayFields:

    Name: Joe
    Address: 1234 Main
    City: Portland
    State: OR
    Zip: 98000

    <ext:DisplayField ID="CustomerName" runat="server" FieldLabel="Name" LabelAlign="Right"/>
    <ext:DisplayField ID="CustomerNumber" runat="server" FieldLabel="Number" LabelAlign="Right"/>
    <ext:DisplayField ID="Address" runat="server" FieldLabel="Address" LabelAlign="Right"/>
    <ext:DisplayField ID="City" runat="server" FieldLabel="City" LabelAlign="Right"/>
    <ext:DisplayField ID="State" runat="server" FieldLabel="State" LabelAlign="Right"/>
    <ext:DisplayField ID="Zip" runat="server" FieldLabel="Zip" LabelAlign="Right"/>
    But we want to display it like this
    Name: Joe
    Address: 1234 Main Portland, OR 98000

    What object type should I use for accomplishing this and do you have a link to an example that combines multiple fields into one?

    Thank you for your help.
    Last edited by Daniil; Feb 01, 2013 at 11:43 AM. Reason: [CLOSED]
  2. #2

    Try to use FieldContainer: http://examples2.ext.net/#/Form/Fiel...iner/Overview/
  3. #3
    Thank you Baidaly for responding so quickly! I had seen that example but wasnt sure if it would help. I dug in a bit deeper after your suggestion and got it work. However, the combined text does not line up "quite" right like it does for the other fields where I am only using one value. Also, sometimes, sporadically, the text would all pile on top of each other rather than display as a single string.

    I went with returning an additional field from our model that has all the fields combined into a single field.

    Thank you again for your help.
  4. #4
    If you will have a chance and time to provide us with a sample to reproduce the issue you are talking about, we would be happy to investigate.
  5. #5
    Hello Danil, below is an example:
    Two things occur
    1) The text next to Address is lower relative to its label than Cust Number and Email are relative to their labels. I can almost fix it playing around with MarginSpecs and such but only get it close to the same alignment as Email Address and Cust Number.
    2) The text for Address is collapsed on top of each other.

    Note: I tested this in IE, FF, Chrome

    <%@ Page Language="C#" %>
    <%@ Import Namespace="System.Collections.Generic"%>
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
             FormPanel2.SetValues(new {
                Email = "henry@example.com",
                FirstName = "Henry",
                LastName = "Example",
                CustNumber = "6755499",
                Address = "1234 Main",
                City = "Portland",
                State = "OR",
                Zip = "90000",
    <!DOCTYPE html>
    <head id="Head1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
            ID="FormPanel2" runat="server">
                <ext:DisplayField ID="TextField18" 
                    FieldLabel="Email Address" 
                <ext:DisplayField ID="DisplayField1" 
                    FieldLabel="Cust Number" 
                <ext:FieldContainer ID="FieldContainer1" runat="server" CombineErrors="true" MsgTarget="Under" Layout="HBoxLayout" FieldLabel="Address" LabelAlign="Right" >
                        <ext:Parameter Name="HideLabel" Value="true" Mode="Raw" />
                        <ext:Parameter Name="margins" Value="0 5 0 0" Mode="Value" />
                        <ext:DisplayField ID="Address" runat="server" />
                        <ext:DisplayField ID="DisplayField2" runat="server" Text="&nbsp;" />
                        <ext:DisplayField ID="City" runat="server" />
                        <ext:DisplayField ID="DisplayField3" runat="server" Text=",&nbsp;" />
                        <ext:DisplayField ID="State" runat="server" />
                        <ext:DisplayField ID="DisplayField4" runat="server" Text="&nbsp;" />
                        <ext:DisplayField ID="Zip" runat="server" />
  6. #6

    Sorry, I didn't see anything wrong in your example. I've tried with the last trunk revision.

    Click image for larger version. 

Name:	FieldContainer.JPG 
Views:	61 
Size:	13.0 KB 
ID:	5535

Similar Threads

  1. [CLOSED] IDProperty: set multiple key fields
    By tanky65 in forum 2.x Premium Help
    Replies: 2
    Last Post: Jan 23, 2013, 1:03 PM
  2. [CLOSED] Adding multiple Fields
    By sisa in forum 1.x Premium Help
    Replies: 3
    Last Post: Sep 14, 2012, 2:36 PM
  3. Replies: 7
    Last Post: Mar 09, 2011, 9:15 PM
  4. Combobox DisplayField 2 fields???
    By 78fede78 in forum 1.x Help
    Replies: 3
    Last Post: Sep 06, 2010, 3:07 PM
  5. How to sorted by multiple fields?
    By bruce in forum 1.x Help
    Replies: 0
    Last Post: May 04, 2009, 5:10 AM

Tags for this Thread

Posting Permissions