on 09-30-2009 1:09 PM
Hello,
Here is my issue :
I have a dropdown with values that are dynamically defined from SAP through the interface. The table for the interface is defined like this :
MATNR MAKTX CATEGORY
123456 material 1 8
646788 material 2 3
689865 material 3 4
I would like to show a popup if the category of the material is 4.
In the event "change" of the dropdown, I would like to get the category from the table but I don't know how to do that.
I know that I can get the value of maktx with xfa.event.prevText but I would prefer get the matnr value. And then I don't know how to read the table to get the category.
Please help me ! thanks in advance.
//Javascript! Data is stored in Table MATTAB
// MATNR is source Field, CAT is target field
//get the value -->
var selection = this.boundItem(xfa.event.newText);
//then search in the table mattab (dataview --> table MATTAB, repeating node DATA,Colums matnr, maktx, category) -->
var nodMatnr = xfa.resolveNodes("xfa.record.MATTAB.DATA[*].matnr");
var nodCat = xfa.resolveNodes("xfa.record.MATTAB.DATA[*].category");
//target Fieldname in Form = MAKTX in same subform
for ( var i = 0; i < nodMatnr.length; i++ ){
if (nodMatnr.item(i).value == selection){
CAT.rawValue = nodCat.item(i).value);
} //if
} //for
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The API works in following manner:-
xfa.host.messageBox("message", icon, buttons)
method where the icon parameter is 0 (error) to 3 (status) and the buttons parameter is 0 (OK), 1 (OK, cancel), 2 (yes, no), 3 (yes, no, cancel).
So write
xfa.host.messageBox(""+nodMatnr.length, 2, 2);
Chintan
Edited by: Chintan Virani on Oct 7, 2009 3:23 PM
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.