Simple operations on list of lists with generics

I'm trying to create a method that takes variables of type List<? extends List<T>> and makes all the lists the same size by chopping off the rear elements of the lists passed in. Here's what I'm trying, but the second for loop is throwing an exception
public static <T> List<? extends List<T>> standardizeNumberListsFromBack(List<? extends List<T>> input) {
          int minLength = input.get(0).size();
          for (List l: input){
               if (l.size() < minLength){
                    minLength = l.size();
          for (List l: input){
               l.subList(minLength, l.size()).clear();
          return input;
     }The call to clear() gives me an UnsupportedOperationException since the type of l is the List interface.
Any ideas how I can pull this off while preserving the generality of the method?
Thanks in advance.

The call to clear() gives me an
UnsupportedOperationException since the type of l is
the List interface.No you get an UnsupportedOperationException because you're calling clear on a list that doesn't support removing elements.
This most likely occurs because you're using something like Arrays.asList(...) (which returns a fixed size list backed by the given array) to generate your lists.
Calling your code withList<Integer> foo = Arrays.asList(1, 2, 3, 4);
List<Integer> bar = Arrays.asList(4, 5, 6);
System.out.println(standardizeNumberListsFromBack(Arrays.asList(foo, bar)));gives me the UnsupportedOperationException. While calling it with thisList<Integer> foo = new ArrayList<Integer>(Arrays.asList(1, 2, 3, 4));
List<Integer> bar = new ArrayList<Integer>(Arrays.asList(4, 5, 6));
// the following also works
// List<Integer> foo = new LinkedList<Integer>(Arrays.asList(1, 2, 3, 4));
// List<Integer> bar = new LinkedList<Integer>(Arrays.asList(4, 5, 6));
System.out.println(standardizeNumberListsFromBack(Arrays.asList(foo, bar)));doesn't.
Edit:
Oh and by the way, you should changefor (List l: input){tofor (List<T> l: input){in both loops to avoid type safety warnings.
Edit2:
My suggestion would be something likefor (List<T> l: input){
     try {
          l.subList(minLength, l.size()).clear();
     } catch (UnsupportedOperationException e) {
          // log the error in some way
          System.err.println("Can't remove elements from a list");
}Message was edited by:
dwg

Similar Messages

  • Converting enumerations to lists with generics

    hello...
    i want to list off system properties and sort them.
    how can you convert enumerations to lists with generics?
    i tried the following in eclipse, but it fails...
         Properties properties = System.getProperties( ) ;
         Enumeration<?> enumeration = properties.propertyNames( ) ;
         ArrayList<String> arrayListEnum = Collections.list( enumeration ) ;
         Collections.sort( arrayListEnum ) ;

    Because the type parameter of Enumeration (<?>) is not compatible with the type parameter of ArrayList (<String>).
    You'll have to do some manual casting yourself.
    Unfortunately, there's nothing to guarantee that system property keys or values are strings (hence why Enumeration<?> and no Enumeration<String>) so you'll need to cope if you find one that isn't.

  • A simple list with seven time buckets starting from the date report is run.

    Hi All,
    I am new to ABAP.Recently i have planned to write a progam which will help in planning the delivery of scheduled items.For a given sales Org. it will display all the undelivered,delivered items in a simple list and sort them with delivery dates.it will also provide a summary report at material group.For that i have used selection screen(LIKP-VKORG-Obligatory).when i enter VKORG Details i should get all the delivery docs for which delivery is not done or partially done.For this i have taken one more table LIPS
    (LIPS-MATKL,LIPS-MATNR,LIPS-VBELN,LIPS-POSNR,LIPS-WERKS,LIPS-LFIMG,LIPS-MEINS) for tables LIKP and LIPS VBELN is the key field.when i enter VKORG Data in the selection screen ,how can i get the data from LIPS Table.Please explain?
    Also report should be simple list with seven time buckets starting from the date when the report is run.The amount of quantity to be delivered should be displayed under appropriate bucket i.e within the bucket where its delivery date falls in.for ex:If the report is run on Tuesday 15th march 2010 then the start date 1 should be starting date of the week which is Monday 14th March.
    The report will be summarized at Material Group and Material Number.
    Appreciate your help
    Thanks and Regards,
    Shakeer Hussain

    Sorry, sounds too much like a complete requirement you want done for you by the community.
    Please work on it yourself and search for available information before posting specific problems only.
    Thread locked.
    Thomas

  • Why won't my ipad send a simple txt message to a phone number that is not listed with imessage. It workls fine from my iphone. Same carrier.

    Why won't my ipad send a simple txt message to a phone number that is not listed with imessage. It works fine from my iphone. Same carrier.

    You can read why here:
    about messages
    http://support.apple.com/kb/HT3529
    Troubleshooting messages
    http://support.apple.com/kb/TS2755

  • How to export All computer list with operating system from AD and all attributes like disable or enable and OU location also?

    how to export All computer list with operating system from AD and all attributes like disable or enable and OU location also?
    I have tried with dsquery below but status is not showing there.
    dsquery * -filter "(objectCategory=computer)" -attr name operatingSystem

    last logon user name - not really stored (or lined) with computer object.  However, you can get this info during the logon process or from the computer.  Here is method:
    http://portal.sivarajan.com/2010/07/user-profile-and-os-info-powershell.html
    Santhosh Sivarajan | Houston, TX | www.sivarajan.com
    ITIL,MCITP,MCTS,MCSE (W2K3/W2K/NT4),MCSA(W2K3/W2K/MSG),Network+,CCNA
    Windows Server 2012 Book - Migrating from 2008 to Windows Server 2012
    Blogs: Blogs
    Twitter: Twitter
    LinkedIn: LinkedIn
    Facebook: Facebook
    Microsoft Virtual Academy:
    Microsoft Virtual Academy
    This posting is provided AS IS with no warranties, and confers no rights.

  • Simple select list with submit solution

    hello,
    i read all the topics on select list with submit bottton but couldn't get it to work in my app.
    i have a form on a table( create with a wizard). i have 2 fields that i converted from text field to select list (first with submit and the second depand on the value of the first).when the 1 lov source type is db column then it can't save the value after the submit.
    when i change the first lov to somthing else and set the source used to "only when current . . " i get a null value in the table.
    how can i save the state of the first lov and still get the insert to work ? please guide me step by step .
    here is the first love definition:
    select cat_desc,catid
    from category_main
    order by catid
    the second lov:
    select cat_desc,catid_sub
    from category_sub
    where catid = :p36_mcategory
    the proccess is Automatic Row Processing (DML)
    thanks

    thanks for the answer
    i will try clarify my problem
    i create a form with a form on table wizard
    the desc table is
    bugid pk
    mcategory (main category)
    scategory (sub category)
    the mcategory,scategory need to be cascade lov so i changed what the wizrd created for me (text field) to lov.
    i changed the mcategory to lov with submit.
    i created a branch to the same page for the lov.
    when i run the app and change the mcategory the page submit but does not save the change.
    i also cant change the source used to "only when curren ..." because the source type is "db coulmn"
    thats my problem , i just want to create a cascade lov on this form .
    here is the example
    http://htmldb.oracle.com/pls/otn/f?p=19496

  • How to add item to a List with a bounded wildcard

    Hi,
    Is there a way to add a subtype instance to a List with a bounded wildcard? For example, say I have an
    abstract class called Car. Then I have 2 concrete subclasses--Ford and Toyota. Now say I have another
    class that contains a prepopulated list and is wildcard bounded like this: List<? extends Car> carList. I
    want to add a method where I pass in a Car subtype as a parameter and then add it into this list, e.g:
    public void addCar(Car car) {
    carList.add(car);
    Trying this, I keep getting "cannot find symbol" compilation errors. When I went back to read the Generics
    tutorial by Bracha, he mentions that explicitly adding a subtype, e.g. carList.add(new Ford()), can not be
    done. But here I'm adding the "upper bound" of the wildcard, i.e. the Car type. Therefore there should be no
    discrepancy between supertype and subtype an thus the carList.add(car) should be ok, IMO.
    Am I misunderstanding something with this logic? Also, if carList.add(car) can not be done, then how can
    I go about doing something similar which will allow me to add subtypes to a "generic" list?
    Thanks in advanced!
    -los

    I get a compilation error expecting an Object instead of a Car. Of course you did. List<? super Car> is a list into which you can put cars -- and possibly other stuff. List<? extends Car> is a list out of which you can get cars (possibly of different makes).
    Do you need a list that you can put cars in and get cars out? That's List<Car>
    This isn't a linguistic problem you are having; this is a design problem. If you have a function that takes an argument which is a list that you can put any kind of car into and be sure of getting a car out of, it isn't reasonable to pass in a List<Ford> (because the function might put in a Chevy) or a List<Object> (but there might be motorcycles already in there). By the requirements you have, you need a List<Car> and nothing else.
    Yes, you could use a cast, but all you are doing is circumventing the type system by saying "I know this List<Object> only has Cars in it."

  • Excel 2010 Synchronize List with SharePoint List using VBA

    I have used and loved the interaction between Excel and SharePoint for many generations of both solutions.  It's a wonderful opportunity to integrate the familiarity and simplicity of Excel (formatting, ease of use, availability) with the data storage
    and centralized list capabilities of SharePoint.  Right?
    When upgrading to Excel 2010, I have noticed with much dismay that much of the inherent easy to use features of previous versions were effectively stripped from this newest version.  Much research, time and energy has been spent working around and resolving
    the deficiency.  One Microsoft based article,
    http://support.microsoft.com/kb/930006, has provided the mechanics behind utilizing the "hidden" functionality... although, this capability to use VBA to create the synchronized list was available in previous versions.  However, once Microsoft
    published this article to this "hidden" functionality... I feel that the behavior should be supported by Microsoft in some way.  OK?
    Revised instructions to reproduce the problem:
    1. Create a SharePoint list with 20 dummy records.
    - Note the List Name  ##LIST_NAME##
    - Note the View GUID  ##VIEW_GUID##
    - Note SharePoint Base URL  ##BASE_URL##
    2. REVISED... In Excel 2010, save the file as Compatible "Excel 97-2003 Workbook".  Close the file and reopen.  Create a connected table (ListObject) in Excel using the article above to the SharePoint list.  Use Sample VBA code
    below:
    Sub LinkedSharePointList()    
    ActiveSheet.ListObjects.Add SourceType:=xlSrcExternal,_
        Source:=Array(##BASE_URL## & "/_vti_bin", ##LIST_NAME##, _
        ##VIEW_GUID##), LinkSource:=True, Destination:=Range("A1")
    End Sub
    3. OOPS REVISED this item.  The problem is actually with ROW 21... So, update record on row 21... (no matter where the table is located... (if the "Destination" is "A1", then the problem is with ID=20, but if the Table is
    shifted down to say A12, then ID=9 on row 21).  Anyway... make a simple change to that record... and you'll see the ID immediately change.... as if it's a NEW record.  WEIRD!  Note: If the sheet is protected, then an error is displayed
    indicating that a "read-only" record cannot be updated (referring to the ID cell in column A for the current row). 
    4. Now "synchronize" the list with excel.  The former record is still in the list unchanged AND there is a NEW record in the list holding the changes.  There are a number of problems that seem to ONLY occur when something changes to ROW
    21.... Next, try to copy/paste multiple records across multiple rows that intersect with ROW 21.  Yikes!! 
    I look forward to hearing others' experience!
    Thanks!
    Mark

    Here are some things that you can try (change the code, where appropriate):
    Private Sub CreateList()
        Dim folder As folder
        Dim f As File
        Dim fs As New FileSystemObject
        Dim RowCtr As Integer
        RowCtr = 1
        Set folder = fs.GetFolder("http://excel-pc:43231/Shared Documents/Forms/") '<=Variable Location
        For Each f In folder.Files
           Cells(RowCtr, 1).Value = f.Name
           RowCtr = RowCtr + 1
        Next f
    End Sub
    Sub ListAllFile()
     Dim objFSO As Object
     Dim objFolder As Object
     Dim objFile As Object
     Dim pth As String
     Dim WBn As Workbook
     Dim ObCount As Long
     Dim FileNme As String
     Application.ScreenUpdating = False
     Set objFSO = CreateObject("Scripting.FileSystemObject")
     'Get the folder object associated with the directory
     Set objFolder = objFSO.GetFolder("\\excel-pc:43231\Shared Documents\Forms\")
    '** You'll need to specify your path here. By removing the http: from the path, the code liked it & found the folder. It wasn’t working previously ***
     pth = "http://excel-pc:43231/Shared Documents/Forms/"
    '** You'll need to specify your path here. The reason I’ve done this separately is because the path is not recognised otherwise when trying to specify it with workbook.open & using the value set for objFolder **
     ObCount = objFolder.Files.Count
    '** counts the number of files in the folder
     'Loop through the Files collection
     For Each objFile In objFolder.Files
     Nm1 = Len("http://excel-pc:43231/Shared Documents/Forms/")
    '** You'll need to specify your path here **
     Nm2 = Len(objFile) - Nm1
     FileNme = Right(objFile, Nm2)
    '** I’ve done this part to find out/set the file name**
     Set WBn = Workbooks.Open(pth & FileNme, , , , Password:="YourPassword")
    '** opens the first file in the library – if there is no password, the remove everything from - , , , , Password:="Password1" – leaving the close bracket ‘)’
     Application.ScreenUpdating = False
    '** optional – you can leave the screen updating on
    '<< Your coding here>>
    '** The file is now open. Enter whatever code is specific to your spreadsheets.
     Next
    '** goes to next file within your sharepoint folder
    End Sub
    Sub SharePoint()
    Dim xlFile As String, xlFullFile As String
    Dim xlApp As Excel.Application
    Dim wb As Workbook
    xlFile = "\\excel-pc:43231\Shared Documents"
    'http://excel-pc:43231/Shared Documents/
    '****----denotes the path.(i.e) u give the path as windows search.Don't use "\" at the end.
    'In the sharepoint path %20 denotes space.so u remove that and use space .
    Set xlApp = New Excel.Application
    xlApp.Visible = True
    xlFullFile = GetFullFileName(xlFile, "Book") 'ANZ denotes starting characters of the file.
    xlFile = xlFile & "\" & xlFullFile
    Set wb = xlApp.Workbooks.Open(xlFile, , False)
    'Once the workbook is opened u can do ur code here
    wb.Close False
    End Sub
    Function GetFullFileName(strfilepath As String, _
    strFileNamePartial As String) As String
    Dim objFS As Variant
    Dim objFolder As Variant
    Dim objFile As Variant
    Dim intLengthOfPartialName As Integer
    Dim strfilenamefull As String
    Set objFS = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFS.GetFolder(strfilepath)
    'work out how long the partial file name is
    intLengthOfPartialName = Len(strFileNamePartial)
    For Each objFile In objFolder.Files 'Instead of specifying the starting characters of the file you can directly loop through all files in the folder .
    'Test to see if the file matches the partial file name
    If Left(objFile.Name, intLengthOfPartialName) = strFileNamePartial Then
    'get the full file name
    strfilenamefull = objFile.Name
    Exit For
    Else
    End If
    Next objFile
    Set objFolder = Nothing
    Set objFS = Nothing
    'Return the full file name as the function's value
    GetFullFileName = strfilenamefull
    End Function
    Sub SrchForFiles()
    ' Searches the selected folders and sub folders for files with the specified (xls) extension.
    'ListTheFiles 'get the list of all the target XLS files on the SharePoint Directory
    Dim i As Long, z As Long, Rw As Long, ii As Long
    Dim ws As Worksheet, dd As Worksheet
    Dim y As Variant
    Dim fldr As String, fil As String, FPath As String
    Dim LocName As String
    Dim FString As String
    Dim SummaryWB As Workbook
    Dim SummaryWS As Worksheet
    Dim Raw_WS As Worksheet
    Dim LastRow As Long, FirstRow As Long, RowsOfData As Long
    Dim UseData As Boolean
    Dim FirstBlankRow As Long
    'grab current location for later reference, for where to paste final data
    Set SummaryWB = Application.ActiveWorkbook
    Set SummaryWS = Application.ActiveWorkbook.ActiveSheet
    y = "xls"
    fldr = "\\excel-pc:43231\Shared%20Documents\Forms\AllItems.aspx"
    FirstBlankRow = 2
    'asd is a 1-D array of files returned
    asd = ListFiles(fldr, True)
    Set ws = Excel.ThisWorkbook.Worksheets(1) 'list of files
    ws.Activate
    ws.Range("A1:Z100").Select
    Selection.Clear
    On Error GoTo 0
    For ii = LBound(asd) To UBound(asd)
    Debug.Print Dir(asd(ii))
    fil = asd(ii)
    'open the file and grab the data
    Application.Workbooks.Open (fil), False, True
    'Get file path from file name
    FPath = Left(fil, Len(fil) - Len(Split(fil, "\")(UBound(Split(fil, "\")))) - 1)
    'Get file information
    If Left$(fil, 1) = Left$(fldr, 1) Then
    If CBool(Len(Dir(fil))) Then
    z = z + 1
    ws.Cells(z + 1, 1).Resize(, 6) = _
    Array(Dir(fil), LocName, RowsOfData, Round((FileLen(fil) / 1000), 0), FileDateTime(fil), FPath)
    DoEvents
    With ws
    .Hyperlinks.Add .Range("A" & CStr(z + 1)), fil
    '.FoundFiles(i)
    End With
    End If
    End If
    'Workbooks.Close 'Fil
    Application.CutCopyMode = False 'Clear Clipboard
    Workbooks(Dir(fil)).Close SaveChanges:=False
    Next ii
    With ws
    Rw = .Cells.Rows.Count
    With .[A1:F1]
    .Value = [{"Full Name","Location","Rows of Data","Kilobytes","Last Modified", "Path"}]
    .Font.Underline = xlUnderlineStyleSingle
    .EntireColumn.AutoFit
    .HorizontalAlignment = xlCenter
    End With
    .[G1:IV1 ].EntireColumn.Hidden = True
    On Error Resume Next
    'Range(Cells(Rw, "A").End(3)(2), Cells(Rw, "A")).EntireRow.Hidden = True
    Range(.[A2 ], Cells(Rw, "C")).Sort [A2 ], xlAscending, Header:=xlNo
    End With
    End Sub
    Function ListFiles(ByVal Path As String, Optional ByVal NestedDirs As Boolean) _
    As String()
    Dim fso As New Scripting.FileSystemObject
    Dim fld As Scripting.folder
    Dim fileList As String
    ' get the starting folder
    Set fld = fso.GetFolder(Path)
    ' let the private subroutine do all the work
    fileList = ListFilesPriv(fld, NestedDirs)
    ' (the first element will be a null string unless the first ";" is removed)
    fileList = Right(fileList, Len(fileList) - 1)
    ' convert to a string array
    ListFiles = Split(fileList, ";")
    End Function
    ' private procedure that returns a file list
    ' as a comma-delimited list of files
    Function ListFilesPriv(ByVal fld As Scripting.folder, _
    ByVal NestedDirs As Boolean) As String
    Dim fil As Scripting.File
    Dim subfld As Scripting.folder
    ' list all the files in this directory
    For Each fil In fld.Files
    'If UCase(Left(Dir(fil), 5)) = "MULTI" And fil.Type = "Microsoft Excel Worksheet" Then
    If fil.Type = "Microsoft Excel Worksheet" Then
    ListFilesPriv = ListFilesPriv & ";" & fil.Path
    Debug.Print fil.Path
    End If
    Next
    ' if requested, search also subdirectories
    If NestedDirs Then
    For Each subfld In fld.SubFolders
    ListFilesPriv = ListFilesPriv & ListFilesPriv(subfld, NestedDirs)
    Next
    End If
    End Function
    Finally . . .
    Sub ListFiles()
        Dim folder As Variant
        Dim f As File
        Dim fs As New FileSystemObject
        Dim RowCtr As Integer
        Dim FPath As String
        Dim wb As Workbook
        RowCtr = 1
        FPath = "http://excel-pc:43231/Shared Documents"
        For Each f In FPath
        'Set folder = fs.GetFolder("C:\Users\Excel\Desktop\Ryan_Folder")
        'For Each f In folder.Files
           Cells(RowCtr, 1).Value = f.Name
           RowCtr = RowCtr + 1
        Next f
    End Sub
    Sub test()
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        Set objFolder = objFSO.GetFolder("C:\Users\Excel\Desktop\Ryan_Folder")
        'Set colSubfolders = objFolder.SubFolders
        'For Each objSubfolder In colSubfolders
           Cells(RowCtr, 1).Value = f.Name
           RowCtr = RowCtr + 1
        'Next
    End Sub
    Ryan Shuell

  • Select list with bind variable does not work

    Hi,
    What can be wrong with a 'select list' with the a simple select
    select omschrijving o, id i
    from basiscodes b
    where domein = 'OPTIES'
    and b.id in
    (select eo.basiscode_id from evenementen_opties eo
    where eo.event_id = :P16_ID)
    The :P16_ID has a value and should give result
    But it does not work at all with 'select list'
    Using the POPUP LOV (display discription, return key value) works nice
    The select retuns less then 10 records

    Hi Flavio,
    As I explained, the P16_ID is an item of the master page (page 16)
    In Page 18 where I want to reuse that value, the item is not there, but I use it to assign
    P18_EVENT_ID with the value in P16_ID and that works fine.
    In an after submit process, I do this :
    declare
    function get_pk return varchar2
    is
    begin
    for c1 in (select EVENEMENT_INSCHRIJVING_SEQ.nextval next_val
    from dual)
    loop
    return c1.next_val;
    end loop;
    end;
    begin
    :P18_ID := get_pk;
    :P18_EVENT_ID := :P16_ID;
    :P18_CREATIE_DT := TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS');
    :P18_CREATIE_USER := APEX_APPLICATION.G_USER;
    end;
    The value P16_ID is there before I open page 18
    I made a display item that displays the value P16_ID
    If I change the LOV select in :
    select b.omschrijving o, b.id i
    from basiscodes b
    , evenementen_opties eo
    where b.domein = 'OPTIES'
    and b.id = eo.basiscode_id
    and eo.event_id = 16
    then it returns the value I want : 1 record
    You see, I'm a really new one in apex.
    Forms 6i was easier for me...
    Regards Jules
    null

  • How to access the value of fiedl ( select list with redirect )

    WE created one report and form. When i click in the edit button of the report
    for the specific record ; the system go automatically in the form
    and show me all the information. In my form ia have some fields ( select list with redirect ) in this way i store the key but i can see the description.
    I want to control the delete operation in checking the value of some field
    in my form. How can i do that. When i verfy the content with SESSION
    my variable are empty
    Thanks
    Marc Fortin

    Hello Larry,
    You can use a select list with submit and create a branch to the page you want to go to.
    Hope that helps.
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/

  • I'm having trouble sharing my i pod list with my other computer. I authorized both computer's, but list is not showing up in my laptop. (2nd generation Ipod nano)

    I'm having trouble sharing my Ipod list with my other computer. ( lap top) I authorized both computer's for home sharing but the list is not showing up on my laptop. My I pod is a second generation nano. So how do I get it to show up on my laptop?.  Also I only have two computer's but it's authorized with 4, two were old computer's, how do I take them off the list without deauthorizing all 4 computer's,? Or do I have to deauthorize all 4 and then authorize the two I have now? my desk top pc is operating on vista, and my laptop is operating on 7. Does that make a difference? HELP! thank you.

    iTunes Store: About authorization and deauthorization
    iTunes 10 for Windows: Authorize a computer to play iTunes Store purchases
    iTunes: Frequently asked questions about viewing and syncing videos
    iTunes 10 for Windows: authorize
    iPod appears in Windows but not in iTunes
    iPod not recognized in 'My Computer' and in iTunes for Windows

  • Error while uploading the general maintenance task list with LSMW

    Hi friends,
    I am uploading the general maintenance task list with the help of Standard Batch/Direct input method in LSMW. I am using the internal number range for task list.
    First task list is getting created properly, but while creating second task list, system is giving the error as "external number range is not assigned for task list and task list with this group ID is already created in the system."
    This is because, on initial screen, system automatically takes the group ID of the task list that is created earlier.
    My question is
    1. How to get rid of the group number that is automatically gets populated in group field of initial screen, while creating the next task list?
    2. Is it possible to assign a common identifier in all structure (Header, Operation etc) for single task list, so that system can differentiate between two task lists?
    In Equipment task list, we can differentiate the task list with equipment id and group counter.
    Please note the following point before replying to my question.
    1. I don't want to upload the general maintenance task list with external number assignment.
    Thanks in advance for early reply.

    I have the same problem....
    Please can somebody help me?

  • Select List with Submit - Branch Error - form data does not save

    I am a new APEX user so please excuse my ignorance. I have created a simple application in which a primary data entry form branches either to a detail form (one to many on the parent ID) or a master tabular report used for navigation. These branches work fine. Then I tried to get a little fancy with a conditionally displayed element based on the value the user selects in a select list on the main form(P9_REPORT_TYPE). I converted the select list to a select list with submit and created a new branch (on submit - after processing) to the current page (Page 9) to avoid the "no branch found" error. To avoid the branch being unconditional, I tried to use the 'Request = Expression1' condition with the Expression 1 field set to P9_REPORT_TYPE. The behavior I get is that the page seems to submit but the data on the form is not saved -- even the new value selected in P9_REPORT_TYPE reverts to the old value. I simply need the page data to submit so that the conditionally displayed element will take effect (which it does if you use one of the other button-based branches and then return to the form). Do I have the syntax wrong? It seems like this should be straightforward but I've tried a number of options including using a PL/SQL condition V('REQUEST')='P9_REPORT_TYPE' with no success. I'm guessing that the value of Request is getting cleared before it has a chance to trigger the branch? Any help would be greatly appreciated.

    Exactly so! Thanks Scott for setting me straight. For the benefit of other readers, the value in the Source Used column had been set to "Always, replacing any existing value in session state" and should have been set to "Only when current value in session state is null".

  • Populating dropdown list with entries in multiple text boxes?

    I'm creating a form that needs to be simple to use and complete.  I would like to be able to populate a drop-down list with entries the user puts into text boxes.  Can this be done?
    For more detail:
    In one location is a table, the use will type into a text box a Project Name, then other information such as location and total acres.
    In another location I've got a table where the user will enter the offerings from each project they listed in the 1st table.  It is a long table as it is, I cannot combine the two (will not fit on one page if I do combine them). 
    Instead of making the user type in the project names multiple times, I'd like to be able to take the project names the users input (from table one) and have those entries automatically populate the dropdown list in the second table.
    Any suggestions would be greatly appreciated!!!

    Not exactly a find and replace but you can do it.
    Select the text frames yu want to change the colors using the shift key to click select the frames.
    Then go to Edit>Edit Color>Recolor Art
    You wll see a dialog with red and black bars along side two shorter bars click the shorter bars to select a New Color a color picker will appear you can use the swatches or the color mixer.
    There is a live preview /so you will see the change in case you want to pick a different gray, of course you can always go back to the recolor art dialog.
    I am afraid you manually have to select text frames with multiple colors in order to accomplish what you want but the method above I believe is the only want to change the colors.
    This video shows how the dialog works but pretend the one frame I did not select is another color.
    http://www.wadezimmerman.com/videos/RecolorText.mov

  • Bug in rendering static list with Hierarchical Expanding template?

    Hi,
    on http://apex.oracle.com/pls/apex/f?p=23910 I prepared test case for my problem. It is static list with template Hierarchical Expanding and following structure:
    1
      1.1
        1.1.1
      1.2
        1.2.1
    2
    Entry 1.2 has condition set to never. And the problem is, as you can see, that entry 2 seems to be under entry 1.1. But really it isn't. Reason of this strange look is that in some cases, when condition for last entry in sublist is evaluted as false, there isn't generated tag </ul> closing that sublist, in this case are not closed even two sublists - under entries 1 and 1.1.
    In my real application it is more complicated, I have static list with about 80 entries (report menu) and every user sees some reports based on his position in organization structure and other conditions. And as you can imagine, this bug produces really confusing results, almost unique for every user.
    Did anybody meet this problem too? We are on ApEx 4.1.0, it is present in 4.1.1 too (as seen on apex.oracle.com)... And I think it wasn't problem in 4.0 (at least nobody noticed for few months and I believe somebody would notice that reports for one department are under reports for another one). Used theme is standard theme 2 - Builder Blue.
    Jirka

    update:
    I tried deriving the full path for the image file by viewing the source when I embedded it in an HTML region on the same page and it gives me something similar to the following URL:
    wwv_flow_file_mgr.get_file?p_security_group_id=502133210878128108&p_fname=myImage.gif
    (p.s. it is a .gif file - not sure if this should make any material difference)
    As a result, I tried embedding this into the code:
    <fo:block>
    <fo:external-graphic src="wwv_flow_file_mgr.get_file?p_security_group_id=502133210878128108&p_fname=myImage.gif)"/>
    </fo:block>
    but this time, instead of merely not rendering, when Acrobat opens, an error message appeared reported that the file was corrupted or invalid. When trying different formats, I seem to get a generic: "500 Internal Server Error".
    I'm going to try putting the image file in the server directory tree to see if that will work. I'll post later either way.

Maybe you are looking for