How do I use an enhanced for loop / for each on my ViewObjectImpl ?

Guys and Gals,
With all of my newly acquired Java knowledge in tow, I spent this weekend cleaning up all of my code, dealing mainly with for loops. I converted them from a huge mess to a for each type loop using language such as ...
    RowSet priceUpdateRows = (RowSet)((PriceUpdatesViewRowImpl) priceUpdate).getPriceUpdateRowsView();
    for (Row priceUpdateRow: priceUpdateRows)
    { // do operations on row... which makes perfect sense to me. For each Row in the RowSet, do something. It doesn't, however, makes sense to the compiler. It pouts and gives me a "foreach not applicable to expression type" error. So I read up on iterators and such, messed with code examples, and still can't get the RowSet to iterate with the above code. Could I make RowSet implement Iterable? How would I do that? I tried to create a class called RowSetExt which extended RowSet and implemented Iterable, but then I got a class cast exception.
I know I could implement something like the following or a while(hasNext()) but they're really not what I'm looking for.
ViewObject vo = … < Get ViewObject > …
RowSetIterator rsi = vo.createRowSetIterator("rowsRSI");
while (rsi.hasNext())
     Row row = rsi.next();
     row.setAttribute("YourAttribute",your_value);
     rsi.closeRowSetIterator();How do I make the for(Row row : <RowSet>) example work? Or could someone point me in a direction?
Will

One thing I tried was to make a framework extension class for my ViewObjectImpls
public class PcsViewObjectImpl
  extends ViewObjectImpl
  implements Iterable<Row>
  Set<Row> set = new HashSet<Row>();
  public Iterator<Row> getRows()
    return set.iterator();
  public Iterator<Row> iterator()
    return getRows();
}AppModuleImpl
    PriceUpdateRowsViewRowImpl priceUpdateRows = (PriceUpdateRowsViewRowImpl)((PriceUpdatesViewRowImpl) priceUpdate).getPriceUpdateRowsView();
    for (Row priceUpdateRow: priceUpdateRows)
    {However, this gives me a class cast exception at runtime. But I would think some kind of extension class would be the way to go ... ?

Similar Messages

  • How do i use an external hard drive for all my itunes music?

    how do i use an external hard drive for all my itunes music?

    Hi valleydave,
    Here are two good links for you to check out:
    http://support.apple.com/kb/ht1751
    http://support.apple.com/kb/ht1449
    The first one goes over, in-depth, what you're looking for in regards to "off site" iTunes.

  • How can I use my external hard drive for my iphoto instead of my mac book pro memory?

    i don't know if this question has been asked before: how can I use my external hard drive for my iphoto instead of my mac book pro memory? just like itunes all my song are save on my external hard drive. make sense?

    Moving the iPhoto library is safe and simple - quit iPhoto and drag the iPhoto library intact as a single entity to the external drive - depress the option key and launch iPhoto using the "select library" option to point to the new location on the external drive - fully test it and then trash the old library on the internal drive (test one more time prior to emptying the trash)
    And be sure that the External drive is formatted Mac OS extended (journaled) (iPhoto does not work with drives with other formats) and that it is always available prior to launching iPhoto
    And backup soon and often - having your iPhoto library on an external drive is not a backup and if you are using Time Machine you need to check and be sure that TM is backing up your external drive
    LN

  • How can i use 2 different apple ids for imessage and facetime on 1 ipad?

    How can i use 2 different apple ids for imessage and facetime on 1 ipad?

    Do you mean can you use one Apple ID for FaceTime and one for iMessage? You should be able to. Or, do you mean, can you log into iMessage (or FaceTime) with two Apple IDs at once? No.

  • How do I use a Sony DCR-TRV310 for FaceTime in a Mac mini 2009?

    How do I use a Sony DCR-TRV310 for FaceTime in a Mac mini 2009? Sorry, I mean Mini mid2010.
    Message was edited by: tesoro1

    lllaass speaks the truth. Macs have always been "plug & play" with everything except cameras. That's the one area where you MUST have compatible hardware or you're simply S.O.L.

  • Hi, I have small problem, for some time in music area I had two folders to use 1. Apple loops for soundtrack pro 2. Final Cut pro sound effects now both are gray and with out content may I know what happend

    Hi, I have small problem, for some time in music area I had two folders to use 1. Apple loops for soundtrack pro 2. Final Cut pro sound effects now both are gray and with out content may I know what happend

    I just went through this and it appears that my Focusrite Saffire was the culprit. I connected all the outputs on the focusrite according to the way the jacsk on the back were labeled and then set up the multichannel speaker setup to match. Then I went into STP, created a pink noise clip and panned it around, the LFE, center and rears were not in the right place.
    I reconnected the hardware to match the 5.1 pan pot in STP then changed the multichannel speaker setup to match. Everything appears to be correct now but I would have loved to have been able to just assigned the output busses to correct outputs in the saffire.
    Next step is to pan that pink noise around with my SPL meter to calibrate the room.

  • I need to clarify how I can use adobe as a host for my site for free. I see where business catalyst is supposed to be temporary as well as it is recommended to use as the better alternative to launch my muse site. But then I have to use the long

    I need to clarify how I can use adobe as a host for my site for free. I see where business catalyst is supposed to be temporary as well as it is recommended to use as the better alternative to launch my muse site. But then I have to use the long extension of "businesscatalyst" in addition to the domain name I'd prefer. How exactly can I take it live? do I have to use a third party hosting?

    Hi,
    Once you are done with your sitet, Click on Publish in Muse, select New Site from the drop down, It will ask you a name for your site, which will be used for  site url, you will get a url like mysite.businesscatalyst.com, then go to the browser and login to the admin panel, mysite.businesscatalyst.com/admin and on Dashboard, click Launch site. This will push your site live, and you can then add your custom domain.
    Also make sure that you have completed all these actions mentioned here
    User manual
    Do let me know if you have any question.

  • How can i use JS files in ADF for language translation.

    Hi,
    I have JS for different languages and dn't want to convert them to property files(resource bundle files). How can i use JS files in ADF for language translation.
    Thanks

    Hi ILya Cyclone,
    Thanks alotfor the reply. Can you tell me where should i include this in the jspx page.
    Step 1)
    I have the js file as js/ifl_messages_US.js and i created a resource file as you mentioned: JS_FILE_PATH=js/ifl_messages_US.js
    Step 2)
    Then added the entry in faces-config.xml for the resource file as follow:
    <resource-bundle>
    <base-name>resource_en.properties</base-name>
    <var>resource</var>
    </resource-bundle>
    <locale-config>
    <supported-locale>en</supported-locale>
    </locale-config>
    Step 3) This is my jspx page. In which a table is dynamically created on page load. Can you help me where should i enter the "#{resource.JS_FILE_PATH}"
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:messages id="m1"/>
    <af:resource type="javascript" source="/js/pdfFile.js"/>
    <af:form id="f1">
    <input type="hidden" name="checkRadio" id="checkRadio" value=""/>
    <af:panelGroupLayout id="pgl1" halign="left" layout="vertical">
    <af:image source="/images/BRAND_IMAGE.gif" id="i1"/>
    </af:panelGroupLayout>
    <af:spacer width="10" height="10" id="s1"/>
    <af:table varStatus="rowStat" summary="table"
    value="#{backingBeanScope.DummyBean.collectionModel}"
    rows="#{backingBeanScope.DummyBean.collectionModel.rowCount}"
    rowSelection="none" contentDelivery="immediate" var="row"
    rendered="true" id="t1" styleClass="AFStretchWidth"
    binding="#{backingBeanScope.DummyBean.myTableBinding}"
    columnResizing="disabled">
    <af:column id="c2" headerText="Actions">
    <af:activeOutputText value="#{row.Actions}" id="aot2"/>
    <af:goLink text="#{row.Actions}" id="gl1"
    clientComponent="true" visible="false"/>
    <af:selectBooleanRadio text="" id="sbr1"
    valueChangeListener="#{backingBeanScope.DummyBean.checkselectbox}">
    <af:clientListener method="selectCheckBox" type="click"/>
    </af:selectBooleanRadio>
    </af:column>
    <af:forEach items="#{backingBeanScope.DummyBean.columnNames}" end="#{backingBeanScope.DummyBean.columnSize}"
    var="name" begin="1">
    <af:column sortable="false" sortProperty="#{name}"
    rowHeader="unstyled" headerText="#{name}"
    inlineStyle="width:100px;" id="c1">
    <af:activeOutputText value="#{row[name]}" id="aot1" escape="false">
    </af:activeOutputText>
    <!-- <af:outputFormatted value="#{row[name]}" id="of1"/>-->
    <!--<af:goLink text="goLink 1" id="gl1"
    destination="#{row.bindings.url.inputvalue}"/>-->
    </af:column>
    </af:forEach>
    </af:table>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    Thanks in advance

  • How do we use Data rules/error table for source validation?

    How do we use Data rules/error table for source validation?
    We are using OWB repository 10.2.0.3.0 and OWB client 10.2.0.3.33. The Oracle version is 10 G (10.2.0.3.0). OWB is installed on Linux.
    I reviewed the posting
    Re: Using Data Rules
    Thanks for this forum.
    I want to apply data rules to source table/view and rule violated rows should go to defined error table. Here is an example.
    Table ProjectA
    Pro_ID Number(10)
    Project_name Varchar(50)
    Pro_date Date
    As per above posting, I created the table in object editor, created the data rule
    NAME_NOT_NULL (ie project name not null). I specified the shadow table name as ProjectA_ERR
    In mapping editor, I have projectA as source. I did not find error table name and defined data rules in table properties. It is not showing up the ERR group in source table
    How do we bring the defined data rules and error table into mapping?
    Are there any additional steps/process?
    Any idea ?
    Thanks in advance.
    RI

    Hi,
    Thanks for your reply/pointer. I reviewed the blog. It is interesting.
    What is the version of OWB used in this blog?
    After defining data rule/shadow table, I deployed the table via CC. It created a error table and created the all the source coulmns in alphabatical order. If I have the primary key as 1st coulmn (which does not start with 'A') in my source, it will apprear middle of of columns in error table.
    How do we prevent/workaround this?
    If I have source(view) in sch A, how do we create Error table in Sch B for source(view)?
    Is it feasible?
    I brought the error table details in mapping. Configured the data rules/error tables.
    If I picked up 'MOVE TO ERROR' option, I am getting "VLD-2802 Missing delete matching criteria in table. the condition is needed because the operator contain at least one data rule with a MOVE TO ERROR action"
    On condition Loading - I have 'All constraints' for matching criteria.
    I changed to "no constraints' still I get the above error.
    If I change to 'REPORT' option instead of 'MOVE TO ERROR' option, error goes off.
    Any idea?
    Thanks in advance.
    RI

  • How I can use my galaxy II only for camera and wifi while I am traveling out of states without any extra charge?

    How I can use my galaxy II only for camera and  while I am traveling out of states without any extra charge?

    i think you can put the device in airplane mode then selectively turn on wifi...
    before you travel you could try this and check your cellular usage on the settings ! mobile data display. you might be able to turn mobile data / cellular radio off that way as well.

  • How to Syncing using iTunes 11.1.5 for Windows

    How to Syncing using iTunes 11.1.5 for Windows

    The same way one would sync with any other version of iTunes.
    Connect the device.
    Select the content desired to sync.
    Sync.

  • How to write "for loop" for this block in as3?

    hello all, could you please help me to write a for loop for the following code?
    PS: bx1,bx,2bx3... are movie clips, xfir1,xsay1,xad1,xtip1,xdil1 are dynamic text boxes.
    var xmlLoader9:URLLoader = new URLLoader();
    xmlLoader9.addEventListener(Event.COMPLETE, showXML99);
    xmlLoader9.load(new URLRequest("spops.xml"));
    function showXML99(e:Event):void
    XML.ignoreWhitespace = true;
    var fir:XML = new XML(e.target.data);
    bx1.xfir1.text =  fir.sno[0].aa.text();
    bx1.xsay1.text =  fir.sno[0].bb.text();
    bx1.xad1.text  =  fir.sno[0].cc.text();
    bx1.xtip1.text =  fir.sno[0].dd.text();
    bx1.xdil1.text =  fir.sno[0].ee.text();
    bx2.xfir2.text =  fir.sno[1].aa.text();
    bx2.xsay2.text =  fir.sno[1].bb.text();
    bx2.xad2.text  =  fir.sno[1].cc.text();
    bx2.xtip2.text =  fir.sno[1].dd.text();
    bx2.xdil2.text =  fir.sno[1].ee.text();
    bx3.xfir3.text =  fir.sno[2].aa.text();
    bx3.xsay3.text =  fir.sno[2].b.text();
    bx3.xad3.text  =  fir.sno[2].cc.text();
    bx3.xtip3.text =  fir.sno[2].dd.text();
    bx3.xdil3.text =  fir.sno[2].ee.text();

    And for the second, try this:
    var stThings:Array = [st1, st2, st3];
    var bxThings:Array = [bx1, bx2, bx3]
    var globalURLRequest:URLRequest = new URLRequest ("tgs.aspx?st=1003")
    for each(var stWhat in stThings)
    stWhat.addEventListener(MouseEvent.CLICK, clickHandler);
    stWhat.addEventListener(MouseEvent.MOUSE_OVER, overHandler);
    stWhat.addEventListener(MouseEvent.MOUSE_OUT , outHandler);
    function clickHandler(event:MouseEvent):void
    navigateToURL(globalURLRequest,"_blank")
    function overHandler(event:MouseEvent):void
    var index:int = stThings.indexOf(event.target);
    bxThings[index].visible = true;
    function outHandler(event:MouseEvent):void
    var index:int = stThings.indexOf(event.target);
    bxThings[index].visible = false;
    It's difficult to interpret your code--you may want to take some time to write more readable code.
    For example, what is an 'st1'? Is it a button? What does it do?
    Consider if it were a button made to load Story 1... a much more readable name would be btnStory1.
    Also, there really is no advantage to identifying events as eeeeevt, zeeeevt and changing those.
    Pick a convention and stick to it. I prefer 'event', others use 'e' or 'evt'.
    And try to use function names that mean something, "function a1003mo(zeeevt2:MouseEvent):void {" is much more easily read as "function outHandler(event:MouseEvent):void"
    I'd be interested to see what it is you're making, I believe there are some real opportunities to optimize it.
    HTH
    -Ted

  • TS4002 how can i use a deferent apple id for iCloud on my iPhone?

    how can i use a deferent apple id for iCloud on my iPhone?

    To change the iCloud ID you have to go to Settings>iCloud, tap Delete Account, provide the password for the old ID when prompted to turn off Find My iDevice, then sign back in with the ID you wish to use.  When you delete the existing account you will get an option to keep the iCloud data on your device.
    Before deleting the account, save any photo stream photos that you want to keep to your camera roll.

  • Checkboxes: How do you use them to select geometries for display, MapViewer

    Dear all
    I am working in Oracle 10.2 and using PL/SQL. I am trying to create a procedure that generates a list of spatial layers, based on those currently contained in the database, which uses checkboxes, so that users can select which layers to display.
    Once the user has made his choices and the results are submitted, the chosen layers are displayed through MapViewer. Currently the procedure, which is still being developed, is as follows:
    PROCEDURE MAPLIST AS
    CURSOR curmaplist IS
      SELECT spatial_map_name
             spatial_map_id
             geom
       FROM spatial_map_table;
      varmaplist curmaplist%ROWTYPE;
       varchecked VARCHAR2(32767);
    BEGIN
    FOR varmaplist in curmaplist LOOP
      htp.print('<FORM>
                  <UL>
                   <LI>
                    <LABEL FOR="SM_ID||
                                curmaplist.spatial_map_id||">
                     <INPUT type="checkbox"
                            id="SM_ID||
                                curmaplist.spatial_map_id||"
                            name="SM_ID||
                                  curmaplist.spatial_map_id||"
                            value="MAP TITLE: ||
                                   curmaplist.spatial_map_name" />
                    </LABEL>
                   </LI>
                  </UL>
                 </FORM>'
      EXIT WHEN curmaplist%NOTFOUND;
       END LOOP;
    END;I am not sure how to incorporate the checked element and then make use of it. Regarding subsequent use, I wondered if an IF statement could be used.
    IF VARCHECKED = 'CHECKED' THEN...after this MapViewer XML is added, with the select statement making use of the cursor. For example:
    select curmaplist.geom
    from geg50160.spatial_map_tableFor the checked part itself, I have found the following Oracle code in Chapter 11 of Oracle Database Application Developer’s Guide - Fundamentals 10.2.
    CREATE OR REPLACE PROCEDURE handle_checkboxes ( checkboxes owa_util.ident_arr )
    AS
    BEGIN
    FOR i IN 1..checkboxes.count
    LOOP
    htp.print('<p>Checkbox value: ' || checkboxes(i));
    END LOOP;
    END;
    /However I am not certain how I would incorporate that into my code. I take it i refers to the checkbox value. I've read that .ident_arr is an array which can hold multiple values but if so I am also not sure why checkboxes are counted.
    Kind regards
    Tim

    Hi GKaiseril,
    Thanks for your reply.  That's what I'm attempting to do, but I'm largely trying to "borrow" on-line JavaScript (see below) & modify for my PDF Form, w/ rudimentary knowledge gained while surfing the web.  The Form has 30 checkboxes that I want to limit users to a max. of 4.
    So any add'l scripting tips would be most appreciated.
    Thanks!
    var NewCount = 0
    getField("Check_Box1").value === "Yes"
    {NewCount = NewCount + 1}
    getField("Check_Box2").value === "Yes"
    {NewCount = NewCount + 1}
    getField("Check_Box3").value === "Yes"
    {NewCount = NewCount + 1}
    getField("Check_Box4").value === "Yes"
    {NewCount = NewCount + 1}
    getField("Check_Box5").value === "Yes"
      {NewCount = NewCount + 1}
    if (NewCount == 4)
    app.alert(“Pick Just Four Please”); return false;

  • How do i use an active directory group for vpn and not all user

    hi all,
    i have an asa 5515x...
    how do i use a particular group in active directory to have vpn/anyconnect access?  right now i believe it's for all user on my current config,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    !integrate with active directory
    aaa-server LDAPSERVERS protocol ldap
    aaa-server LDAPSERVERS (vlan192) host 10.0.0.2
    ldap-base-dn dc=company,dc=com
    ldap-scope subtree
    ldap-naming-attribute sAMAccountName
    ldap-login-password 12345678
    ldap-login-dn cn=administrator,cn=Users,dc=company,dc=com
    server-type auto-detect
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    say i want this "vpn-group" object group in AD and my vpn is only anyconnect and no other vpn types.
    thanks for any comment you may add.

    The best way is to use Dynamic Access Policies (DAP). Cisco has a white paper (here) that shows how one can choose the LDAP group as one of the DAP criteria.
    DAP requires the Advanced Endpoint Assessment feature, so your licensing must support that.

Maybe you are looking for

  • Deleting photo's in iPhoto didn't really delete them from hard drive

    I do a lot of photography, mostly sports/action etc. I just noticed that when I delete a photo in iPhoto, it is removed from my view, but it does not go into the trash can. I can use Finder on the pic's left in the same event folder and then peek aro

  • Colour Swatches not Consistent

    I've been experiencing weird result when I copy a pattern from a illustrator file to another: the pattern would change the colours itself! Even when I save the original swatches of the colours and open them in the second file, the colours changed too

  • Execute Transaction from 4.6 SAP release

    Dears, I have to execute MII trasactions from SAP but my release is a 4.6. I have already implemented such interface but between MII and SAP EEC6 relaese by using HTTP service. In 4.6 release the class I have used in the ECC6 version (cl_http_client)

  • OCITerminate: Bad Pointer: 0x0397BC28 passed to free, argument 1.

    Using VS2005 SP1 and linking with oci.lib Bad Pointer: 0x0397BC28 passed to free, argument 1. Current Call Stack - Thread 0 [0x0630]      C:\oracle\ora102\BIN\oracore10.dll!0x0003abba           C:\oracle\ora102\BIN\oracore10.dll!0x0003541a           

  • Can not use filter

    Each time I select an aera using the "Quick Sele3ctor Tool" and try to use a filter i get the folling error message: :Could not complete (what ever the filter) command because no pixels are selected. Any help? Mike