How do I the same field PK more than once on the form

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I the same field PK more than once on the form

muralis
Hello,

I am trying to build a simple form;

1) I have a Person Entity with PK as personId

2) I have a Hobby Entity with PK as Hobbyid

3) I have a Person_Hobby Entity with two FKs of above both.

I have a form that attempts to Create the 3rd Entity.

As a part of the form I am allow the dropdown to select the Person Name
(The Person name comes from Person table)

 <field  name="guestId" title="${uiLabelMap.PersonId}">
         <drop-down>
<entity-options entity-name="HelloPerson" description="${firstName}" />
</drop-down>
</field>

Next field element I attempt to fetch the gender of the Person again from
the Person Table something like this

<field  name="guestId"  name="gender"
entry-name="guestId"><display-entity.....>

I am getting an error that gender is not a "PK" which is actually true. I
cant set the name as "guestId" again because the field with same names if
repeated, the last one takes effect. How do I get teh gender frm the person
table ?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: How do I the same field PK more than once on the form

Christian Carlow-OFBizzer
Hey Murali,

Seems like this is the problem:

<field  name="guestId"  name="gender"
entry-name="guestId"><display-entity

I think the form widget <display-entity> element is only supposed to be
used for fields that are PKs.  Since gender is not a PK field, an entity
cannot be found.  If gender is defined in the entity that is being used
by the form, then replacing <display-entity> with <display> seems like
it would resolve the problem by correctly displaying the gender of the
person.

On 01/25/2014 10:14 AM, Murali Shankar Gopalakrishnan wrote:
> <field  name="guestId"  name="gender"
> entry-name="guestId"><display-entity

Reply | Threaded
Open this post in threaded view
|

Re: How do I the same field PK more than once on the form

Christian Carlow-OFBizzer
Sorry Murali,

I think I'm mistaken.  Please post the entire form widget code.

On 01/25/2014 10:30 AM, Christian Carlow wrote:

> Hey Murali,
>
> Seems like this is the problem:
>
> <field  name="guestId"  name="gender"
> entry-name="guestId"><display-entity
>
> I think the form widget <display-entity> element is only supposed to
> be used for fields that are PKs.  Since gender is not a PK field, an
> entity cannot be found.  If gender is defined in the entity that is
> being used by the form, then replacing <display-entity> with <display>
> seems like it would resolve the problem by correctly displaying the
> gender of the person.
>
> On 01/25/2014 10:14 AM, Murali Shankar Gopalakrishnan wrote:
>> <field  name="guestId"  name="gender"
>> entry-name="guestId"><display-entity
>

Reply | Threaded
Open this post in threaded view
|

Re: How do I the same field PK more than once on the form

muralis
Here goes the Form Widget Christian. Have made the couple of elements in
question in Bold.

    <form name="EditPersonHobby" type="single" target="updatePersonhobby"
title="Edit Person Hobby" default-map-name="helloPersonHobby"
default-entity-name="HelloPersonHobby">
          <alt-target use-when="helloPersonHobby==null"
target="createPersonhobby?gender=${gender}"/>
        <!--  <auto-fields-service service-name="updatePersonHobby"/>  -->

        <field use-when="helloPersonHobby!=null" name="guestHobbyId"
title="${uiLabelMap.PersonHobbyId}"
tooltip="${uiLabelMap.CommonNotModifRecreat}"><display/></field>
        <field use-when="helloPersonHobby==null @and guestHobbyId==null"
name="guestHobbyId" title="${uiLabelMap.PersonId}"><ignored/></field>
        <field use-when="helloPersonHobby==null @and guestHobbyId!=null"
name="guestHobbyId" title="${uiLabelMap.PersonHobbyId}"><display
description="${uiLabelMap.CommonCannotBeFound}: [${guestHobbyId}]"
also-hidden="false"/></field>
        <field use-when="helloPersonHobby==null @and guestId==null"
name="guestId" title="${uiLabelMap.PersonName}">
        <drop-down>
