cancel
Showing results for 
Search instead for 
Did you mean: 

select a cell value from a iGrid and then pass to an dropbox

Former Member
0 Kudos

hello to all, i know that to catch a value of a grid i have to do something like this:

var areadesc = document.grd_ScrapList.getGridObject().getSelectedCellValue(2);

but it is possible to pass this value to a dropbox??...i want to do like this...the user have a grid, selects a line in Grid, the values of Grid passes to the corresponding dropboxes, the user corrects what is wrong and then press a button to do the Update..

one more thing: how i know the user of the system...

regards

Mário

Accepted Solutions (1)

Accepted Solutions (1)

sidnooradarsh
Contributor
0 Kudos

Hi Mario,

one more thing: how i know the user of the system...

Assuming that you are using an IRPT screen, then you can use MII session variable "IllumLoginName" via applet to get user name logged into MII.

Say that you have any applet called "MyApplet" ( any applet)

Then use below piece of code to fetch user name

var UserName = document.MyApplet.getPropertyValue("IllumLoginName");

Regards,

Adarsh

Former Member
0 Kudos

Adarsh,

you can retrieve the session property "IllumLoginName" using the getPropertyValue function not only in an IRPT page, but also in a HTML page. You only need to have an applet on the page to be able to use the applet function getPropertyValue.

The IRPT page enables you to let MII interpret properties in brackets "{}" like "" as a session property or "{##BUTTON}" as a localization property. However, this bracket notation only works outside of Javascript.

If you want to use those values in Javascript, you can also use something like this:


<input type="hidden" id="id_Button" name="name_Button"  value="{##BUTTON}" />

// get value
var btn_name = document.getElementById('id_Button').value

Michael

sidnooradarsh
Contributor
0 Kudos

Hi Michael,

I was in assumption that "getPropertyValue" and "setPropertyValue" works only with IRPT screens.

Thanks for correcting my assumption I will make a note of it going ahead.

Regards,

Adarsh

Answers (3)

Answers (3)

Former Member
0 Kudos

thanks for the help

regards

Former Member
0 Kudos

Mario,

Are you going to use iBrowser as drop down or the normal HTML Drop Down.

If using iBrowser 'Drop-Down List Mode', thn update the table/xml and refresh the iBrowser.

If you are using HTML Drop down, use some code as below...

function cmdAddDropDownValue()

{

var form = document.myForm;

var insertAtIndex = form.myDropDown.selectedIndex + 1;

var optionText = areadesc ;

var optionValue = areadesc ;

var optionsArray = form.myDropDown.options;

addOption(optionsArray, insertAtIndex, optionText, optionValue);

}

function addOption(optionsArray, insertAtIndex, optionText, optionValue)

{

var indexCounter = optionsArray.length;

optionsArray[indexCounter] = new Option();

for (; indexCounter >= insertAtIndex; indexCounter--)

{

optionsArray[indexCounter].text = optionsArray[indexCounter - 1].text;

optionsArray[indexCounter].value = optionsArray[indexCounter -1].value;

optionsArray[indexCounter].defaultSelected = optionsArray[indexCounter - 1].defaultSelected;

}

var myNewOption = new Option(optionText,optionValue);

optionsArray[insertAtIndex] = myNewOption;

}

Hope this helps...

Regards

Muzammil

Former Member
0 Kudos

[http://www.w3schools.com/JS/default.asp|http://www.w3schools.com/JS/default.asp]