JSON arrays vs. properties
I'm finding that a JSON response from Raylight may or may not be an array depending on whether there are multiple items. For example, a WebI doc with multiple reports will produce this:
"reports": {
"report": [
"id": 2,
"name": "Report 1",
"reference": "2.RS",
"showDataChanges": false
"id": 1,
"name": "Report 2",
"reference": "1.RS",
"showDataChanges": false
Whereas if there is only one report tab, the result is:
"reports": {
"report": {
"id": 2,
"name": "Report 1",
"reference": "2.RS",
"showDataChanges": false
This is a problem, since the report property must be accessed differently. With JQuery, if "report" is an array, I can access the individual reports with:
$.each(json.reports.report,function() { $(this).id });
But the code doesn't work if there is only one report -- it returns the properties of the "report" property instead of report itself. Instead, I have to do:
json.reports.report.id
So, is there any code that can access the "report" properties whether or not it's an array?
When we have arrays in java, why did they provide
arraylist? What is the basic advantage of ArrayList
over Array?
Thanks in advanceLook at the API that would answer your question. All the functionality available for Arraylist is it available for arrays as well.
It is very similar to asking why have String class when you can have an array of chars.
Sun is just trying to make your life easy
Similar Messages
-
Revision: 12788
Revision: 12788
Author: [email protected]
Date: 2009-12-10 07:46:54 -0800 (Thu, 10 Dec 2009)
Log Message:
By popular demand, we now allow for empty child property tags for Array type properties. Coerced to empty array '[]'.
QE notes: None
Doc notes: None
Bugs: SDK-24500
Reviewer: Paul
Tests run: Checkin
Is noteworthy for integration: No
Ticket Links:
http://bugs.adobe.com/jira/browse/SDK-24500
Modified Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/AbstractBuilder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ComponentBuilder.jav aHi John,
Sorry to tell but tab completion is still failing on my Windows XP/Indesign CS5 (caught by Indesign).
I just saw your remark on coloring text, here is an example pulled out from Peter's book "ScriptUI for dummies":
var w = new Window ("dialog");
var s = w.add ("statictext", undefined, "Static");
var e = w.add ("edittext", undefined, "Edit");
var b = w.add ("button", undefined, "Button");
// The window's backround
w.graphics.backgroundColor = w.graphics.newBrush (w.graphics.BrushType.SOLID_COLOR, [0.5, 0.0, 0.0]);
// Font and its colour for the first item, statictext
s.graphics.font = ScriptUI.newFont ("Helvetica", "Bold", 30);
s.graphics.foregroundColor = s.graphics.newPen (w.graphics.PenType.SOLID_COLOR, [0.7, 0.7, 0.7], 1);
// Font and colours for the second item, edittext
e.graphics.font = ScriptUI.newFont ("Letter Gothic Std", "Bold", 30);
e.graphics.foregroundColor = e.graphics.newPen (e.graphics.PenType.SOLID_COLOR, [1, 0, 0], 1);
e.graphics.backgroundColor = e.graphics.newBrush (e.graphics.BrushType.SOLID_COLOR, [0.5, 0.5, 0.5]);
// Font for the tird control, a button. Can't set colours in buttons
b.graphics.font = ScriptUI.newFont ("Minion Pro", "Italic", 30);
w.show ();
Loic -
http://krisrice.blogspot.com/2013/02/restful-templates-and-binds.html
Kris's blog post above describes how to use binds in RESTful templates in ORDS. The last part says that when a simple JSON string is POSTed to the template, it is automatically converted into bind variables for the PL/SQL to use.
Question: If we need to supply a complex dataset to the POST handler (e.g. say a web form with both scalar values and multiple nested values), I was wondering if it also accomodates a JSON array e.g.
{"collection_id":"1234",
"members":
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter", "lastName":"Jones"}
If so, any ideas on how to support this? Of course, the underlying PL/SQL code needs to accept arrays as input parameters.
Any thoughts, examples, ideas much appreciated. ThanksYou will have to use something like PL/JSON to parse the text programatically. It's found here https://github.com/pljson/pljson
They have a bunch of examples as part of the library here : https://github.com/pljson/pljson/tree/master/examples
-kris -
WLST define array in properties file and access in WLST
Hi Guys,
Just had a question, I am developing WLST script to configure WebLogic manage server instances and want to do in much way that user need to update properties file and then WLST/python reads it and logic in the script will configure # of manage server instances specified in properties file..
properties.txt:
mserver = ['MS1','MS2','Ms3'] ## define array in properties file
WLST.py ( i am having trouble reading array from properties.txt)
from jarray import array
load('properties.txt') # load the properties file in script
Is there standard way I can read array from the file the way we do normal variable.. or any new suggestions will highly be welcomed?
Regards..You don't have to define you parameter as an array (a=['one'],['two'], etc) at the properties file. I think that this is a good way to do what you want:
file.prop file >
var=one two threewlst file >
loadProperties('file.prop')
sepVar=String(var).split(" ")
for i in sepVar:
print "- Separated var: " + iIt should print something like
- Separated var: one
- Separated var: two
- Separated var: threeEdited by: 904641 on Mar 29, 2012 2:38 PM -
Transforming ABAP internal table to JSON array (rather than object)
Is there an easy way to do this using the standard CALL TRANSFORMATION? Here's what I'm doing:
"ABAP to JSON
writer = cl_sxml_string_writer=>create( type = if_sxml=>co_xt_json ).
CALL TRANSFORMATION id SOURCE ARRAY = lt_table
RESULT XML writer.
lv_json = writer->get_output( ).
Now this generates JSON with an object named ARRAY in the proper format with sub-objects... but I don't want an object named ARRAY, I just want an unnamed array.
I searched through the documentation, the asJSON documentation seems to imply this should be possible, but doesn't specify any way to accomplish such a thing. Leaving the name blank just generates an error.
Tried a few transformation OPTIONS as well, but none of them seem to accomplish this.
It's not a huge deal to use an object instead (although we're trying to squeeze every microsecond of performance out of this call), or even to just write my own darn transformation, but I guess I'm surprised SAP doesn't seem to support this functionality with CALL TRANSFORMATION. Am I missing something? Please tell me I'm missing somethingI honestly can't remember why I asked this question (I think I was just confused about why the object needed a name but that turned out to not really be a problem), but here's what I ended up doing, in case it's helpful:
EDIT: I noticed above someone asked about uppercasing the JSON -- I also had to do this because the REST service I was calling required it. You can see below I actually convert back to string to do this, though there may be a more elegant solution.
*for call to cl_http_client=>create_by_destination
constants: lc_dest TYPE rfcdest value 'MILEMAKER'.
*local structures for handling input/output
DATA: ls_postal_dist type ZST_POSTAL_DIST,
ls_postal_conv type ZST_POSTAL_DIST,
lt_postal_conv type ZTT_POSTAL_DIST,
*for call to cl_http_client=>create_by_destination
lo_CLIENT type ref to IF_HTTP_CLIENT,
ls_RANDMCNALLY_JSON type ZST_RANDMCNALLY_JSON,
lt_RANDMCNALLY_JSON type table of ZST_RANDMCNALLY_JSON,
lv_HTTP_REASON type string,
lv_HTTP_CODE type i,
*JSON conversion
lo_writer TYPE REF TO cl_sxml_string_writer,
lv_json_in TYPE xstring,
lv_json_out TYPE xstring,
lv_json_string type string,
lo_conv type ref to CL_ABAP_CONV_IN_CE,
lo_conv2 type ref to CL_ABAP_CONV_OUT_CE,
*return parameters and error handlers
lo_cxroot TYPE REF TO cx_root,
lv_message type string,
lv_PAR1 LIKE SY-MSGV1,
lv_PAR2 LIKE SY-MSGV2,
lv_PAR3 LIKE SY-MSGV3,
ls_return type bapiret2. "return structure
[snip]
*set request parameters
CALL METHOD lo_client->request->SET_CONTENT_TYPE('application/json').
CALL METHOD lo_client->request->SET_METHOD('POST').
*convert data to JSON
lo_writer = cl_sxml_string_writer=>create( type = if_sxml=>co_xt_json ).
CALL TRANSFORMATION id SOURCE routes = lt_RANDMCNALLY_JSON initial_components = 'suppress' RESULT XML lo_writer.
lv_json_in = lo_writer->get_output( ).
*attach data to body
CALL METHOD lo_client->request->SET_DATA
EXPORTING
data = lv_json_in.
*get JSON text in string format for testing
CALL METHOD CL_ABAP_CONV_IN_CE=>CREATE
EXPORTING
INPUT = lv_json_in
ENCODING = 'UTF-8'
REPLACEMENT = '?'
IGNORE_CERR = ABAP_TRUE
RECEIVING
CONV = lo_conv.
CALL METHOD lo_conv->READ
IMPORTING
DATA = lv_json_string.
*send HTTP POST call to RandMcNally webservice
call method lo_client->send
* exporting timeout = lc_timeout
exceptions http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
others = 4.
if sy-subrc <> 0.
CALL METHOD lo_client->get_last_error
IMPORTING
message = lv_message.
CONCATENATE 'HTTP POST:' lv_message into lv_message.
move lv_message to ls_return-message.
append ls_return to return.
endif.
*receive data back
CALL METHOD lo_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
others = 4.
*pass errors back, if any
if sy-subrc <> 0.
clear ls_return.
ls_return-type = 'E'.
CALL METHOD lo_client->get_last_error
IMPORTING
message = lv_message.
move sy-subrc to lv_json_string.
CONCATENATE 'RECEIVE DATA:' lv_json_string lv_message into ls_return-message SEPARATED BY space.
append ls_return to return.
endif.
*get the data (a table in JSON format) from response object
clear lv_json_out.
lv_json_out = lo_client->response->GET_DATA( ).
*get the status of the response
CALL METHOD lo_client->response->GET_STATUS
IMPORTING
CODE = lv_HTTP_CODE
REASON = lv_HTTP_REASON.
*if response status code not 200 (OK), return error and cease processing
if lv_http_code <> '200'.
clear ls_return.
ls_return-type = 'E'.
move lv_http_code to lv_json_string.
CONCATENATE 'GET STATUS:' lv_json_string lv_HTTP_REASON into ls_return-message SEPARATED BY space.
append ls_return to return.
ENDIF.
catch cx_root into lo_cxroot.
cleanup.
ls_return-message = lo_cxroot->get_text( ).
append ls_return to return.
endtry.
*close channel
CALL METHOD lo_client->close
EXCEPTIONS
http_invalid_state = 1
others = 2.
*trying to process after error sometimes results in short dump because lv_json_out contains something other than JSON
if ls_return is not initial.
return.
endif.
if lv_json_out is not initial.
*convert JSON to string and make it UPPERCASE so that SAP can do transformation
CALL METHOD CL_ABAP_CONV_IN_CE=>CREATE
EXPORTING
INPUT = lv_json_out
ENCODING = 'UTF-8'
REPLACEMENT = '?'
IGNORE_CERR = ABAP_TRUE
RECEIVING
CONV = lo_conv.
CALL METHOD lo_conv->READ
IMPORTING
DATA = lv_json_string.
TRANSLATE lv_json_string to UPPER CASE.
*convert JSON back to xstring
CALL METHOD CL_ABAP_CONV_OUT_CE=>CREATE
EXPORTING
ENCODING = 'UTF-8'
REPLACEMENT = '?'
IGNORE_CERR = ABAP_TRUE
RECEIVING
CONV = lo_conv2.
lo_conv2->convert( EXPORTING data = lv_json_string
IMPORTING buffer = lv_json_out ).
*convert our now UPPERCASE xstring to output table (JSON to ABAP)
clear lt_randmcnally_json.
lo_writer = cl_sxml_string_writer=>create( type = if_sxml=>co_xt_json ).
CALL TRANSFORMATION id OPTIONS value_handling = 'accept_decimals_loss'
SOURCE XML lv_json_out
RESULT routes = lt_RANDMCNALLY_JSON.
[snip] -
I thought I could make a properties file that looked like this:
my.array.values=blah
my.array.values=blah blah
my.array.values=oh blahbady blah...then I can get the properties out as an array. Did I just imaging that or something? How would I get an array in a properties file?You'll either have to write your own or find one on the web.
%yeah, i was afraid of that
for now i might do comma delimited string entry in props file
i don't want to parse xml or write anything special for this -
Changing individual array element properties
In the attached VI, I have a 1D array of slider controls ("Phase Coefficients") where each array element represents the coefficient in a polynomial of arbitrary order. The problem I'm having is that the slider range I set for the lowest order coefficient (array element 0) quickly becomes impractical for higher order coefficients (elements >5). Small changes in the higher order coefficients dramtically change the overall polynomial. I want each element/slider to have its own range, but I know this isn't strictly possible as each element in an array shares the same properties. I've implemented a work around (Use boolean to activate) in which the range of all sliders is adjusted depending on which element is being viewed, but my implementation prevents editing of the range while running the VI. Is there any way to adapt my method (or use another method all together) to allow for different, editable ranges for each element slider?
Thanks!
Solved!
Go to Solution.
Attachments:
Arb Poly Gen.vi 39 KBHi RavensFan,
Thanks for the suggestion! I tried your idea, but I still seem to be having the same problem with each slider sharing properties despite now being in a cluster inside the array. I may be misunderstanding you. Would you mind showing me an example please?
*Edit: Nevermind, got it to work. Thanks again!
Attachments:
Array Cluster Slider.vi 7 KB -
Generic / variable reference to json array field name
hi -- I have a javascript function that I want to make variable-based, so it can be used throughout my application.
It creates and parses a json object. I ultimately need to reference a field in that object. The field name is the name of database column
that was queried in the called application process.
For example, if the query executed was: select my_id from my_table where my_name = 'the_name', and the object that holds the parsed
AJAX response is jsonobj, then I need to reference: jsonobj.row[0].my_id
I don't want my_id to be hardcoded in the reference. Rather, I want to pass the string 'my_id' into the javascript function (let's call
the variable dest_item_name) and then reference (something like): jsonobj.row[0].<dest_item_name>.
(How) can I do this? Please tell me I can! :)
Thanks,
CarolHmmm, well, I thought I described my goal in the first post... but I'll try again.
hi -- I have a javascript function that I want to make variable-based, so it can be used throughout my application.
The function does this:
ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=LOOKUP_VALUE',0);
ajaxRequest.addParam('x01', source_item_value); -- equal to 'basin'; this is the value that will be used to lookup the value of dest_column_name
ajaxRequest.addParam('x02', source_column_name); -- equal to 'my_name'; this is the name of the database table column that will be = 'basin'
ajaxRequest.addParam('x03', dest_item_name); -- equal to P3_MY_ID; this is the name of the page item that will be set to the returned value
ajaxRequest.addParam('x04', dest_column_name); -- equal to 'my_id'; this is the name of the table column that gets queried
ajaxRequest.addParam('x05', lookup_table_name); -- my_data; this is the table to query
ajaxResponse = ajaxRequest.get();
if (ajaxResponse) {
var jsonobj= ajaxResponse.parseJSON();
$s(dest_item_name, jsonobj.row[0].my_id);
The goal of this javascript and application procedure is to have a generic method for looking up values
in the database. In the above example, I want to query my_data to get the value of my_id where my_name = 'basin'.
The application procedure LOOKUP_VALUE uses the x variables to construct that SQL query. For the above values, the
returned query is: select my_id from my_data where my_name = 'basin';
Then I set my dest_item_name (P3_MY_ID) to the value in the parsed json object. But as you can see, if I'm querying a different
table with different column names, the reference to jsonobj.row[0].my_id won't work, because the database column name
will be different. I've gotten around this by aliasing the queried field to RETURN_VALUE, so I'm just doing:
$s(dest_item_name, jsonobj.row[0].rerturn_value); -- which works great.
But my goal was to somehow be able to reference the variable dest_item_name (which is the name of the queried database
column) in my $s set statement.
Possible? If so, I'm sure it could come in handy at some point.
Thanks,
Carol -
Re: Focus Highlight Property of an Array Field
Hi Rhonda,
There was a couple of discussions about this subject a while ago. I
remember
of having posted a code sample myself. Take a look at the searchable
archive.
Ajith kallambella M.
Forte Systems Engineer,
International Business Corporation.
From: "Shannon, Rhonda B" <[email protected]>
Date: Fri, 21 Aug 1998 14:34:32 -0400
Subject: Focus Highlight Property of an Array Field
I have an array field on a window that is composedof >4 fields. The
array field maps to an object that contains the 4
fields. As the user
scrolls through the array, I would like the entire
current row to be
highlighted, not just the current widget.
I have been looking in the help both online and in
the Fort=E9 manuals.
In the index of the Display Library manual on page
648, I see under the
ArrayField class, a listing for FocusHighlightStyle
attribute for page
32. However, when I go to page 32, it is not there!
In the online =help
for Array Field, there is a section that lists the
array field
properties. In this section, there is a property
listed called Focus
Highlight. However, this is not in the properties
dialogue box and I
have no idea how to set it. I also looked in the
online help under
ArrayWidget. It says it provides the method which
highlights the
selected record in the array. However I cannot find
this method
anywhere in the help!
Has anyone worked with any of these properties or
methods? Or has
anyone highlighted the entire current row in anarray >in a differentmanner?
Any help/suggestions would be greatly appreciated!
Thanks,Rhonda Shannon>_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>Hi Rhonda,
There was a couple of discussions about this subject a while ago. I
remember
of having posted a code sample myself. Take a look at the searchable
archive.
Ajith kallambella M.
Forte Systems Engineer,
International Business Corporation.
From: "Shannon, Rhonda B" <[email protected]>
Date: Fri, 21 Aug 1998 14:34:32 -0400
Subject: Focus Highlight Property of an Array Field
I have an array field on a window that is composedof >4 fields. The
array field maps to an object that contains the 4
fields. As the user
scrolls through the array, I would like the entire
current row to be
highlighted, not just the current widget.
I have been looking in the help both online and in
the Fort=E9 manuals.
In the index of the Display Library manual on page
648, I see under the
ArrayField class, a listing for FocusHighlightStyle
attribute for page
32. However, when I go to page 32, it is not there!
In the online =help
for Array Field, there is a section that lists the
array field
properties. In this section, there is a property
listed called Focus
Highlight. However, this is not in the properties
dialogue box and I
have no idea how to set it. I also looked in the
online help under
ArrayWidget. It says it provides the method which
highlights the
selected record in the array. However I cannot find
this method
anywhere in the help!
Has anyone worked with any of these properties or
methods? Or has
anyone highlighted the entire current row in anarray >in a differentmanner?
Any help/suggestions would be greatly appreciated!
Thanks,Rhonda Shannon>_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/> -
How to display array values in textfield?
i am creating student details with mysql database using JSON to get values and display in xcode.i got json array values from php and converted to NSMuatable array. my array result
firstName = hari;
lastname = krishna;
age=10;
fathername=ragav;
firstName = priya;
lastname = amirtha;
age=8;
fathername=ravi;
now i want to display values iwhen i am enter firstname other field values display in textfiled on button click.how to do that .help me .thanks in advance.
i am very new to xcode.Hi,
I think that its necessaries to use AJaX.
I am implemeting something like that.
I have a input text that works like a filter and depends on what my user types in input text I populate my table with some information.
In order to do that, I put in my JSP a div with an Id and I used ajax, like that:
function ajaxFunction()
var xmlhttp;
if (window.XMLHttpRequest)
xmlhttp=new XMLHttpRequest();
else if (window.ActiveXObject)
// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
else
alert("Your browser does not support XMLHTTP!");
xmlhttp.onreadystatechange=function()
if( xmlhttp.readyState==4 )
document.getElementById("tabelaResponsaveis").innerHTML = xmlhttp.responseText;
var resp = "<f:invokeUrl var='solicitacao' methodName='getResponsaveis'/>";
xmlhttp.open("POST",resp,true);
xmlhttp.send(null);
getResponsaveis is a method inside my BPM that returns a HTML code (the table HTML code with all the information that I need to show.
I Hope to help
Thanks Marcos -
Reader Hive query - Cannot deserialize the current JSON object
Hi all,
I am trying to run a Reader module in MLStudio with a Hive query but it fails with Error 0000: Internal error.
In the output log I see this error:
[ModuleOutput] DllModuleHost Error: 1 : Program::Main encountered fatal exception: Microsoft.Analytics.Exceptions.ErrorMapping+ModuleException: Error 0000: Internal error ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'Newtonsoft.Json.Linq.JToken' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
[ModuleOutput] To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
[ModuleOutput] Path 'FileStatus.length', line 3, position 14.
But I don't see any configuration to change any JSON settings.
What am I doing wrong? Can anyone help me?
Thanks,
Csaba
PS: Using the Hive Editor I can select from my table without any problems.Can you let us know if you are still encountering this error? It doesn't look the error is due to user error.
-
MVC Web API json response truncated?
I have an MVC 4 Web API in C# hosted in IIS 7
Basically this service has a queue that has items enqueued every minute. I expose a GET method that allows for all the items in the queue to be returned in a json array.
the queue is really this: Queue<List<CustomObject>> mQueue; then every minute a new list is enqueued.
The max size of the queue is 50 (1 hour of data)
the maximum count of a list in said queue is ~500 and minimum count is ~100. When I debug the api locally It will return all the elemnets in the queue no problem. only takes a couple seconds. The size of the json response (saved to disk) is ~10Mb.
So I decided to host this service on a VM. I let it run for a while so the queue gets populated. then I make my request:
http://somepoint:4328/AzureQueueService?view=Full
I only get 1.30 - 1.32 mb of data back. Which equates to about 4 minutes worth of data! So the question becomes is there some setting in IIS that forces the response sent to be less than 2Mb? Maybe there is a similar setting in my webconfig? Or maybe IIS
has created more than one instance of my service? Either way, I'm missing something here.What OS (including SP number) your service is running on? (both local and VM)
Do you receive the same amount of data as specified in Content-Length header? Is your response a valid JSON (just having less data than expected), or it is really truncated?
Where is your queue hosted? Is it just a static object inside IIS process, or somewhere out-of-process?
How is it filled? By another method passing incoming data? Do you use thread synchronization when accessing the queue?
IIS may have multiple worker processes per application, and each will have its own static queue (of course, if it is hosted in-process). Also IIS might recycle worker processes, so in-process data could be lost. -
Focus Highlight Property of an Array Field
I have an array field on a window that is composed of 4 fields. The
array field maps to an object that contains the 4 fields. As the user
scrolls through the array, I would like the entire current row to be
highlighted, not just the current widget.
I have been looking in the help both online and in the Forté manuals.
In the index of the Display Library manual on page 648, I see under the
ArrayField class, a listing for FocusHighlightStyle attribute for page
32. However, when I go to page 32, it is not there! In the online help
for Array Field, there is a section that lists the array field
properties. In this section, there is a property listed called Focus
Highlight. However, this is not in the properties dialogue box and I
have no idea how to set it. I also looked in the online help under
ArrayWidget. It says it provides the method which highlights the
selected record in the array. However I cannot find this method
anywhere in the help!
Has anyone worked with any of these properties or methods? Or has
anyone highlighted the entire current row in an array in a different
manner?
Any help/suggestions would be greatly appreciated!
Thanks,
Rhonda Shannon
e-mail: [email protected]
phone: (908) 719-4583
fax: (908) 719-4460
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>Geoff,
May I point out that in your function, the input Row should be converted to:
Row - <theArrayField>.TopRow + 1;
or before calling this function.
Also the AfterFieldScroll event should be handled.
(It's me, Michael)
-----Original Message-----
From: Geoffrey Whitington [SMTP:[email protected]]
Sent: Friday, August 21, 1998 2:54 PM
To: 'Shannon, Rhonda B'; '[email protected]'
Subject: RE: Focus Highlight Property of an Array Field
Shannon,
As an Express developer, all of my windows get this functionality for
free. Of course this is
due to the fact that all ArrayFields inherit from a class that provides
this functionality.
The following snippet of code could be exactly what you are looking for,
method HighlightRow(input Row : integer)
if (Row >= 0) then
for widget in <DisplayedResultSet>.bodygrid.children do
if (widget.row = Row) then
widget.fillcolor = C_PALEYELLOW;
else
widget.fillcolor = C_WHITE;
end if;
end for;
end if;
end method;
I sure hope this helps you,
Take care
Geoff Whittington,
VP Coop Development
Its nice to be important,
but its more important to be nice.
- Blair
-----Original Message-----
From: Shannon, Rhonda B [mailto:[email protected]]
Sent: Friday, August 21, 1998 2:35 PM
To: '[email protected]'
Subject: Focus Highlight Property of an Array Field
I have an array field on a window that is composed of 4 fields. The
array field maps to an object that contains the 4 fields. As the user
scrolls through the array, I would like the entire current row to be
highlighted, not just the current widget.
I have been looking in the help both online and in the Forté manuals.
In the index of the Display Library manual on page 648, I see under the
ArrayField class, a listing for FocusHighlightStyle attribute for page
32. However, when I go to page 32, it is not there! In the online help
for Array Field, there is a section that lists the array field
properties. In this section, there is a property listed called Focus
Highlight. However, this is not in the properties dialogue box and I
have no idea how to set it. I also looked in the online help under
ArrayWidget. It says it provides the method which highlights the
selected record in the array. However I cannot find this method
anywhere in the help!
Has anyone worked with any of these properties or methods? Or has
anyone highlighted the entire current row in an array in a different
manner?
Any help/suggestions would be greatly appreciated!
Thanks,
Rhonda Shannon
e-mail: [email protected]
phone: (908) 719-4583
fax: (908) 719-4460
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/> -
JSONReader Array as Multi-Value Attribute
Hi, I am reading data into Endeca using the JSONReader. Is it possible to map a JSON array into a multi-value attribute?
e.g. if the data is {"id":"1", "title":"this is a book", "themes":["book", "read", "happy"]} How do I read and store the themes into a multi-value attribute? Thanks.EID does support multi-valued attributes but does not support arrays of attributes. When processing json files with Integrator multi-valued fields can be handled with a list container. As the final step before loading this list can be converted to a string separated by a non-printable character. The loader component will then unpack this string to the multiple values.
Ryan S. - EID PM -
Active Directory Object Properties
Maybe I am completely missing something, but is there no way to create an array of properties from get-aduser? I need to iterate through the user properties to find certain criteria. Even if I do:
$user = get-aduser $username -properties *
$user.count
The count returns 1. Now, I know it is only 1 user object, but is there a way to iterate through each property?
Thanks!
TonySorry, I have not yet opened a topic and asked a question, I don't know how.
To answer the question "is there a way to iterate through each property?"
Here is one way. It iterates through the properties (of any object) and create the properties
to create a PS-Object
PS C:\>
Function Get-PSObjectFromObject
[CmdletBinding()]
[OutputType([string])]
param
[Parameter(Mandatory=$true,
ValueFromPipeline=$false,
ValueFromPipelineByPropertyName=$false,
ValueFromRemainingArguments=$false,
Position=0,
ParameterSetName='Object')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[Object]$Object
Try
$Members=Get-Member -InputObject $Object
$ValidPropertyType = @{"{get;set;}"=$True;"{get;}"=$True;}
$ValidReturnType = @{"bool"=$True;"byte"=$True;"string"=$True;"string[]"=$True;
"int"=$True;"int16"=$True;"int32"=$True;"int64"=$True;
"uint"=$True;"uint16"=$True;"uint32"=$True;"uint64"=$True;
"datetime"=$True;"timespan"=$True;
"system.boolean"=$True;"system.byte"=$True;"system.string"=$True;"system.string[]"=$True;
"system.int"=$True;"system.int16"=$True;"system.int32"=$True;"system.int64"=$True;
"system.uint"=$True;"system.uint16"=$True;"system.uint32"=$True;"system.uint64"=$True;
"system.datetime"=$True;"system.timespan"=$True
[string]$String=""
$String=$String+"New-Object PSObject -Property ([Ordered]@{ `r`n"
ForEach ($Member in $Members)
IF ($Member.MemberType -EQ "Property")
[string]$Name=$Member.Name
IF ($Name.Substring(1,1) -NE "_")
IF (-NOT $Name.Contains("-"))
[String[]]$Definition=$Member.Definition.Split(" ")
[string]$PropertyType=$Definition[2]
IF ($ValidPropertyType[$PropertyType])
$ReturnType=$Definition[0]
If ($ValidReturnType[$ReturnType])
$String=$String+" $Name="+"$"+"Object.$Name `r`n"
$String=$String+"}) `r`n"
$String
Catch [System.Exception]
Write-Host $_.Exception.Message
$Object = Get-aduser "Administrator" -Properties *
$PSProperties = Get-PSObjectFromObject $Object
$PSObject = Invoke-Expression $PSProperties
"***********This is PSObject definition"
$PSProperties
"***********This is PSObject"
$PSObject
***********This is PSObject definition
New-Object PSObject -Property ([Ordered]@{
AccountExpirationDate=$Object.AccountExpirationDate
accountExpires=$Object.accountExpires
AccountLockoutTime=$Object.AccountLockoutTime
AccountNotDelegated=$Object.AccountNotDelegated
adminCount=$Object.adminCount
AllowReversiblePasswordEncryption=$Object.AllowReversiblePasswordEncryption
BadLogonCount=$Object.BadLogonCount
badPasswordTime=$Object.badPasswordTime
badPwdCount=$Object.badPwdCount
CannotChangePassword=$Object.CannotChangePassword
CanonicalName=$Object.CanonicalName
City=$Object.City
CN=$Object.CN
codePage=$Object.codePage
Company=$Object.Company
Country=$Object.Country
countryCode=$Object.countryCode
Created=$Object.Created
createTimeStamp=$Object.createTimeStamp
Deleted=$Object.Deleted
Department=$Object.Department
Description=$Object.Description
DisplayName=$Object.DisplayName
DistinguishedName=$Object.DistinguishedName
Division=$Object.Division
DoesNotRequirePreAuth=$Object.DoesNotRequirePreAuth
EmailAddress=$Object.EmailAddress
EmployeeID=$Object.EmployeeID
EmployeeNumber=$Object.EmployeeNumber
Enabled=$Object.Enabled
Fax=$Object.Fax
GivenName=$Object.GivenName
HomeDirectory=$Object.HomeDirectory
HomedirRequired=$Object.HomedirRequired
HomeDrive=$Object.HomeDrive
HomePage=$Object.HomePage
HomePhone=$Object.HomePhone
Initials=$Object.Initials
instanceType=$Object.instanceType
isCriticalSystemObject=$Object.isCriticalSystemObject
isDeleted=$Object.isDeleted
LastBadPasswordAttempt=$Object.LastBadPasswordAttempt
LastKnownParent=$Object.LastKnownParent
lastLogoff=$Object.lastLogoff
lastLogon=$Object.lastLogon
LastLogonDate=$Object.LastLogonDate
lastLogonTimestamp=$Object.lastLogonTimestamp
LockedOut=$Object.LockedOut
logonCount=$Object.logonCount
LogonWorkstations=$Object.LogonWorkstations
Manager=$Object.Manager
MNSLogonAccount=$Object.MNSLogonAccount
MobilePhone=$Object.MobilePhone
Modified=$Object.Modified
modifyTimeStamp=$Object.modifyTimeStamp
Name=$Object.Name
ObjectCategory=$Object.ObjectCategory
ObjectClass=$Object.ObjectClass
Office=$Object.Office
OfficePhone=$Object.OfficePhone
Organization=$Object.Organization
OtherName=$Object.OtherName
PasswordExpired=$Object.PasswordExpired
PasswordLastSet=$Object.PasswordLastSet
PasswordNeverExpires=$Object.PasswordNeverExpires
PasswordNotRequired=$Object.PasswordNotRequired
POBox=$Object.POBox
PostalCode=$Object.PostalCode
PrimaryGroup=$Object.PrimaryGroup
primaryGroupID=$Object.primaryGroupID
ProfilePath=$Object.ProfilePath
ProtectedFromAccidentalDeletion=$Object.ProtectedFromAccidentalDeletion
pwdLastSet=$Object.pwdLastSet
SamAccountName=$Object.SamAccountName
sAMAccountType=$Object.sAMAccountType
ScriptPath=$Object.ScriptPath
sDRightsEffective=$Object.sDRightsEffective
SmartcardLogonRequired=$Object.SmartcardLogonRequired
State=$Object.State
StreetAddress=$Object.StreetAddress
Surname=$Object.Surname
Title=$Object.Title
TrustedForDelegation=$Object.TrustedForDelegation
TrustedToAuthForDelegation=$Object.TrustedToAuthForDelegation
UseDESKeyOnly=$Object.UseDESKeyOnly
userAccountControl=$Object.userAccountControl
UserPrincipalName=$Object.UserPrincipalName
uSNChanged=$Object.uSNChanged
uSNCreated=$Object.uSNCreated
whenChanged=$Object.whenChanged
whenCreated=$Object.whenCreated
***********This is PSObject
AccountExpirationDate :
accountExpires : 9223372036854775807
AccountLockoutTime :
AccountNotDelegated : False
adminCount : 1
AllowReversiblePasswordEncryption : False
BadLogonCount : 0
badPasswordTime : 130524210883000074
badPwdCount : 0
CannotChangePassword : False
CanonicalName : Contoso.com/Users/Administrator
City :
CN : Administrator
codePage : 0
Company :
Country :
countryCode : 0
Created : 6/21/2014 12:48:03 AM
createTimeStamp : 6/21/2014 12:48:03 AM
Deleted :
Department :
Description : Built-in account for administering the computer/domain
DisplayName :
DistinguishedName : CN=Administrator,CN=Users,DC=Contoso,DC=com
Division :
DoesNotRequirePreAuth : False
EmailAddress :
EmployeeID :
EmployeeNumber :
Enabled : True
Fax :
GivenName :
HomeDirectory :
HomedirRequired : False
HomeDrive :
HomePage :
HomePhone :
Initials :
instanceType : 4
isCriticalSystemObject : True
isDeleted :
LastBadPasswordAttempt : 8/13/2014 9:31:28 AM
LastKnownParent :
lastLogoff : 0
lastLogon : 130530452556502145
LastLogonDate : 8/12/2014 2:27:39 AM
lastLogonTimestamp : 130523092594640653
LockedOut : False
logonCount : 714
LogonWorkstations :
Manager :
MNSLogonAccount : False
MobilePhone :
Modified : 8/12/2014 2:27:39 AM
modifyTimeStamp : 8/12/2014 2:27:39 AM
Name : Administrator
ObjectCategory : CN=Person,CN=Schema,CN=Configuration,DC=Contoso,DC=com
ObjectClass : user
Office :
OfficePhone :
Organization :
OtherName :
PasswordExpired : False
PasswordLastSet : 6/14/2014 4:55:33 AM
PasswordNeverExpires : True
PasswordNotRequired : False
POBox :
PostalCode :
PrimaryGroup : CN=Domain Users,CN=Users,DC=Contoso,DC=com
primaryGroupID : 513
ProfilePath :
ProtectedFromAccidentalDeletion : False
pwdLastSet : 130472205339962382
SamAccountName : Administrator
sAMAccountType : 805306368
ScriptPath :
sDRightsEffective : 15
SmartcardLogonRequired : False
State :
StreetAddress :
Surname :
Title :
TrustedForDelegation : False
TrustedToAuthForDelegation : False
UseDESKeyOnly : False
userAccountControl : 66048
UserPrincipalName :
uSNChanged : 113679
uSNCreated : 8196
whenChanged : 8/12/2014 2:27:39 AM
whenCreated : 6/21/2014 12:48:03 AM
PS C:\>
The GUI version of this will be uploaded within a day or two.
Maybe you are looking for
-
Converting a .class file to a .jar file
Can you please suggest as how can I convert a .class (dot class) file into an executable .jar (dot jar) file and how I can execute that .jar file.
-
My iPhone no longer works with my wi-fi network. It detects the network but is unable to communicate, even though until today it worked great for months. The network is Verizon FiOS Internet on an M1424WR router. PCs and iPad continue to work with
-
How to check the records in Master Data Table?
Hi, I am trying to load the Master Data Table using the Flat File.Now how to check the records in Master Data Table? I done the following way: Info Provider->Info Object->Right Click->Display Data or Maintain Master Data But it's not showing the r
-
HT1692 how can i get the previous contact details in iphone
how can i get the previous contact details in iphone
-
Dear All, Need help in understanding how and when will the % duration of work which we get while confirming an acitivty will show up in higher WBS. Eg. WBS level 1 % duration of work doesnt show up (no time ba