alfredo_verolin Absent Member.
Absent Member.
425 views

Re: How to get the Display Expression in a Form


Hi all,

I’ve the same problem. I tried to fixed it with the solution suggested
by Wolfgang: it works on firefox but it doesn’t work on iexplorer. My
Display expression is a concatenate of a custom attribute and the
nrfLocalizedNames attribute. Both of these attributes are in the DAL of
the nrfRole Entity.
When I use iexplorer the following expression

var field_dis = field.getAllValues()[1]; // get all display values

returns the cn of the role instead of the display expression.
Do you have any suggestions on how to solve this problem in iexplorer?

thanks
alfredo


--
alfredo_verolino
------------------------------------------------------------------------
alfredo_verolino's Profile: http://forums.novell.com/member.php?userid=38475
View this thread: http://forums.novell.com/showthread.php?t=389277

Labels (1)
0 Likes
6 Replies
Anonymous_User Absent Member.
Absent Member.

Re: How to get the Display Expression in a Form

Hi Alfredo,

to get the displayed info you can probably get the values with some
direct DOM script calls (like getElementByID) and retrieve the
node.options.value vs .text

Or use jquery to achieve the same.


Wolfgang



On 09.12.2011 17:56, alfredo verolino wrote:
>
> Hi all,
>
> I�ve the same problem. I tried to fixed it with the solution suggested
> by Wolfgang: it works on firefox but it doesn�t work on iexplorer. My
> Display expression is a concatenate of a custom attribute and the
> nrfLocalizedNames attribute. Both of these attributes are in the DAL of
> the nrfRole Entity.
> When I use iexplorer the following expression
>
> var field_dis = field.getAllValues()[1]; // get all display values
>
> returns the cn of the role instead of the display expression.
> Do you have any suggestions on how to solve this problem in iexplorer?
>
> thanks
> alfredo
>
>

0 Likes
ffrazzano Absent Member.
Absent Member.

Re: How to get the Display Expression in a Form


Hi Wolfgang,
I tried to get the values with the script call “getElementByID” as you
suggested:

var Roles=document.getElementById("_fldAllRolesHidden");
Roles.options.value //returns the dn
Roles.options.text //returns the cn in iexplorer and the correct
display expression in firefox

The field “fldAllRolesHidden” is populated by a query so, for debugging
purpose, I’ve added an alert after the query which shows the array
returned
The alert in iexplorer contains the CNs instead in firefox it contains
the display expressions.
It seems that IE stores the result of the query in a different way than
firefox.
Do you have any suggestions?

Thanks in advance

Francesca



Wolfgang Schreiber;2160089 Wrote:
> Hi Alfredo,
>
> to get the displayed info you can probably get the values with some
> direct DOM script calls (like getElementByID) and retrieve the
> node.options.value vs .text
>
> Or use jquery to achieve the same.
>
>
> Wolfgang
>
>
>
> On 09.12.2011 17:56, alfredo verolino wrote:
> >
> > Hi all,
> >
> > I�ve the same problem. I tried to fixed it with the solution

> suggested
> > by Wolfgang: it works on firefox but it doesn�t work on iexplorer.

> My
> > Display expression is a concatenate of a custom attribute and the
> > nrfLocalizedNames attribute. Both of these attributes are in the DAL

> of
> > the nrfRole Entity.
> > When I use iexplorer the following expression
> >
> > var field_dis = field.getAllValues()[1]; // get all display values
> >
> > returns the cn of the role instead of the display expression.
> > Do you have any suggestions on how to solve this problem in

> iexplorer?
> >
> > thanks
> > alfredo
> >
> >



--
ffrazzano
------------------------------------------------------------------------
ffrazzano's Profile: http://forums.novell.com/member.php?userid=121111
View this thread: http://forums.novell.com/showthread.php?t=389277

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: How to get the Display Expression in a Form

Hi Francesca,

just did a quick test on IE9 and FF8 without seeing a difference.

For testing I'm using a picklist filled with a query. In an onchange
event on the list I'm using this code:


var list_all = field.getAllValues();
if ( list_all.length == 2 )
{
var list_value = field.getValue();
var list_disp = "";
for ( var i=0; i<list_all[0].length; i++ )
{
if ( list_all[0] == list_value )
{
list_disp = list_all[1];
break;
}
}
if ( list_value != undefined )
{
alert( "DN=" + list_value + "/Display=" + list_disp );
}
}


This will correctly display the DN and display value.

NB: if you are running some function during onload, the display values
may not yet be calculated and filled in; depending on the number of
objects this may take a little time.


Wolfgang



