Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Binding DynamicForm field with indirectly referenced includeFrom datasource field

$
0
0
I'm trying to bind a datasource (LeadDetails) with a dynamic form that I've created via component XML. The datasource I have contains a few indirectly referenced fields. The fetch operation returns all fields in the expected manner as shown below. However, some of these datasource fields, namely the indirectly referenced includeFrom fields (phone, custName), are do not bind to the loaded form. The rest of the fields including the directly referenced includeFrom field (email) bind just fine.

I've read the relevant docs and checked out the field include showcase samples as well but I can't seem to figure this one out. What am I doing wrong here?


Please find attached all relevant source code below:

Response received from LeadDetails Datasource:

Code:

{custName=ron, phone=3432342, email=ron12@gmail.com, statusMaster=1, cities=2, leadSources=1, orders=6455, usersByIdUser=30, receivedAt=Wed Aug 06 11:11:07 IST 2014, updatedAt=Wed Aug 06 11:11:11 IST 2014, id=12, priorityPoints=4, lastCommentAt=Wed Aug 06 11:11:12 IST 2014}
Code:

<DataSource
        allowAdvancedCriteria="true"
        dropExtraFields="true"
        beanClassName="com.bmf.domain.Leads"
        ID="LeadDetails"
        serverType="jpa"
>
        <fields>               
                <field primaryKey="true" name="id" length="255" canEdit="false" required="false" type="sequence"></field>
                <field name="lastCommentAt" length="19" canEdit="true" required="true" type="text"></field>
                <field name="priorityPoints" length="255" canEdit="true" required="true" type="text"></field>
                <field name="receivedAt" length="19" canEdit="true" required="true" type="text"></field>
                <field name="updatedAt" length="19" canEdit="true" required="true" type="text"></field>
                <field name="custName" includeFrom="UserDetails.firstName" includeVia="usersByIdUser" />
                <field name="phone" includeFrom="UserDetails.mobile"/>
                <field name="email" includeFrom="Users.email" />       
               
<!--                <field name="operators" foreignKey="Operators.id" /> -->
                <field name="statusMaster" foreignKey="StatusMaster.id" />                               
                <field name="cities" foreignKey="Cities.id" />
                <field name="leadSources" foreignKey="LeadSources.id" />
                <field name="orders" foreignKey="Orders.id" />               
                <field name="usersByIdUser" foreignKey="Users.id" />                       
        </fields>
</DataSource>

Code:

<DataSource
        allowAdvancedCriteria="true"
        dropExtraFields="true"
        beanClassName="com.bmf.domain.Users"
        ID="Users"
        entityName="com.bmf.domain.Users"
        serverType="jpa"
>
        <fields>
                <field hidden="true" primaryKey="true" name="id" length="255" canEdit="false" required="false" type="sequence"></field>
                <field name="accountNonExpired" length="255" canEdit="true" required="true" type="boolean"></field>
                <field name="accountNonLocked" length="255" canEdit="true" required="true" type="boolean"></field>
                <field name="credentialsNonExpired" length="255" canEdit="true" required="true" type="boolean"></field>
                <field name="dateAdd" length="19" canEdit="true" required="false" type="datetime"></field>
                <field name="dateUpd" length="19" canEdit="true" required="false" type="datetime"></field>
                <field name="email" length="255" canEdit="true" required="true" type="text"></field>
                <field name="enabled" length="255" canEdit="true" required="true" type="boolean"></field>
                <field name="firstLoginTime" length="19" canEdit="true" required="false" type="datetime"></field>
                <field name="hasLoggedon" length="255" canEdit="true" required="false" type="boolean"></field>
                <field name="lastLoginTime" length="19" canEdit="true" required="false" type="datetime"></field>
                <field name="loginAttempts" length="255" canEdit="true" required="false" type="integer"></field>
                <field name="passportNo" length="50" canEdit="true" required="false" type="text"></field>
                <field name="password" length="30" canEdit="true" required="false" type="text"></field>
                <field name="passwordResetCode" length="30" canEdit="true" required="false" type="text"></field>
                <field name="userName" length="50" canEdit="true" required="false" type="text"></field>
               
                <field name="userDetails" foreignKey="UserDetails.id" />
        </fields>