<entity-options entity-name="HelloPerson" description="${firstName}" />
</drop-down>
</field>
* <field use-when="helloPersonHobby!=null @and guestId!=null"
name="guestId" entry-name="gender"><display-entity
entity-name="HelloPerson" description="${gender}"></display-entity></field>*
* <field use-when="helloPersonHobby!=null @and guestId!=null"
name="guestId" entry-name="guestId"><display-entity
entity-name="HelloPerson"
description="${firstName}"></display-entity></field>*

        <field name="hobbyId">
<drop-down>
<entity-options entity-name="HelloHobby" description="${description}" />
</drop-down>
</field>
        <field name="submitButton" use-when="helloPersonHobby==null"
title="${uiLabelMap.CommonCreate}"><submit button-type="button"/></field>
        <field name="submitButton" use-when="helloPersonHobby!=null"
title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
    </form>


On Sat, Jan 25, 2014 at 10:33 PM, Christian Carlow <
[hidden email]> wrote:

> Sorry Murali,
>
> I think I'm mistaken.  Please post the entire form widget code.
>
>
> On 01/25/2014 10:30 AM, Christian Carlow wrote:
>
>> Hey Murali,
>>
>> Seems like this is the problem:
>>
>> <field  name="guestId"  name="gender"
>> entry-name="guestId"><display-entity
>>
>> I think the form widget <display-entity> element is only supposed to be
>> used for fields that are PKs.  Since gender is not a PK field, an entity
>> cannot be found.  If gender is defined in the entity that is being used by
>> the form, then replacing <display-entity> with <display> seems like it
>> would resolve the problem by correctly displaying the gender of the person.
>>
>> On 01/25/2014 10:14 AM, Murali Shankar Gopalakrishnan wrote:
>>
>>> <field  name="guestId"  name="gender"
>>> entry-name="guestId"><display-entity
>>>
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: How do I the same field PK more than once on the form

Christian Carlow-OFBizzer
Hey Murali,

If gender is defined in HelloPersonHobby then as stated in my first
response, there is no need for <display-entity> so <display> should
replace it.  Also, the name of the field should be changed to gender
instead of guestId.

On 01/25/2014 11:54 AM, Murali Shankar Gopalakrishnan wrote:

> Here goes the Form Widget Christian. Have made the couple of elements in
> question in Bold.
>
>      <form name="EditPersonHobby" type="single" target="updatePersonhobby"
> title="Edit Person Hobby" default-map-name="helloPersonHobby"
> default-entity-name="HelloPersonHobby">
>            <alt-target use-when="helloPersonHobby==null"
> target="createPersonhobby?gender=${gender}"/>
>          <!--  <auto-fields-service service-name="updatePersonHobby"/>  -->
>
>          <field use-when="helloPersonHobby!=null" name="guestHobbyId"
> title="${uiLabelMap.PersonHobbyId}"
> tooltip="${uiLabelMap.CommonNotModifRecreat}"><display/></field>
>          <field use-when="helloPersonHobby==null @and guestHobbyId==null"
> name="guestHobbyId" title="${uiLabelMap.PersonId}"><ignored/></field>
>          <field use-when="helloPersonHobby==null @and guestHobbyId!=null"
> name="guestHobbyId" title="${uiLabelMap.PersonHobbyId}"><display
> description="${uiLabelMap.CommonCannotBeFound}: [${guestHobbyId}]"
> also-hidden="false"/></field>
>          <field use-when="helloPersonHobby==null @and guestId==null"
> name="guestId" title="${uiLabelMap.PersonName}">
>          <drop-down>
> <entity-options entity-name="HelloPerson" description="${firstName}" />
> </drop-down>
> </field>
> * <field use-when="helloPersonHobby!=null @and guestId!=null"
> name="guestId" entry-name="gender"><display-entity
> entity-name="HelloPerson" description="${gender}"></display-entity></field>*
> * <field use-when="helloPersonHobby!=null @and guestId!=null"
> name="guestId" entry-name="guestId"><display-entity
> entity-name="HelloPerson"
> description="${firstName}"></display-entity></field>*
>
>          <field name="hobbyId">
> <drop-down>
> <entity-options entity-name="HelloHobby" description="${description}" />
> </drop-down>
> </field>
>          <field name="submitButton" use-when="helloPersonHobby==null"
> title="${uiLabelMap.CommonCreate}"><submit button-type="button"/></field>
>          <field name="submitButton" use-when="helloPersonHobby!=null"
> title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
>      </form>
>
>
> On Sat, Jan 25, 2014 at 10:33 PM, Christian Carlow <
> [hidden email]> wrote:
>
>> Sorry Murali,
>>
>> I think I'm mistaken.  Please post the entire form widget code.
>>
>>
>> On 01/25/2014 10:30 AM, Christian Carlow wrote:
>>
>>> Hey Murali,
>>>
>>> Seems like this is the problem:
>>>
>>> <field  name="guestId"  name="gender"
>>> entry-name="guestId"><display-entity
>>>
>>> I think the form widget <display-entity> element is only supposed to be
>>> used for fields that are PKs.  Since gender is not a PK field, an entity
>>> cannot be found.  If gender is defined in the entity that is being used by
>>> the form, then replacing <display-entity> with <display> seems like it
>>> would resolve the problem by correctly displaying the gender of the person.
>>>
>>> On 01/25/2014 10:14 AM, Murali Shankar Gopalakrishnan wrote:
>>>
>>>> <field  name="guestId"  name="gender"
>>>> entry-name="guestId"><display-entity
>>>>
>>>