On 12.12.2011 19:26, ffrazzano wrote:
>
> Hi Wolfgang,
> I tried to get the values with the script call �getElementByID� as you
> suggested:
>
> var Roles=document.getElementById("_fldAllRolesHidden");
> Roles.options.value //returns the dn
> Roles.options.text //returns the cn in iexplorer and the correct
> display expression in firefox
>
> The field �fldAllRolesHidden� is populated by a query so, for debugging
> purpose, I�ve added an alert after the query which shows the array
> returned
> The alert in iexplorer contains the CNs instead in firefox it contains
> the display expressions.
> It seems that IE stores the result of the query in a different way than
> firefox.
> Do you have any suggestions?
>
> Thanks in advance
>
> Francesca
>
>
>
> Wolfgang Schreiber;2160089 Wrote:
>> Hi Alfredo,
>>
>> to get the displayed info you can probably get the values with some
>> direct DOM script calls (like getElementByID) and retrieve the
>> node.options.value vs .text
>>
>> Or use jquery to achieve the same.
>>
>>
>> Wolfgang
>>
>>
>>
>> On 09.12.2011 17:56, alfredo verolino wrote:
>>>
>>> Hi all,
>>>
>>> I�ve the same problem. I tried to fixed it with the solution

>> suggested
>>> by Wolfgang: it works on firefox but it doesn�t work on iexplorer.

>> My
>>> Display expression is a concatenate of a custom attribute and the
>>> nrfLocalizedNames attribute. Both of these attributes are in the DAL

>> of
>>> the nrfRole Entity.
>>> When I use iexplorer the following expression
>>>
>>> var field_dis = field.getAllValues()[1]; // get all display values
>>>
>>> returns the cn of the role instead of the display expression.
>>> Do you have any suggestions on how to solve this problem in

>> iexplorer?
>>>
>>> thanks
>>> alfredo
>>>
>>>

>
>

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: How to get the Display Expression in a Form

On 12/13/2011 04:39 PM, Wolfgang Schreiber wrote:
> Hi Francesca,
>
> just did a quick test on IE9 and FF8 without seeing a difference.
>
> For testing I'm using a picklist filled with a query. In an onchange
> event on the list I'm using this code:
>
>
> var list_all = field.getAllValues();
> if ( list_all.length == 2 )
> {
> var list_value = field.getValue();
> var list_disp = "";
> for ( var i=0; i<list_all[0].length; i++ )
> {
> if ( list_all[0] == list_value )
> {
> list_disp = list_all[1];
> break;
> }
> }
> if ( list_value != undefined )
> {
> alert( "DN=" + list_value + "/Display=" + list_disp );
> }
> }
>
>
> This will correctly display the DN and display value.
>
> NB: if you are running some function during onload, the display values
> may not yet be calculated and filled in; depending on the number of
> objects this may take a little time.
>
>
> Wolfgang
>
>
>
> On 12.12.2011 19:26, ffrazzano wrote:
>>
>> Hi Wolfgang,
>> I tried to get the values with the script call �getElementByID� as you
>> suggested:
>>
>> var Roles=document.getElementById("_fldAllRolesHidden");
>> Roles.options.value //returns the dn
>> Roles.options.text //returns the cn in iexplorer and the correct
>> display expression in firefox
>>
>> The field �fldAllRolesHidden� is populated by a query so, for debugging
>> purpose, I�ve added an alert after the query which shows the array
>> returned
>> The alert in iexplorer contains the CNs instead in firefox it contains
>> the display expressions.
>> It seems that IE stores the result of the query in a different way than
>> firefox.
>> Do you have any suggestions?
>>
>> Thanks in advance
>>
>> Francesca
>>
>>
>>
>> Wolfgang Schreiber;2160089 Wrote:
>>> Hi Alfredo,
>>>
>>> to get the displayed info you can probably get the values with some
>>> direct DOM script calls (like getElementByID) and retrieve the
>>> node.options.value vs .text
>>>
>>> Or use jquery to achieve the same.
>>>
>>>
>>> Wolfgang
>>>
>>>
>>>
>>> On 09.12.2011 17:56, alfredo verolino wrote:
>>>>
>>>> Hi all,
>>>>
>>>> I�ve the same problem. I tried to fixed it with the solution
>>> suggested
>>>> by Wolfgang: it works on firefox but it doesn�t work on iexplorer.
>>> My
>>>> Display expression is a concatenate of a custom attribute and the
>>>> nrfLocalizedNames attribute. Both of these attributes are in the DAL
>>> of
>>>> the nrfRole Entity.
>>>> When I use iexplorer the following expression
>>>>
>>>> var field_dis = field.getAllValues()[1]; // get all display values
>>>>
>>>> returns the cn of the role instead of the display expression.
>>>> Do you have any suggestions on how to solve this problem in
>>> iexplorer?
>>>>
>>>> thanks
>>>> alfredo
>>>>
>>>>