Code:

<DataSource
        allowAdvancedCriteria="true"
        dropExtraFields="true"
        beanClassName="com.bmf.domain.UserDetails"
        ID="UserDetails"
        generatedBy="v9.1p_2014-08-20/EVAL Deployment 2014-08-20"
        entityName="com.bmf.domain.UserDetails"
        serverType="jpa"
>
        <fields>
                <field hidden="true" primaryKey="true" name="id" length="255" canEdit="false" required="false" type="sequence"></field>
                <field name="dateAdd" length="19" canEdit="true" required="false" type="datetime"></field>
                <field name="dateUpd" length="19" canEdit="true" required="false" type="datetime"></field>
                <field name="dob" length="19" canEdit="true" required="false" type="datetime"></field>
                <field name="firstName" length="255" canEdit="true" required="false" type="text"></field>
                <field name="landline" length="255" canEdit="true" required="false" type="text"></field>
                <field name="lastName" length="255" canEdit="true" required="false" type="text"></field>
                <field name="middleName" length="255" canEdit="true" required="false" type="text"></field>
                <field name="mobile" length="50" canEdit="true" required="false" type="text"></field>
                <field name="nationality" length="255" canEdit="true" required="false" type="text"></field>
                <field name="passportNo" length="50" canEdit="true" required="false" type="text"></field>
                <field name="uniqueUrl" length="255" canEdit="true" required="false" type="text"></field>
        </fields>
</DataSource>

Code:


<DynamicForm dataSource="LeadDetails" numCols="6" ID="leadDetails" autoDraw="false">
    <fields>
        <FormItem name="HeaderItem1" constructor="HeaderItem">
            <defaultValue>General Details</defaultValue>
        </FormItem>
        <FormItem name="id" title="Lead ID" constructor="StaticTextItem"/>
        <FormItem name="statusMaster" title="Status" constructor="ComboBoxItem"/>
        <FormItem name="leadSources" title="Lead Source" constructor="ComboBoxItem"/>
        <FormItem name="receivedAt" title="Received At" constructor="StaticTextItem"/>
        <FormItem name="updatedAt" title="Last Status Update" constructor="StaticTextItem"/>
        <FormItem name="lastComment" title="Last Comment" constructor="StaticTextItem"/>
        <FormItem name="operators" title="Operator" constructor="ComboBoxItem"/>
        <FormItem name="priorityPoints" title="Priority Points" constructor="TextItem"/>
        <FormItem name="city" title="City" constructor="ComboBoxItem"/>
        <FormItem name="fulfillmentOrg" title="Fulfillment Org" constructor="StaticTextItem"/>
        <FormItem name="fulfillmentBranch" title="Fulfillment Branch" constructor="StaticTextItem"/>
        <FormItem name="custDtsHeader" constructor="HeaderItem">
            <defaultValue>Customer Details</defaultValue>
        </FormItem>
        <FormItem name="usersByIdUser" constructor="HiddenItem">
            <defaultValue></defaultValue>
           
        </FormItem>
        <FormItem name="custName" title="Name" constructor="TextItem"/>
        <FormItem name="phone" title="Phone" constructor="TextItem"/>
        <FormItem name="email" title="Email" constructor="TextItem"/>
        <FormItem name="address" title="Address" width="*" colSpan="5" startRow="true" endRow="true" constructor="TextAreaItem">
            <titleColSpan>1</titleColSpan>
        </FormItem>
        <FormItem name="country" title="Country" constructor="ComboBoxItem"/>
        <FormItem name="state" title="State" constructor="ComboBoxItem"/>
        <FormItem name="city" title="City" constructor="ComboBoxItem"/>
        <FormItem name="zipCode" title="Zip Code" constructor="TextItem"/>
        <FormItem name="idType" title="ID Type" constructor="ComboBoxItem"/>
        <FormItem name="idNo" title="ID No" constructor="TextItem"/>
        <FormItem name="HeaderItem2" constructor="HeaderItem">
            <defaultValue>Order Details</defaultValue>
        </FormItem>
    </fields>
    <cellPadding>3</cellPadding>