Reply | Threaded
Open this post in threaded view
|

Re: How do I the same field PK more than once on the form

muralis
The Gender is a Field in the "Person" Entity.

The HelloPersonHobby Entity just has two fields 1) PersonId 2) HobbyId.
Both FKs the first one to HelloPerson Entity (that contains the field
gender) and the second field FK to a entity called Hobby.

So , in this context, where, I need to extract the data from a related
entity (master table) and show multiple fields of the related table, during
Create/Update of a transaction table is what I am trying to do.

Appreciate some thoughts on how this can be modelled in a form widget. I am
sure this is a common need, and I am also sure there should be some way.

Thank you.

Cheers
murali



On Sat, Jan 25, 2014 at 11:45 PM, Christian Carlow <
[hidden email]> wrote:

> Hey Murali,
>
> If gender is defined in HelloPersonHobby then as stated in my first
> response, there is no need for <display-entity> so <display> should replace
> it.  Also, the name of the field should be changed to gender instead of
> guestId.
>
>
> On 01/25/2014 11:54 AM, Murali Shankar Gopalakrishnan wrote:
>
>> Here goes the Form Widget Christian. Have made the couple of elements in
>> question in Bold.
>>
>>      <form name="EditPersonHobby" type="single" target="updatePersonhobby"
>> title="Edit Person Hobby" default-map-name="helloPersonHobby"
>> default-entity-name="HelloPersonHobby">
>>            <alt-target use-when="helloPersonHobby==null"
>> target="createPersonhobby?gender=${gender}"/>
>>          <!--  <auto-fields-service service-name="updatePersonHobby"/>
>>  -->
>>
>>          <field use-when="helloPersonHobby!=null" name="guestHobbyId"
>> title="${uiLabelMap.PersonHobbyId}"
>> tooltip="${uiLabelMap.CommonNotModifRecreat}"><display/></field>
>>          <field use-when="helloPersonHobby==null @and guestHobbyId==null"
>> name="guestHobbyId" title="${uiLabelMap.PersonId}"><ignored/></field>
>>          <field use-when="helloPersonHobby==null @and guestHobbyId!=null"
>> name="guestHobbyId" title="${uiLabelMap.PersonHobbyId}"><display
>> description="${uiLabelMap.CommonCannotBeFound}: [${guestHobbyId}]"
>> also-hidden="false"/></field>
>>          <field use-when="helloPersonHobby==null @and guestId==null"
>> name="guestId" title="${uiLabelMap.PersonName}">
>>          <drop-down>
>> <entity-options entity-name="HelloPerson" description="${firstName}" />
>> </drop-down>
>> </field>
>> * <field use-when="helloPersonHobby!=null @and guestId!=null"
>>
>> name="guestId" entry-name="gender"><display-entity
>> entity-name="HelloPerson" description="${gender}"></
>> display-entity></field>*
>> * <field use-when="helloPersonHobby!=null @and guestId!=null"
>>
>> name="guestId" entry-name="guestId"><display-entity
>> entity-name="HelloPerson"
>> description="${firstName}"></display-entity></field>*
>>
>>
>>          <field name="hobbyId">
>> <drop-down>
>> <entity-options entity-name="HelloHobby" description="${description}" />
>> </drop-down>
>> </field>
>>          <field name="submitButton" use-when="helloPersonHobby==null"
>> title="${uiLabelMap.CommonCreate}"><submit button-type="button"/></field>
>>          <field name="submitButton" use-when="helloPersonHobby!=null"
>> title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
>>      </form>
>>
>>
>> On Sat, Jan 25, 2014 at 10:33 PM, Christian Carlow <
>> [hidden email]> wrote:
>>
>>  Sorry Murali,
>>>
>>> I think I'm mistaken.  Please post the entire form widget code.
>>>
>>>
>>> On 01/25/2014 10:30 AM, Christian Carlow wrote:
>>>
>>>  Hey Murali,
>>>>
>>>> Seems like this is the problem:
>>>>
>>>> <field  name="guestId"  name="gender"
>>>> entry-name="guestId"><display-entity
>>>>
>>>> I think the form widget <display-entity> element is only supposed to be
>>>> used for fields that are PKs.  Since gender is not a PK field, an entity
>>>> cannot be found.  If gender is defined in the entity that is being used
>>>> by
>>>> the form, then replacing <display-entity> with <display> seems like it
>>>> would resolve the problem by correctly displaying the gender of the
>>>> person.
>>>>
>>>> On 01/25/2014 10:14 AM, Murali Shankar Gopalakrishnan wrote:
>>>>
>>>>  <field  name="guestId"  name="gender"
>>>>> entry-name="guestId"><display-entity
>>>>>
>>>>>
>>>>
>
Reply | Threaded
Open this post in threaded view
|