>>
>>

Greetings,
A difference can also be seen when using the onload events if you
have not actually claimed the form. Meaning, if you have code that is
going to set a certain display value in a Picklist, in the "unclaimed"
state you can see the DNs and then when you claim the form you see the
CN (or the value you outlined). This is expected since in the unclaimed
state you do not own the form yet.

--
Sincerely,
Steven Williams
Lead Software Engineer
NetIQ
0 Likes
ffrazzano Absent Member.
Absent Member.

Re: How to get the Display Expression in a Form


Hi Wolfgang,
today I tried to move the function after other functions and it seemed
to work but, when I removed the alert message used for debugging it
didn't work anymore.
I red on google that a lot of people have the same problem, but the
solutions suggested don't solve my problem.
I used :
- the function setTimeout()
- a custom function

function pausecomp(millis)
{
var date = new Date();
var curDate = null;
do
{
curDate = new Date();
}
while(curDate-date < millis);
}

and other solutions suggested.
Do you have other suggestions?
There is a function that let me know when the field is completely
filled?

Thanks a lot,
Francesca

Wolfgang Schreiber;2160892 Wrote:
> Hi Francesca,
>
> just did a quick test on IE9 and FF8 without seeing a difference.
>
> For testing I'm using a picklist filled with a query. In an onchange
> event on the list I'm using this code:
>
>
> var list_all = field.getAllValues();
> if ( list_all.length == 2 )
> {
> var list_value = field.getValue();
> var list_disp = "";
> for ( var i=0; i<list_all[0].length; i++ )
> {
> if ( list_all[0] == list_value )
> {
> list_disp = list_all[1];
> break;
> }
> }
> if ( list_value != undefined )
> {
> alert( "DN=" + list_value + "/Display=" + list_disp );
> }
> }
>
>
> This will correctly display the DN and display value.
>
> NB: if you are running some function during onload, the display values
> may not yet be calculated and filled in; depending on the number of
> objects this may take a little time.
>
>
> Wolfgang
>
>
>
> On 12.12.2011 19:26, ffrazzano wrote:
> >
> > Hi Wolfgang,
> > I tried to get the values with the script call �getElementByID�

> as you
> > suggested:
> >
> > var Roles=document.getElementById("_fldAllRolesHidden");
> > Roles.options.value //returns the dn
> > Roles.options.text //returns the cn in iexplorer and the correct
> > display expression in firefox
> >
> > The field �fldAllRolesHidden� is populated by a query so, for

> debugging
> > purpose, I�ve added an alert after the query which shows the array
> > returned
> > The alert in iexplorer contains the CNs instead in firefox it

> contains
> > the display expressions.
> > It seems that IE stores the result of the query in a different way

> than
> > firefox.
> > Do you have any suggestions?
> >
> > Thanks in advance
> >
> > Francesca
> >
> >
> >
> > Wolfgang Schreiber;2160089 Wrote:
> >> Hi Alfredo,
> >>
> >> to get the displayed info you can probably get the values with some
> >> direct DOM script calls (like getElementByID) and retrieve the
> >> node.options.value vs .text
> >>
> >> Or use jquery to achieve the same.
> >>
> >>
> >> Wolfgang
> >>
> >>
> >>
> >> On 09.12.2011 17:56, alfredo verolino wrote:
> >>>
> >>> Hi all,
> >>>
> >>> I�ve the same problem. I tried to fixed it with the solution
> >> suggested
> >>> by Wolfgang: it works on firefox but it doesn�t work on

> iexplorer.
> >> My
> >>> Display expression is a concatenate of a custom attribute and the
> >>> nrfLocalizedNames attribute. Both of these attributes are in the

> DAL
> >> of
> >>> the nrfRole Entity.
> >>> When I use iexplorer the following expression
> >>>
> >>> var field_dis = field.getAllValues()[1]; // get all display values
> >>>
> >>> returns the cn of the role instead of the display expression.
> >>> Do you have any suggestions on how to solve this problem in
> >> iexplorer?
> >>>
> >>> thanks
> >>> alfredo
> >>>
> >>>

> >
> >



--
ffrazzano
------------------------------------------------------------------------
ffrazzano's Profile: http://forums.novell.com/member.php?userid=121111
View this thread: http://forums.novell.com/showthread.php?t=389277

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: How to get the Display Expression in a Form

Hi Francesca,

your observation confirms my suspicion that we have a timing issue. As
you indicated, the onload/onchange events may be triggered when the list
is filled with DNs; however the display data are filled asynchronously.
This process may (dependent on edir/network/browser speed, the number of
objects, and the complexity of the display expression) take some
significant time.