</DynamicForm>


<DynamicForm numCols="6" ID="forexDetailsForm" autoDraw="false">
    <fields>
        <FormItem name="orderType" title="Order Type" constructor="ComboBoxItem"/>
        <FormItem name="purpose" title="Purpose" constructor="ComboBoxItem"/>
        <FormItem name="status" title="Status" constructor="ComboBoxItem"/>
        <FormItem name="modeOfPayment" title="Mode Of Payment" constructor="ComboBoxItem"/>
        <FormItem name="fulfillmentOrg" title="Fulfillment Org" constructor="ComboBoxItem"/>
        <FormItem name="fulfillmentBranch" title="Fulfillment Branch" constructor="ComboBoxItem"/>
    </fields>
</DynamicForm>


<ListGrid ID="forexProductsGrid" height="150" autoDraw="false"/>


<DynamicForm numCols="6" ID="forexOrderGrid" autoDraw="false">
    <fields>
        <FormItem name="deliveryCharge" title="Delivery Charge" constructor="TextItem">
            <titleColSpan>3</titleColSpan>
        </FormItem>
        <FormItem name="discount" title="Discount" colSpan="1" constructor="TextItem">
            <titleColSpan>3</titleColSpan>
        </FormItem>
        <FormItem name="tax" title="Tax" constructor="TextItem">
            <titleColSpan>3</titleColSpan>
        </FormItem>
        <FormItem name="depositReceived" title="Deposit Received" constructor="TextItem">
            <titleColSpan>3</titleColSpan>
        </FormItem>
        <FormItem name="grandTotal" title="Grand Total" endRow="true" constructor="TextItem">
            <titleColSpan>3</titleColSpan>
        </FormItem>
        <FormItem name="documentsVerified" title="Documents Verified" constructor="CheckboxItem"/>
        <FormItem name="depositReceivedChkBox" title="Deposit Received" constructor="CheckboxItem"/>
        <FormItem name="fullPaymentReceived" title="Full Payment Received" constructor="CheckboxItem"/>
        <FormItem name="swiftCopySent" title="Swift Copy Sent" constructor="CheckboxItem"/>
        <FormItem name="cardLoaded" title="Card Loaded" constructor="CheckboxItem"/>
        <FormItem name="depositRefunded" title="Deposit Refunded" constructor="CheckboxItem"/>
    </fields>
</DynamicForm>


<VLayout ID="VLayout4" autoDraw="false">
    <members><Canvas ref="forexDetailsForm"/><Canvas ref="forexProductsGrid"/><Canvas ref="forexOrderGrid"/>
    </members>
</VLayout>


<TabSet ID="TabSet1" height="500" autoDraw="false">
    <tabs>
        <Tab title="Forex">
            <pane><Canvas ref="VLayout4"/></pane>
            <ID>Tab2</ID>
        </Tab>
    </tabs>
    <destroyPanes>false</destroyPanes>
</TabSet>


<VLayout ID="VLayout1" width="762" height="900" autoDraw="false">
    <members><Canvas ref="leadDetails"/><Canvas ref="TabSet1"/>
    </members>
</VLayout>


<TabSet ID="TabSet0" width="100%" height="100%" autoDraw="false">
    <tabs>
        <Tab title="Lead Details">
            <pane><Canvas ref="VLayout1"/></pane>
            <ID>Tab0</ID>
        </Tab>
    </tabs>
    <destroyPanes>false</destroyPanes>
</TabSet>


<Window ID="leadDetailsWindow" width="840" height="600" overflow="scroll" autoDraw="false">
    <autoCenter>true</autoCenter>
    <title>Window1</title>
    <items><Canvas ref="TabSet0"/>
    </items>
    <showShadow>false</showShadow>
</Window>


SmartClient Version: v9.1p_2014-09-01/EVAL Deployment (expires 2014.10.31_04.45.35) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)

Viewing all articles
Browse latest Browse all 4756

Trending Articles