Re: How do I the same field PK more than once on the form

Christian Carlow-OFBizzer
Hey Murali,

In that case, the <display-entity> entity-name should be set to "Person"
instead of "HelloPerson" since it's the entity containing the gender field.

Something like:

<field use-when="helloPersonHobby!=null @and guestId!=null"
name="gender" ><display-entity
entity-name="Person" description="${gender}"></
display-entity></field>*



On 01/25/2014 12:44 PM, Murali Shankar Gopalakrishnan wrote:

> The Gender is a Field in the "Person" Entity.
>
> The HelloPersonHobby Entity just has two fields 1) PersonId 2) HobbyId.
> Both FKs the first one to HelloPerson Entity (that contains the field
> gender) and the second field FK to a entity called Hobby.
>
> So , in this context, where, I need to extract the data from a related
> entity (master table) and show multiple fields of the related table, during
> Create/Update of a transaction table is what I am trying to do.
>
> Appreciate some thoughts on how this can be modelled in a form widget. I am
> sure this is a common need, and I am also sure there should be some way.
>
> Thank you.
>
> Cheers
> murali
>
>
>
> On Sat, Jan 25, 2014 at 11:45 PM, Christian Carlow <
> [hidden email]> wrote:
>
>> Hey Murali,
>>
>> If gender is defined in HelloPersonHobby then as stated in my first
>> response, there is no need for <display-entity> so <display> should replace
>> it.  Also, the name of the field should be changed to gender instead of
>> guestId.
>>
>>
>> On 01/25/2014 11:54 AM, Murali Shankar Gopalakrishnan wrote:
>>
>>> Here goes the Form Widget Christian. Have made the couple of elements in
>>> question in Bold.
>>>
>>>       <form name="EditPersonHobby" type="single" target="updatePersonhobby"
>>> title="Edit Person Hobby" default-map-name="helloPersonHobby"
>>> default-entity-name="HelloPersonHobby">
>>>             <alt-target use-when="helloPersonHobby==null"
>>> target="createPersonhobby?gender=${gender}"/>
>>>           <!--  <auto-fields-service service-name="updatePersonHobby"/>
>>>   -->
>>>
>>>           <field use-when="helloPersonHobby!=null" name="guestHobbyId"
>>> title="${uiLabelMap.PersonHobbyId}"
>>> tooltip="${uiLabelMap.CommonNotModifRecreat}"><display/></field>
>>>           <field use-when="helloPersonHobby==null @and guestHobbyId==null"
>>> name="guestHobbyId" title="${uiLabelMap.PersonId}"><ignored/></field>
>>>           <field use-when="helloPersonHobby==null @and guestHobbyId!=null"
>>> name="guestHobbyId" title="${uiLabelMap.PersonHobbyId}"><display
>>> description="${uiLabelMap.CommonCannotBeFound}: [${guestHobbyId}]"
>>> also-hidden="false"/></field>
>>>           <field use-when="helloPersonHobby==null @and guestId==null"
>>> name="guestId" title="${uiLabelMap.PersonName}">
>>>           <drop-down>
>>> <entity-options entity-name="HelloPerson" description="${firstName}" />
>>> </drop-down>
>>> </field>
>>> * <field use-when="helloPersonHobby!=null @and guestId!=null"
>>>
>>> name="guestId" entry-name="gender"><display-entity
>>> entity-name="HelloPerson" description="${gender}"></
>>> display-entity></field>*
>>> * <field use-when="helloPersonHobby!=null @and guestId!=null"
>>>
>>> name="guestId" entry-name="guestId"><display-entity
>>> entity-name="HelloPerson"
>>> description="${firstName}"></display-entity></field>*
>>>
>>>
>>>           <field name="hobbyId">
>>> <drop-down>
>>> <entity-options entity-name="HelloHobby" description="${description}" />
>>> </drop-down>
>>> </field>
>>>           <field name="submitButton" use-when="helloPersonHobby==null"
>>> title="${uiLabelMap.CommonCreate}"><submit button-type="button"/></field>
>>>           <field name="submitButton" use-when="helloPersonHobby!=null"
>>> title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
>>>       </form>
>>>
>>>
>>> On Sat, Jan 25, 2014 at 10:33 PM, Christian Carlow <
>>> [hidden email]> wrote:
>>>
>>>   Sorry Murali,
>>>> I think I'm mistaken.  Please post the entire form widget code.
>>>>
>>>>
>>>> On 01/25/2014 10:30 AM, Christian Carlow wrote:
>>>>
>>>>   Hey Murali,
>>>>> Seems like this is the problem:
>>>>>
>>>>> <field  name="guestId"  name="gender"
>>>>> entry-name="guestId"><display-entity
>>>>>
>>>>> I think the form widget <display-entity> element is only supposed to be
>>>>> used for fields that are PKs.  Since gender is not a PK field, an entity
>>>>> cannot be found.  If gender is defined in the entity that is being used
>>>>> by
>>>>> the form, then replacing <display-entity> with <display> seems like it
>>>>> would resolve the problem by correctly displaying the gender of the
>>>>> person.
>>>>>
>>>>> On 01/25/2014 10:14 AM, Murali Shankar Gopalakrishnan wrote:
>>>>>
>>>>>   <field  name="guestId"  name="gender"
>>>>>> entry-name="guestId"><display-entity
>>>>>>
>>>>>>

