on 03-22-2005 3:47 PM
Hello, the problem that i have is that I'm calling an RFC function that return a table with "n" elements in it, i would like to loop this table in the code, an generate dynamically labels and inputfields as the number of elements in the table, how could i do that, the only thing that i don't know how to do is the loop of the table brought by the function call.
please help. thank´s in advance
hi ,
Try this code.. i have tried to give as much details as possible.. if u dont get any just tell me i will explain abt it.
String id = wdContext.nodeLinkDetails().getLinkDetailsElementAt(i).getProjectid();
//We can use input field or dropdown by key here.
IWDInputField inp = (IWDInputField)view.createElement(IWDInputField.class,id);
// Now bind this with a simple type which is either dynamically created or availble in the context.
//call the value help function here..pass the binded simple type as argument
// And add the UI Element to a container or a group.
IWDGroup grp = (IWDGroup)view.getElement("Link");
grp.addChild(link);
}
VALUE HELP
// Now to create value help for elements
ISimpleTypeModifiable stmObj = ISimpleTypeModifiable)wdThis.wdGetAPI().getContext().getModifiableTypeOf(<name of the simple type passed>);
IModifiableSimpleValueSet valueSet =(IModifiableSimpleValueSet) stmObj.getSVServices().getModifiableSimpleValueSet();
int size = wdContext.node.nodeOutput().size();
for(int i=0;i<size;i++)
{
String id = wdContext.nodeOutput().getOutputElementAt(i).getMemeberid();
valueSet.put(id1,id1);
}
Regards,
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sheldon,
The following code may not be directly helps you but this is the way you store data in to a list and loop it
public void wdDoInit()
{
//@@begin wdDoInit()
view_Response r = new view_Response();
String po_ref = r.main();
wdContext.currentContextElement().setPO_Ref(po_ref);
cal = r.getDate();
wdContext.currentContextElement().setDate((cal.get(Calendar.MONTH)1)"/"cal.get(Calendar.DATE)"/"+cal.get(Calendar.YEAR));
List l = r.getItem();
int No_Of_Rows = l.size();
for(int i=0 ; i< No_Of_Rows ; i++)
{
POAsASNType.LineItemsType.ItemType item = (POAsASNType.LineItemsType.ItemType)l.get(i);
IPrivateAdvanceShipView.ILine_ItemsElement table = wdContext.createLine_ItemsElement();
table.setItemCode(item.getItemCode().intValue());
table.setItemDescription(item.getItemDescription());
table.setMaterialNo(item.getMaterialNo());
table.setQuantityRequired(item.getQuantityRequired());
table.setSerialNo(item.getSerialNo().intValue());
wdContext.nodeLine_Items().addElement(table);
}
//@@end
}
Hope this helps you
Regards,
RK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anilkumar,
about your questions:
Let us say you have 3 columns in the table. You want to create 3 labels and 3 inputfields for that.Am i right ?
the thing really is that i have two tables:
- One whit code and definition of different elements, the definition is the text that i´m going to assign to the different labels that ill create dynamically;
- The second table has values for those different element of the first table, so its like creating dropDownListBoxes, the thing is that depending on the drop Down im creating i have to pass it different information. i.e.
TABLE 1
code definition
SU Sweater
JA Jacket
SH Shoes
TABLE 2
code SIZE USED
SU XL
SU S X
SU M
JA XXL
JA XL X
SH M
SH S
SH L X
Are you looking for complete code ??
yes please.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sheldon,
Incase if you are looking for code for entering values dynamically into a dropdown the it is as follows.
IWDAttributeInfo info(info of the dropdwon key attribute)
ISimpleTypeModifiable st=info.getModifiableSimpleType()
IModifiableSimpleValueSet vs=st.getSVServices().getModifiableSimpleValueSet()
vs.put(value,text);
regards
Noufal
Hi,
Looping through the table is nothing but looping through the context.
So first iterate through the context and in the loop generate the UIElements dynamically .
I have one question : Let us say you have 3 columns in the table. You want to create 3 lables and 3 inputfields for that.Am i right ? In that case no need to Iterate thought the context.Depending upon the Context attributes you can generate the UIElements.
Are you looking for complete code ??
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.