List in List
Lightswitch HTML: I display a master list and would like to display an embedded second minor list that depends on the item of the master list.
I can only do a binding with the "selectedItem" of the master list but I do not want to be obligated to click (select) manually an item on the master list to be able to show the second list.
It is the famous question of being able to display a kind of tree list.
Is there any hints about that?
Yves Pflieger
Hi Yves,
You will have to try doing a bit of creative rendering, but here is a possible pattern.
And now for some sample render code...
myapp.ProductsLists.Id2_postRender = function (element, contentItem) {
myapp.ProductsLists.getConfigs(contentItem.value.toString(), element);
myapp.ProductsLists.Id3_postRender = function (element, contentItem) {
myapp.ProductsLists.getConfigs(contentItem.value.toString(), element);
myapp.ProductsLists.Id4_postRender = function (element, contentItem) {
myapp.ProductsLists.getConfigs(contentItem.value.toString(), element);
myapp.ProductsLists.getConfigs = function getConfigs(id, element) {
myapp.activeDataWorkspace.ApplicationData.ProductConfigurationsByProductId(id)
.execute()
.then(function (response) {
var list = "";
msls.iterate(response.results).each(function (item) {
list += "<div style='border: 1px solid rgb(240, 240, 255)'>" + item.Name + "</div>";
$(element).html("<div style='border: 1px solid rgb(109, 197, 255);'>" + list + "</div>");
}, function (error) {
$(element).text("error");
Custom rendering code and async child collection retrieval, all in a few lines of code.
Enjoy
Dave
Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.
Similar Messages
-
Duplicated values when added to list of list
Hey all,
I'm making a list of lists, when I print the values just after adding in the list of list everything seems fine, but when I print that list where I call it it has duplicate value instead of the 2 different that I see when I first print it, I really don't know what's wrong.
I tried 2 different declarations for the list of list but is the same result, I also tried using index to add the list but no change either.
What is wrong? or how should I do it instead.
Thanks in advance
The code is this
public class ReadFile extends Metrics{
public List loadFile(String filename) throws IOException{//void
FileInputStream fstream = null;
///TRACE POINTS
List<TracePoint> CharPoints=new ArrayList<TracePoint>();
List<List> ListaChars = new ArrayList<List>();
//List<List<TracePoint>> ListaChars = new ArrayList<List<TracePoint>>();
try {
fstream = new FileInputStream(filename);//"xy.dat");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
Normalize norm = new Normalize();
//Read File Line By Line
while((strLine = br.readLine())!= null) {
int INDEX=0;
///READING VALUES FROM XY FILE and splittting
String[] temp = strLine.split(" ");
///clear list before reusing it
CharPoints.clear();
String[] tempNorm = norm.normalize(temp, 0, 1);
for (int i = 1 ; i < tempNorm.length ; i=i+2){
CharPoints.add(new TracePoint(Float.parseFloat(tempNorm),Float.parseFloat(tempNorm[i+1])));
ListaChars.add(INDEX, CharPoints);
System.out.println(" Charpoints is "+ CharPoints);
System.out.println(" LISTofCHARS is "+ ListaChars);
INDEX++;
//Close the input stream
in.close();
}catch (FileNotFoundException ex) {
Logger.getLogger(ReadFile.class.getName()).log(Level.SEVERE, null, ex);
}finally {
try {
fstream.close();
} catch (IOException ex) {
Logger.getLogger(ReadFile.class.getName()).log(Level.SEVERE, null, ex);
//return CharPoints;
return ListaChars;
public static void main(String args[]) throws IOException{
ReadFile test2 = new ReadFile();
List<List> characters = new ArrayList<List>();
characters = test2.loadFile("xy.dat");
//System.out.println("\ncharacters = " +" "+ characters.get(0));
The result is this, the first look like its copying ok, but when the second is added is duplicated and the first value is not there anymoreCharpoints is [TracePoint: 0.395683, 0.913669, 0.000000, TracePoint: 0.136691, 0.928058, 0.000000, TracePoint: 0.000000, 1.000000, 0.000000]
LISTofCHARS is [[TracePoint: 0.395683, 0.913669, 0.000000, TracePoint: 0.136691, 0.928058, 0.000000, TracePoint: 0.000000, 1.000000, 0.000000]]
Charpoints is [TracePoint: 1.000000, 0.004096, 0.000000, TracePoint: 0.999937, 0.003151, 0.000000, TracePoint: 0.999811, 0.001765, 0.000000, TracePoint: 0.998866, 0.000000, 0.000000]
LISTofCHARS is [[TracePoint: 1.000000, 0.004096, 0.000000, TracePoint: 0.999937, 0.003151, 0.000000, TracePoint: 0.999811, 0.001765, 0.000000, TracePoint: 0.998866, 0.000000, 0.000000], [TracePoint: 1.000000, 0.004096, 0.000000, TracePoint: 0.999937, 0.003151, 0.000000, TracePoint: 0.999811, 0.001765, 0.000000, TracePoint: 0.998866, 0.000000, 0.000000]]
Edited by: mtiv on Oct 24, 2009 6:02 PMwhile((strLine = br.readLine())!= null) {
int INDEX=0;
INDEX++;
}On each iteration of the while loop, index equals 0. Try moving the variable index outside of the while loop.
List<TracePoint> CharPoints=new ArrayList<TracePoint>();By convention variable names begin with a lower case letter, it is an important practise to live by as I was lead to believe CharPoints was a class at first.
Mel -
Show Net Due Date in F110 - Proposal list / Payment list
Dear Gurus,
I would like to ask for help in below issues:
I want to display "Net due date" field in transaction F110 - Proposal list / Payment list (program : RFZALI20) but I only found "Baseline Payment date" and "Payment term" in variant maintenance.
Would appreciate if someone can give me the solution / suggestion for above issue?
Thanks & regards,
LOIHi,
1) You may copy the sample interface function module: SAMPLE_INTERFACE_00002110 (to get the passing parameters) and code your coding as below:
**To calculate Net due date = baseline date + payment term
FUNCTION yyyy.
LOOP AT T_REGUP_LST.
T_REGUP_LST-ZZFAEDT = T_REGUP_LST-ZFBDT + T_REGUP_LST-ZTERM.
MODIFY T_REGUP_LST.
ENDLOOP.
ENDFUNCTION.
2) Make sure you have declared the new field in tbl CI_REGUP_LST and CI_REGUH_LST (item level in tbl-CI_REGUP_LST; header level in tbl-CI_REGUH_LST).
3) Configure IMG through FI > Financial Accounting Global Settings > Business Transaction Events
a) Settings > Products > of a Customer > Define a new product and activate it
e.g Product = Zxxxx
b) Settings > P/S Function Modules > of a Customer >
e.g Event = 00002110
Product = Zxxxx
Appl = FI-FI
Function Module = yyyy
4) Proceed to test the new fields added through F110: Payment / Proposal List from program RFZALI20
I hope to hear a good news from you.
Thanks & regards,
LOI -
I have used this before in earlier versions of DW and it worked fin. I tried tonight with CC 2014.1.1 in either design view or in codeview with the same results. I would select the text from the starting <p> tag to the ending </p> tag, and then in the menu choose Format - List - Definition List and only get the <dl> tags. Anyone else experience this?
Thanks!That's how it works in CS6, too. And it is not just for definition lists. That is the expected outcome no matter which list type you use. DW doesn't know where the DTs and DDs begin and end because you've highlighted an entire paragraph and asked DW to format it as a DL.
I typically code my own Definition Lists. It's faster.
Nancy O. -
My music list is listed in number order instead of in alphabetic order like it's suppose to be. What do I do to get it back to be in alphabetic order?
You should be importing all pics taken with the iphone to your computer regularly as you would with any digital camera.
iOS: Importing personal photos and videos from iOS devices to your computer -
Multiple Choices in either Dropdown list or List box
I'm working on a form which will need to be reviewed and accepted by multiple people. I'd like to have a dropdown list or list box with all the known names of those reviewing, where all names can be selected, one by each reviewer so eventually all names will be picked, and the form approved.
Open to any help I can get. This is new territory for me. Thanks in advance,
gberr... should it be allowed to deselect?
If yes I'd do it with checkboxes, if not I'd do it with a dropdownlist that populates calculated Textfields.
Though there already was a solution for multiple selections of a dropdownlist in the past... I'll search it, if you want.
Any more requirements? (F.ex. should the next user be not able to see who has already had it?) -
Binary search in List of Lists
Hi,
I have List of Lists (i.e an List of ArrayList within ArrayList), now i have being trying to do use binarySeach using the comparator api in Collections framework .. but no luck . Can someone help me out
thanx
sharadYes i have the listed sorted using the sort api on collections framework... following is the piece of code which sorts the String numbers stored in List of Lists. (please note the following code has been modified from its original source, so that i can post it across forums). Now using the binarysearch api in Collection framework .. i need to search for string say 5401880000 .. can i do it.
import java.util.*;
public class MySort
public static void main(String args[])
List innerList = new ArrayList();
List outerList = new ArrayList();
innerList.add(new String("5889319999"));
innerList.add(new String("5889310000"));
outerList.add(innerList);
innerList = new ArrayList();
innerList.add(new String("5401880000"));
innerList.add(new String("5401889999"));
outerList.add(innerList);
innerList = new ArrayList();
innerList.add(new String("5425550999"));
innerList.add(new String("5425550000"));
outerList.add(innerList);
System.out.println ("unsorted list ---> "+outerList);
// sorting the collections ...
Collections.sort(outerList, new Comparator()
public int compare(Object o1, Object o2)
List list1 = (List) o1;
List list2 = (List) o2;
String d1 = (String) list1.get(0);
String d2 = (String) list2.get(0);
return d1.compareTo(d2);
System.out.println("Sorted: " + outerList); -
What is Piece List, Work List and Object List
Hi All,
Can you please give idea about Piece List, Work List and Object List in BI.
What are their uses?Hi,
Piece lists
You can use this request type to set up your own object lists and save them under a name of your choice.
For more info on this go through the link below
http://help.sap.com/saphelp_sm32/helpdata/EN/57/38e1b64eb711d182bf0000e829fbfe/content.htm
Worklists
Worklists are the quickest and most convenient way of accessing the objects that you need to translate. Translators can call up a worklist in SE63 once a system has been completely set up for translation.
For more info on this go through the link below
http://help.sap.com/saphelp_sm310/helpdata/en/77/571a1f492011d1894a0000e829fbbd/content.htm
Object Lists
The Object Lists tab page in transaction SLWB enables you to create and manage object lists in the Translation Planner.
An object list should contain all objects relevant for translation. You can create object lists according to a variety of criteria
For more info on this go through the link below
http://help.sap.com/saphelp_sm32/helpdata/EN/d4/341964249711d3b29e0000e817ab98/content.htm
Regards,
Marasa. -
What is Picking list, packing list, invoice list?
Hi,
iam totally confused with list concepts. what is picking list? then what is packing list? what is invoice list?Hi,
For general information about these terms, it is better you search the internet.
In simple terms:
1. Picking List - List of materials that need to be picked and is given to the person given the picking
2. Packing List - List stating which materials are packed in which box, and is given to the Customer
3. Invoice List - A list of invoices that is given to a third-party for payment collection from customers.
Regards
Nikhil -
Hi guys,
I am wondering what is the T stand for in the List<T> list?
and what's it useful for the following interface and implementation to use <T, PK>?
public interface TestInterface <T, PK extends Serializable>{
public void sayHello();
public class TestInterfaceImpl<T, PK extends Serializable> implements TestInterface<T, PK>{
@Override
public void sayHello() {
System.out.println("Buenas noches!");
}That's the type parameter. It tells instances of that class what other kinds of classes can be used with it, so to speak.
It's so you can write a library without knowing what other classes will be used with it.
I'm not explaining this well. Google for tutorials on "java generics" -
Stock transfer using PICK LIST / PULL LIST
Hi Friend,
We have two storage locations in the plant say 1000 - Main store which is ware house managed and 2000 - Production storage location.
The goods issue needs to be done from production storage location 2000. How to transfer the material from 1000 - Main store which is ware house managed to 2000 - Production storage location using PICK LIST / PULL LIST concept.
Kindly give the solution.
Regards,
Narendra BoraHello Madhu,
If you can suggest me as well. I am moving the goods to production storage location from raw material storage lcoation,
While executing the MF60 it creates the reservation and display log
RMPU stock transfer reservations 00000412 22.03.2010 created successfully
But does not move the goods using 311 movement type and stock is still in the raw material storage location.
2ndly in MMBE, if i found the stock in Produciton location, it shows me
Reserved 20.000
GR blocked stock 20.000
Rcpt reservation 20.000
If you can enlighten me in this area please, Would it move the stock or I need to make some other steps also.
Regards,
JPS -
Problem using List of Lists in loop
I'm working on a test program that will pull in two text files and return a list of the words that are common among in each. I'm running into a logistical problem when trying to add elements of a list to a list of lists, and then clear the primary list for the next iteration of the loop. Here's my code:
import java.util.*;
import java.io.*;
public class IOList {
private static List<File>();
public static void main(String[] args) {
files = new ArrayList<File>();
Scanner s;
List<String> words = new ArrayList<String>();
List<List<String>> allWords = new ArrayList<List<String>>();
File a = new File(args[0]);
File b = new File(args[1]);
files.add(a);
files.add(b);
for (File file : files) {
try {
s = new Scanner(new BufferedReader(new FileReader(file)));
while (s.hasNext()) {
words.add(s.next());
int n = words.size();
allWords.add(words.subList(0, n));
words.clear();
} catch(FileNotFoundException e) {
System.err.println("Could not find file " + file);
System.exit(1);
List<String> fileA = allWords.get(0);
List<String> fileB = allWords.get(1);
fileA.retainAll(fileB);
fileB.retainAll(fileA);
fileA.addAll(fileB);
int size = fileA.size();
for (int i = 0; i < size; i++) {
String str = fileA.get(i - 1);
System.out.println(str);
}When I step through this code, netbeans gives me a message:
words.subList = >"subList" is not a known variable in current context<
If I use allWords.add(words); instead, the String elements populate to the first List of Strings contained in allWords, and are then removed when I call
words.clear();in the next step to prep it for the next iteration.
Can anyone suggest another way to do this while still working with the loop?
Thanks in advanceJust to make clear: subList() does not (necessarily)
create a new list but a view on the original list. If
that original list is modified, the sublist might
change and vice versa.subList() never creates a new list, the subList is always backed by the original list. If the original list is modified, the sublist is too, always. If the original list is structurally modified, the result is undefined, so don't do that.
http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html#subList(int, int) -
Hi All,
i have a SharePoint list, that list contains photos(images).
now i want display that images in spgridview.
How can i display?
Thanks in advance!Hi,
According to your post, my understanding is that you want to display that images in spgridview.
You can use a hyperlinkfield that is bound to the SPGridView. Please refer to:
Add a Hyperlink Image in a SPGridView
You can also use TemplateField or ImageField to render images. Please refer to:
Image not showing in grid view
In addition, here are two similar articles for your reference:
How To: Use SharePoint 2010 WebParts with a GridView Control to get SQL Image Data
type and other Values
DotNetSharePoint: How to display images in gridview from database using asp.net
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
Hi all
Is it possible to create a list of lists and iterate over that list of lists? Will this effect the performance of the system.
Thanks and Regards
RogerThanks for not giving the answer, helps so much more getting there yourself.That's the idea. One thing though. Can I suggest using the interfaces for the collections in your generic signatures instead of the concrete collection classes themselves? That way if you change your mind about using a LinkedList and decide to use the ArrayList (or some other custom List implementation) you'll be able to do it with minimal code changes.
For example, above I declare my map as containing Set types instead of HashSet types. So if I decide to use a TreeSet nothing else changes:
// My way:
final Map<Node,Set<Node>> nodeMap = new HashMap<Node,Set<Node>>();
// Your way:
final HashMap<Node,HashSet<Node>> nodeMap = new HashMap<Node,HashSet<Node>>();
// My change (0):
final Map<Node,Set<Node>> nodeMap = new HashMap<Node,Set<Node>>();
// Your change (2):
final HashMap<Node,TreeSet<Node>> nodeMap = new HashMap<Node,TreeSet<Node>>(); -
Displaying Multiple XML Data on List Item List
Hi there..
Is it possible to display multiple XML Data on List Item List. I mean like the example below.
and how to programatically load image that depends on the XML data value (0=down arrow, 1=up arrow) and also how to refresh data every 1 second.
Thank you very much...Hi Ann,
Write a Forms procedure and in that open a cursor fetching all data you want to show in the list element and populate the list within the loop using Add-List-Element built-in. Call this procedure in When-New-Form-Instance trigger. Whenver form will be opened the your list element will be populated automatically.
Hope that helps you. -
Show/Hide Regions using list (Button List Template)
Hi,
I have a page on which i'm using list (Button list - Template). Below lists, I have multiple form regions. When a user opens that page, all regions should be visible and the focus should be on 'Show All' list. However, Region 'Terms' should only be visible when list 'Terms' is selected. The same functionality should apply to other regions and lists. I have seen that Oracle has used a similar functionality when an Item on a page is clicked or opened.
Does anybody know how to do it?I'm trying to use the hide/show region in the posting to hide a button region when I click the button.
When I click my button it calls SubmitCmd(sCmd) and hits the alert popup "Here we go!" but then all the AJAX inserts happen and THEN the region hides.
I guess the alert is Async and the $x_Hide(l_Item); is not or something like that??
How can I hide the region and then process the rest with the same button click?
Or how can I hide just a normal button when I click it.. same thing though, need to do it before processing of AJAX inserts.
function SubmitCmd(sCmd){
var lQuesID;
var elmName;
var elm;
lcontinue = true;
showMessage('');
alert('Here we go!');
$x_Hide(l_Item);
var lAdtUseID =html_GetElement('P3_AUDIT_USE_ID').value;
etc.. a bunch of AJAX inserts, etc..
Maybe you are looking for
-
Wireless printing from a PC thru a D-link router thu a G5 to a wired Epson
Greetings and thanks to all that support the unsupportable! I have successfully created my first local network and actually got a HP laptop, G4 iMac and a G5 imac online to with a satellite modem. The G5 is connected via ethernet to the router and th
-
My SSD won't boot on my HP Pavilion g6
Hi, I'm having quite an embarrassing problem and I would be grateful if someone could help me. I have an laptop and I would like to replace the original HDD with an SSD, but the computer cannot read or format the drive. Here the steps I performed : I
-
Why does my bridge photo downloader keep crashing
Hello, I'm running Adobe CS5 on a Mac OS X 10.6. For some reason my bridge photo downloader keeps crashing in the middle of trying to import pictures from my iphone camera. Is this something to do with iphoto preferences maybe? I believe I've set my
-
Cannot find a Vector within a Vector
Yo. Another noob askin about elements within a Vector. I'm working on a OOP project in BlueJ. First time doing so, so my code is still kinda procedural (with many listeners in the same document, etc etc) I'm creating a simulation of a 7-a-side footba
-
[SOLVED] SOA Suite 11g and OID
How should I configure OC4J in TP4 such that Human Tasks can be assigned to users in an LDAP directory, e.g Oracle Internet Directory? Thanks, Eyðun Message was edited by: Eyðun E. Jacobsen Message was edited by: Eyðun E. Jacobsen