Reply | Threaded
Open this post in threaded view
|

Re: How do I the same field PK more than once on the form

Lei Wu
Murali,

Better to create a view-entity to join the two tables, so that you have all
info you required.


On Sun, Jan 26, 2014 at 2:58 AM, Christian Carlow <
[hidden email]> wrote:

> Hey Murali,
>
> In that case, the <display-entity> entity-name should be set to "Person"
> instead of "HelloPerson" since it's the entity containing the gender field.
>
> Something like:
>
>
> <field use-when="helloPersonHobby!=null @and guestId!=null"
> name="gender" ><display-entity
> entity-name="Person" description="${gender}"></
> display-entity></field>*
>
>
>
>
> On 01/25/2014 12:44 PM, Murali Shankar Gopalakrishnan wrote:
>
>> The Gender is a Field in the "Person" Entity.
>>
>> The HelloPersonHobby Entity just has two fields 1) PersonId 2) HobbyId.
>> Both FKs the first one to HelloPerson Entity (that contains the field
>> gender) and the second field FK to a entity called Hobby.
>>
>> So , in this context, where, I need to extract the data from a related
>> entity (master table) and show multiple fields of the related table,
>> during
>> Create/Update of a transaction table is what I am trying to do.
>>
>> Appreciate some thoughts on how this can be modelled in a form widget. I
>> am
>> sure this is a common need, and I am also sure there should be some way.
>>
>> Thank you.
>>
>> Cheers
>> murali
>>
>>
>>
>> On Sat, Jan 25, 2014 at 11:45 PM, Christian Carlow <
>> [hidden email]> wrote:
>>
>>  Hey Murali,
>>>
>>> If gender is defined in HelloPersonHobby then as stated in my first
>>> response, there is no need for <display-entity> so <display> should
>>> replace
>>> it.  Also, the name of the field should be changed to gender instead of
>>> guestId.
>>>
>>>
>>> On 01/25/2014 11:54 AM, Murali Shankar Gopalakrishnan wrote:
>>>
>>>  Here goes the Form Widget Christian. Have made the couple of elements in
>>>> question in Bold.
>>>>
>>>>       <form name="EditPersonHobby" type="single"
>>>> target="updatePersonhobby"
>>>> title="Edit Person Hobby" default-map-name="helloPersonHobby"
>>>> default-entity-name="HelloPersonHobby">
>>>>             <alt-target use-when="helloPersonHobby==null"
>>>> target="createPersonhobby?gender=${gender}"/>
>>>>           <!--  <auto-fields-service service-name="updatePersonHobby"/>
>>>>   -->
>>>>
>>>>           <field use-when="helloPersonHobby!=null" name="guestHobbyId"
>>>> title="${uiLabelMap.PersonHobbyId}"
>>>> tooltip="${uiLabelMap.CommonNotModifRecreat}"><display/></field>
>>>>           <field use-when="helloPersonHobby==null @and
>>>> guestHobbyId==null"
>>>> name="guestHobbyId" title="${uiLabelMap.PersonId}"><ignored/></field>
>>>>           <field use-when="helloPersonHobby==null @and
>>>> guestHobbyId!=null"
>>>> name="guestHobbyId" title="${uiLabelMap.PersonHobbyId}"><display
>>>> description="${uiLabelMap.CommonCannotBeFound}: [${guestHobbyId}]"
>>>> also-hidden="false"/></field>
>>>>           <field use-when="helloPersonHobby==null @and guestId==null"
>>>> name="guestId" title="${uiLabelMap.PersonName}">
>>>>           <drop-down>
>>>> <entity-options entity-name="HelloPerson" description="${firstName}" />
>>>> </drop-down>
>>>> </field>
>>>> * <field use-when="helloPersonHobby!=null @and guestId!=null"
>>>>
>>>> name="guestId" entry-name="gender"><display-entity
>>>> entity-name="HelloPerson" description="${gender}"></
>>>> display-entity></field>*
>>>> * <field use-when="helloPersonHobby!=null @and guestId!=null"
>>>>
>>>> name="guestId" entry-name="guestId"><display-entity
>>>> entity-name="HelloPerson"
>>>> description="${firstName}"></display-entity></field>*
>>>>
>>>>
>>>>           <field name="hobbyId">
>>>> <drop-down>
>>>> <entity-options entity-name="HelloHobby" description="${description}" />
>>>> </drop-down>
>>>> </field>
>>>>           <field name="submitButton" use-when="helloPersonHobby==null"
>>>> title="${uiLabelMap.CommonCreate}"><submit
>>>> button-type="button"/></field>
>>>>           <field name="submitButton" use-when="helloPersonHobby!=null"
>>>> title="${uiLabelMap.CommonUpdate}"><submit
>>>> button-type="button"/></field>
>>>>       </form>
>>>>
>>>>
>>>> On Sat, Jan 25, 2014 at 10:33 PM, Christian Carlow <
>>>> [hidden email]> wrote:
>>>>
>>>>   Sorry Murali,
>>>>
>>>>> I think I'm mistaken.  Please post the entire form widget code.
>>>>>
>>>>>
>>>>> On 01/25/2014 10:30 AM, Christian Carlow wrote:
>>>>>
>>>>>   Hey Murali,
>>>>>
>>>>>> Seems like this is the problem:
>>>>>>
>>>>>> <field  name="guestId"  name="gender"
>>>>>> entry-name="guestId"><display-entity
>>>>>>
>>>>>> I think the form widget <display-entity> element is only supposed to
>>>>>> be
>>>>>> used for fields that are PKs.  Since gender is not a PK field, an
>>>>>> entity
>>>>>> cannot be found.  If gender is defined in the entity that is being
>>>>>> used
>>>>>> by
>>>>>> the form, then replacing <display-entity> with <display> seems like it
>>>>>> would resolve the problem by correctly displaying the gender of the
>>>>>> person.
>>>>>>
>>>>>> On 01/25/2014 10:14 AM, Murali Shankar Gopalakrishnan wrote:
>>>>>>
>>>>>>   <field  name="guestId"  name="gender"
>>>>>>
>>>>>>> entry-name="guestId"><display-entity
>>>>>>>
>>>>>>>
>>>>>>>
>
Reply | Threaded
Open this post in threaded view
|