In other form fields we may see a "Resolving ..." message.

I'd love to see a custom event triggered by UserApp when this process is
complete, and you may suggest an enhancement request. (Steven is
listening) since I'm not aware of an easy to use alternative.

As you indicated, you may add some custom code using ECMAscript
functions like setTimeout()/setInterval()

You might use such functions to create a polling loop that checks the
(first and last) objects in your list and compare with the expected
display expression. There cannot be a generic function for that, since
in some setups, 'CN' may be a desired display expression.


Good luck

Wolfgang





On 14.12.2011 21:06, ffrazzano wrote:
>
> Hi Wolfgang,
> today I tried to move the function after other functions and it seemed
> to work but, when I removed the alert message used for debugging it
> didn't work anymore.
> I red on google that a lot of people have the same problem, but the
> solutions suggested don't solve my problem.
> I used :
> - the function setTimeout()
> - a custom function
>
> function pausecomp(millis)
> {
> var date = new Date();
> var curDate = null;
> do
> {
> curDate = new Date();
> }
> while(curDate-date< millis);
> }
>
> and other solutions suggested.
> Do you have other suggestions?
> There is a function that let me know when the field is completely
> filled?
>
> Thanks a lot,
> Francesca
>
> Wolfgang Schreiber;2160892 Wrote:
>> Hi Francesca,
>>
>> just did a quick test on IE9 and FF8 without seeing a difference.
>>
>> For testing I'm using a picklist filled with a query. In an onchange
>> event on the list I'm using this code:
>>
>>
>> var list_all = field.getAllValues();
>> if ( list_all.length == 2 )
>> {
>> var list_value = field.getValue();
>> var list_disp = "";
>> for ( var i=0; i<list_all[0].length; i++ )
>> {
>> if ( list_all[0] == list_value )
>> {
>> list_disp = list_all[1];
>> break;
>> }
>> }
>> if ( list_value != undefined )
>> {
>> alert( "DN=" + list_value + "/Display=" + list_disp );
>> }
>> }
>>
>>
>> This will correctly display the DN and display value.
>>
>> NB: if you are running some function during onload, the display values
>> may not yet be calculated and filled in; depending on the number of
>> objects this may take a little time.
>>
>>
>> Wolfgang
>>
>>
>>
>> On 12.12.2011 19:26, ffrazzano wrote:
>>>
>>> Hi Wolfgang,
>>> I tried to get the values with the script call �getElementByID�

>> as you
>>> suggested:
>>>
>>> var Roles=document.getElementById("_fldAllRolesHidden");
>>> Roles.options.value //returns the dn
>>> Roles.options.text //returns the cn in iexplorer and the correct
>>> display expression in firefox
>>>
>>> The field �fldAllRolesHidden� is populated by a query so, for

>> debugging
>>> purpose, I�ve added an alert after the query which shows the array
>>> returned
>>> The alert in iexplorer contains the CNs instead in firefox it

>> contains
>>> the display expressions.
>>> It seems that IE stores the result of the query in a different way

>> than
>>> firefox.
>>> Do you have any suggestions?
>>>
>>> Thanks in advance
>>>
>>> Francesca
>>>
>>>
>>>
>>> Wolfgang Schreiber;2160089 Wrote:
>>>> Hi Alfredo,
>>>>
>>>> to get the displayed info you can probably get the values with some
>>>> direct DOM script calls (like getElementByID) and retrieve the
>>>> node.options.value vs .text
>>>>
>>>> Or use jquery to achieve the same.
>>>>
>>>>
>>>> Wolfgang
>>>>
>>>>
>>>>
>>>> On 09.12.2011 17:56, alfredo verolino wrote:
>>>>>
>>>>> Hi all,
>>>>>
>>>>> I�ve the same problem. I tried to fixed it with the solution
>>>> suggested
>>>>> by Wolfgang: it works on firefox but it doesn�t work on

>> iexplorer.
>>>> My
>>>>> Display expression is a concatenate of a custom attribute and the
>>>>> nrfLocalizedNames attribute. Both of these attributes are in the

>> DAL
>>>> of
>>>>> the nrfRole Entity.
>>>>> When I use iexplorer the following expression
>>>>>
>>>>> var field_dis = field.getAllValues()[1]; // get all display values
>>>>>
>>>>> returns the cn of the role instead of the display expression.
>>>>> Do you have any suggestions on how to solve this problem in
>>>> iexplorer?
>>>>>
>>>>> thanks
>>>>> alfredo
>>>>>
>>>>>
>>>
>>>

>
>

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.