This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Select multiple items in a form's field when Field Type = "Item"

arif - Tuesday, January 3, 2012 7:53 AM:

Hi Community, this is my first post.

I have just started with Aras Innovator. I can create new Item Types and can set my desired data-sources for fields in Forms.

Now I am fetching some a problem with "Field Type". There are a number of built-in field type provided by Aras like "Text", "Item", "Image" etc. If I select "Item" as "Field Type" it provides a textbox along with a button. When I create a new item instance of  the form containing the field (Field Type = Item Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 and Data Source is an item type) I am getting the textbox-button pair. The button allows me to select one single Item from a popup list and placing it in the textbox, but it is not allowing me to select multiple item. Textbox does not allow more than one item at a time.
Now I need to select more than one item from the list at a time. What should I do?
It would be great if anyone helps me.
Regards
Arif


vishal_trivedi - Tuesday, January 3, 2012 8:24 AM:

-- Create an Item type

-- Set this item type as poly item.

-- now in this item type assign multiple item type from which you want to select data and this can be done in the relationships tab of item type (ploy sources)

-- Assign this item type as a source instead of what you are assigning as a data source of item property.

 

Vishal



arif - Tuesday, January 3, 2012 11:35 PM:

Normal 0 false false false EN-US X-NONE X-NONE

Sorry Vishal, my question is not explaining clearly what I want to know. Actually I want to pick multiple item instances of same item type at a time not multiple item types.
Suppose I have created an Item Type,” Components” and crated five new item instances and there name properties are:

·         Wheel

·         Steering

·         Propeller

·         Radiator

·         Carburetor

 
Now I am crating a form “Car”, there are three fields in this form:

1.       1. Model (Field Type =  Text,  Data Source is a String type and desired value may be “Nano”)

2.       2. Price (Field Type = Text, Data Source is a String type and desired value may be “RS. 2,00,000”)

             3. Parts(Field Type = Item, Data Source = ” Components” and desired values may be “Wheel + Steering + Radiator )

 
I can easily peak either Wheel or Steering or Radiator but I cannot take all the three components at a time.


arif - Wednesday, January 4, 2012 1:06 AM:

Normal 0 false false false EN-US X-NONE X-NONE

Sorry Vishal, my question is not explaining clearly what I want to know. Actually I want to pick multiple item instances of same item type at a time not multiple item types.
Suppose I have created an Item Type,” Components” and crated five new item instances and there name properties are:

·         Wheel

·         Steering

·         Propeller

·         Radiator

·         Carburetor

 
Now I am crating a form “Car”, there are three fields in this form:

1.       Model (Field Type =  Text,  Data Source is a String type and desired value may be “Nano”)

2.       Price (Field Type = Text, Data Source is a String type and desired value may be “RS. 2,00,000”)

3.       Parts(Field Type = Item, Data Source = ” Components” and desired values may be “Wheel + Steering + Radiator )

 
I can easily peak either Wheel or Steering or Radiator but I cannot take all the three components at a time.


Nishant Kapoor - Monday, July 23, 2012 5:47 AM:

Hi Arif,

Can you please elobrate how you created the instances of Item Type, "Components"?

Nishant



pinakpatel - Wednesday, July 25, 2012 3:00 AM:

Dear Arif,

 

Accroding to statndard approach,

1> When you want to attach only one object of Item say"B" with another object of Item say "A" then, create Property "prop1" (Data type ="Item") in Item "A" and show it on Form Page.

2> When you want to attach more than one object of Item Say "B" with another Object of Item Say "A" then, create relationship between ItemType "A(Source_item)" and "B(related_item)".

 

Above approach is standard approach.

 

But, still if you want to follow your approach then try following solution,

 

1>Create list say "Component List".

2> Now, create one server side method which will iterate over all objects of 'Componenet' ItemType and add 'name(property)' of components into "Component List"

3> Add this method on "onAfterAdd" and "OnAfterDelete" event of ItemType="Component".

(So, values in "Component List" will be update on creation and deletion of "Component" object.)

4> Now, add this "Component" list into your Itemtype Say ="CAR" and change it's field type in Form to "Listbox Multi Select"

 

Then you will be able to select multiple Component into Form.

 

 

Thanks,

Pinak