Re: How do I the same field PK more than once on the form

muralis
Thanks Christian & Lei. That is exactly what I did.


On Thu, Jan 30, 2014 at 1:15 PM, Lei Wu <[hidden email]> wrote:

> Murali,
>
> Better to create a view-entity to join the two tables, so that you have all
> info you required.
>
>
> On Sun, Jan 26, 2014 at 2:58 AM, Christian Carlow <
> [hidden email]> wrote:
>
> > Hey Murali,
> >
> > In that case, the <display-entity> entity-name should be set to "Person"
> > instead of "HelloPerson" since it's the entity containing the gender
> field.
> >
> > Something like:
> >
> >
> > <field use-when="helloPersonHobby!=null @and guestId!=null"
> > name="gender" ><display-entity
> > entity-name="Person" description="${gender}"></
> > display-entity></field>*
> >
> >
> >
> >
> > On 01/25/2014 12:44 PM, Murali Shankar Gopalakrishnan wrote:
> >
> >> The Gender is a Field in the "Person" Entity.
> >>
> >> The HelloPersonHobby Entity just has two fields 1) PersonId 2) HobbyId.
> >> Both FKs the first one to HelloPerson Entity (that contains the field
> >> gender) and the second field FK to a entity called Hobby.
> >>
> >> So , in this context, where, I need to extract the data from a related
> >> entity (master table) and show multiple fields of the related table,
> >> during
> >> Create/Update of a transaction table is what I am trying to do.
> >>
> >> Appreciate some thoughts on how this can be modelled in a form widget. I
> >> am
> >> sure this is a common need, and I am also sure there should be some way.
> >>
> >> Thank you.
> >>
> >> Cheers
> >> murali
> >>
> >>
> >>
> >> On Sat, Jan 25, 2014 at 11:45 PM, Christian Carlow <
> >> [hidden email]> wrote:
> >>
> >>  Hey Murali,
> >>>
> >>> If gender is defined in HelloPersonHobby then as stated in my first
> >>> response, there is no need for <display-entity> so <display> should
> >>> replace
> >>> it.  Also, the name of the field should be changed to gender instead of
> >>> guestId.
> >>>
> >>>
> >>> On 01/25/2014 11:54 AM, Murali Shankar Gopalakrishnan wrote:
> >>>
> >>>  Here goes the Form Widget Christian. Have made the couple of elements
> in
> >>>> question in Bold.
> >>>>
> >>>>       <form name="EditPersonHobby" type="single"
> >>>> target="updatePersonhobby"
> >>>> title="Edit Person Hobby" default-map-name="helloPersonHobby"
> >>>> default-entity-name="HelloPersonHobby">
> >>>>             <alt-target use-when="helloPersonHobby==null"
> >>>> target="createPersonhobby?gender=${gender}"/>
> >>>>           <!--  <auto-fields-service
> service-name="updatePersonHobby"/>
> >>>>   -->
> >>>>
> >>>>           <field use-when="helloPersonHobby!=null" name="guestHobbyId"
> >>>> title="${uiLabelMap.PersonHobbyId}"
> >>>> tooltip="${uiLabelMap.CommonNotModifRecreat}"><display/></field>
> >>>>           <field use-when="helloPersonHobby==null @and
> >>>> guestHobbyId==null"
> >>>> name="guestHobbyId" title="${uiLabelMap.PersonId}"><ignored/></field>
> >>>>           <field use-when="helloPersonHobby==null @and
> >>>> guestHobbyId!=null"
> >>>> name="guestHobbyId" title="${uiLabelMap.PersonHobbyId}"><display
> >>>> description="${uiLabelMap.CommonCannotBeFound}: [${guestHobbyId}]"
> >>>> also-hidden="false"/></field>
> >>>>           <field use-when="helloPersonHobby==null @and guestId==null"
> >>>> name="guestId" title="${uiLabelMap.PersonName}">
> >>>>           <drop-down>
> >>>> <entity-options entity-name="HelloPerson" description="${firstName}"
> />
> >>>> </drop-down>
> >>>> </field>
> >>>> * <field use-when="helloPersonHobby!=null @and guestId!=null"
> >>>>
> >>>> name="guestId" entry-name="gender"><display-entity
> >>>> entity-name="HelloPerson" description="${gender}"></
> >>>> display-entity></field>*
> >>>> * <field use-when="helloPersonHobby!=null @and guestId!=null"
> >>>>
> >>>> name="guestId" entry-name="guestId"><display-entity
> >>>> entity-name="HelloPerson"
> >>>> description="${firstName}"></display-entity></field>*
> >>>>
> >>>>
> >>>>           <field name="hobbyId">
> >>>> <drop-down>
> >>>> <entity-options entity-name="HelloHobby" description="${description}"
> />
> >>>> </drop-down>
> >>>> </field>
> >>>>           <field name="submitButton" use-when="helloPersonHobby==null"
> >>>> title="${uiLabelMap.CommonCreate}"><submit
> >>>> button-type="button"/></field>
> >>>>           <field name="submitButton" use-when="helloPersonHobby!=null"
> >>>> title="${uiLabelMap.CommonUpdate}"><submit
> >>>> button-type="button"/></field>
> >>>>       </form>
> >>>>
> >>>>
> >>>> On Sat, Jan 25, 2014 at 10:33 PM, Christian Carlow <
> >>>> [hidden email]> wrote:
> >>>>
> >>>>   Sorry Murali,
> >>>>
> >>>>> I think I'm mistaken.  Please post the entire form widget code.
> >>>>>
> >>>>>
> >>>>> On 01/25/2014 10:30 AM, Christian Carlow wrote:
> >>>>>
> >>>>>   Hey Murali,
> >>>>>
> >>>>>> Seems like this is the problem:
> >>>>>>
> >>>>>> <field  name="guestId"  name="gender"
> >>>>>> entry-name="guestId"><display-entity
> >>>>>>
> >>>>>> I think the form widget <display-entity> element is only supposed to
> >>>>>> be
> >>>>>> used for fields that are PKs.  Since gender is not a PK field, an
> >>>>>> entity
> >>>>>> cannot be found.  If gender is defined in the entity that is being
> >>>>>> used
> >>>>>> by
> >>>>>> the form, then replacing <display-entity> with <display> seems like
> it
> >>>>>> would resolve the problem by correctly displaying the gender of the
> >>>>>> person.
> >>>>>>
> >>>>>> On 01/25/2014 10:14 AM, Murali Shankar Gopalakrishnan wrote:
> >>>>>>
> >>>>>>   <field  name="guestId"  name="gender"
> >>>>>>
> >>>>>>> entry-name="guestId"><display-entity
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >
>