The values of attributes and tag at the same time XML access

Hi all,

I do a few experiments with Flex, but I already have some experience with Flash and AS3.

What I try to do, is to make a small application that uses the Web services of the Weather Channel. The first part of the request is to ask the user for his location. Then the location is sent to the Web service and the system returns a XML document with possible matches. The user chooses one, and weather information are displayed.

I have no problem with navigation, or passing results from one stage to the other, but I'm having a problem, I think it's an easy fix, but I can't get a light or an answer from what I've seen of these forums or webasites... I suspect it's because the format of the XML that is returned.

For example, my request is this: http://XOAP.weather.com/search/search?where=Aveiro

wich return two possible locations, in this way:

< Search worm = "3.0" >
< loc id = "BRXX1094" type = "1" > Aveiro, Brazil < / loc >
< loc id = "POXX0006" type = "1" > Aveiro, Portugal < / loc >
< / Search >

Well, I want to display in a Datagrid control in the 'id' attribute and the 'loc' tag value, that is, "Aveiro, Brazil" and "Aveiro, Portugal.

I set the DataGrid like this:

< mx:DataGrid x = "10" y = "53" width = "365" id = "dgLocation" dataProvider = "{wSearch.lastResult.loc}"itemClick = "callService (event)"; > "
< mx:columns >
< mx:DataGridColumn headerText = "Localidade" dataField = "loc" / >
< mx:DataGridColumn headerText = "Reference" dataField="@id"/ >
< / mx:columns >
< / mx:DataGrid >

In the 'col' dataField, shows nothing, and the "@id" shows the correct information. Because I don't have that 'loc' tag in the main root tag, how can I get the values of teir? With labelFunction? How you would write it for the information?

This is my last try:

private void getLocationName(item:Object,_column:DataGridColumn):String {}
var xmlitem:XML = XML (item);
trace (XMLItem.loc.ToXmlString ());
Return item.loc;
}

Any ideas are welcome. Thank you.

This seems to work:



  
    
  
  
  
    
      
      
    
  

If this post answers your question or assistance, please mark it as such.

Greg Lafrance - Flex 2 and 3 certified ACE

www.ChikaraDev.com

Flex / development, training, AIR and Support Services

Tags: Flex

Similar Questions

  • Cannot open 2 Virtual Machines at the same time to access the same database

    People,

    Hello.
    I'm installing RAC Oracle Database 11 g 2 system with 2 Virtual Machines (rac1 and rac2) on top 3 VMPlayer.

    The VM rac1 and rac2 when one of them is stopped.
    Their locations are F:\VM_RAC\rac1 and F:\VM_RAC\rac2.


    I opened rac1 rac2 is running. But this error message appears:

    Error: "cannot open F:\VM_RAC\sharerac\asm1.vmdk drive or one instant records, that depends. Reason: cannot lock the file. »


    While rac1 running, I opened rac2. But this error message appears:

    Error: "cannot open F:\VM_RAC\sharerac\asm1.vmdk drive or one instant records, that depends. Reason: cannot lock the file. »


    2 error messages are the same. This means that I can not open 2and rac1 rac2 VMs at the same time. When we run RAC system, must open 2 "machines" or machines to more than 2 at the same time, so that all machines can access the same database server.

    My question is:

    Can all folk tell me how have rac1 and rac2 run at the same time?

    Thank you.

    Unfortunately no, Oracle RAC requires that all nodes can visit the same set of shared disks. If your database resides within the DSO, each instance ASM (one per node) must also see the same set of disks to ASM diskgroup containing the data of the database files.

    Best regards
    Bryan Wood

  • Register to search and share the invocation at the same time?

    I have an app that I want to register for the search of the OS (IE when users of start typing in the search field, my application icon shows and my application is started). To achieve this I use following in the config.xml file

        
            APPLICATION
            
                bb.action.SEARCH.EXTENDED
                application/vnd.bb.search.criteria
            
        
    

    To register as a global goal of PART I use following code:

        
            card.composer
            
                bb.action.SHARE
                application/*
                text/*
                audio/*
                image/*
                message/*
                video/*
                
            
        
    

    The problem is that I can't have both at the same time. If I register for the research, I can't use the SHARE, and if I register to SHARE, I can't use the integration of research.

    This is because of the tag in the first case, its value must be "APPLICATION", and in the second case, it must be "card.composer".

    And I can't record two with different

    Any ideas for workarounds? Or this is a limitation of the system I have to live with that?

    You have the same id for both. Use unique. I would say com.myapp.search and com.myapp.card for example.

  • USBOTG and Charge at the same time on Stream 8

    To keep this thread as productive as possible and efficient for those who find it useful to:

    Unless you have under your eyes

    1. a schematic representation of the 8 Stream USB port (USB port and battery electric circuit etc.)

    2 source code for the firmware BIOS and kernel that controls the material

    Please DO NOT respond or say "is not possible".  In view of the above is true, you do not have enough information to say '' not possible. ''

    If no one replys with a solution, what he calls not possible by default.

    Also please do not answer to say ' I don't know how "or" but I know how to do anything else that ' is also not that useful.

    An update of the BIOS or other software update may be required by HP, Microsoft or both to offer this feature really intuitive and quite possible.

    And I hope that this thread can be an effort consolidated by all who have the 8 flow to make the necessary changes.  The majority of the other tablet PCs are capable of it.  It seems that only the 8 Stream and a few others have trouble with her.

    ~~~~

    I want the ability to use a simple, inexpensive cable and perhaps standard (with electronic active minimum inside) which allows me to host and to use one or more USB devices on the Stream via its USB port B microphone 8 while this cable can also be connected to a charger standard and charge 8 flow simultaneously.  This means that the cable has a minimum of three connectors.  One of the possible configurations are as follows (apart from the normal charging cable):

    1 cable Micro USB B Male - connect to the stream 8

    2 USB male A - connect to the AC charger (IE one that came with the 8 Stream)

    3. USB A female - one or several connectors to plug into the key of USB data, keyboard, mouse or even a hub.

    Connector # 2. above shall provide a power supply to recharge the 8 Stream via conn. #1 and the power supply for external USB devices via conn. #3 so that they are in use - all at the same time.

    A and if the same cable can act as a normal OTG no charger for when no external power supply is available.  This may necessitate a switch or an electrontics active inside.

    The last part of this goal is unimportant for various reasons.  I wish that HP, the manufacturer of 8 flow, to State in writing good mode necessary to do this, so that other manufacturers or even-it yourself can make maximum use of their tablet HP equipment.

    ~~~~

    The neat thing it will alow a person to do with their tablet, it is to work at home using the Tablet as a desktop PC by connecting a keyboard, mouse, perhaps external screen (with USB to the display adapter) and knit for a long time without time limit prescribed by the battery life because the charger provides energy to all involved.

    If there is only a single connector on the cable #3, then an additional node of coarse had to provide support for these multiple USB devices at the same time.  However, it would be better if there were several #3 connectors integrated in the cable itself.  This would be better as a suitable USB hub also requires its own power.  That an adapter is necessary if the whole thing were integrated into one.

    ~~~~

    I really want answers from anyone who has already accomplished USB OTG delivered with simultaneous load with flow 8. (independent of any published 'proper' way is also welcome)

    Today's date is 2015-01-16.  If in 2015-02-16 (one month), nobody has posted a solution and then starts to bug HP and Microsoft on it's us?

    ~~~~

    Technical training:

    I understand the possibility the tablet software and firmware must take a decision on the manner in which power flows on the power port USB microphone B pins.

    I know that with a proper design of the electronic circuit carring these signals of power inside the Tablet could be sensitive to what is connected and without risk to decide for himself what to do without needing to control software.  For example by testing/detecting periodically differential voltage or current management to see what sides of the connector can supply.

    But this is only one of the many "could bes".

    In addition, this can be no standard regarding the standard USB.  What seems to be actually the case with a lot of cables OTG + fresh, is that physical clues embedded in the cable or charger are used to signal to the Tablet what the situation is.  Then the signal of software/firmware of the Tablet, interprets what the situation is intelligently and responds by flipping the bits of correct hardware control to activate, or deactivate the power flow in the port and also control its direction in or out.

    I'm not familiar with the standard USB.  Maybe I could do more research, if I believed that HP followed with 8 Stream or even the standard covered this situation explicitly.

    But to a certain extent, it seems I'll have to invent something that should be intuitively just like it does with other tablets. Isn't it?  Maybe I'm overthinking, but I can't find any USB OTG + cables load that specify compatibility with 8 HP flow.

    In any case, I was familiar with both methods other use of tablets to send the highest mentioned signal to the hardware/firmware/software of the tablet to the idea that it's time to load / time of OTG or both.

    The first method is a 0 Ohm to 200 ohms short between pin USB A 2 and 3.  This is the bidirectional data differential lines D - and D + respectively.  In data mode, all the data passes back and forth on those lines.  When you load with a cable, it's the charger module that puts this short, not on the cable.  I measured the short on three different Chargers.  It is 0 Ohms on two of them, one of those who are the charger that came with the 8 HP flow.  The others 0 ohms was generic.  The third was for an apple iPad and it measured on 53KOhms.  It's probably not the resistance ohms 0-200, but probably it is impedance termination indicating that there is some intelligent serial port communication in the charger itself.  Leave it to Apple to be different.

    This method is somewhat questionable, as this signaling mode would prevent OTG + fee because it seems unlikely that you will be able to OTG when the data lines are shorted each and overloaded with such low impedance.  I could be wrong on this subject...

    The other method I have seen suggested to work with some tablets and phones other than the 8 stream is too short the USB microphone B pin 5 to Terminal 4 with 0 Ohms to 100 000 Ohms.

    USB B has 5 pins.  USB has only 4.  The extra pin on B moves the GND pin 4 pin 5 pin to and makes pin 4 PIN ID.

    If this signal applies to a drop in the ID pin (4) or in some cases, I saw that she proposed, he runs down with 0 Ohms.

    Dead shorting things always makes me nervous.  If ID is a simple normally high impedance high input, resistance could be used to make voltage well below the low or zero threshold while also preventing the risk of damage when cheat on him with a device that you do not have the diagram for.

    Yet, 100K is a bit high for a 'pull down' in most of the situations that I'm used to.  Even a 10K would be uncertain. A 1 K or 2 K seems reliable enough, but then things are weaker and in know more nowadays low...   All but a dead short but if possible.

    So, it seems possible that the device might be able to "indicate" by the specific value of the resistance, which can be found here.  In other words the resistance is not a pull down but in fact a signature analog ID, in which case the exact value will be crucial. So if this is the case, a guess is not going to work.

    Obviously in such a system as described above, a chip inside the Stream 8 should be responsible to support this information. I hope the 8 Stream has such a chip.

    Probably a register inside this chip would be at all times what the State of the pin ID is a binary number.  All that is needed is for the BIOS to the chip and the registry in it and read this number via the bus to determine what happens to the port. Finally, he would use that signals of info to send the order of material to the electrontics of power set the appropriate direction to take etc.  (and change the State of the icon on the screen of the rude)

    I don't know if the PIN ID method described is a standard USB or not either.

    Eventually, there may be a third way. But I do not suspect that it would be possible with a non-active external device. In any case too complicated for the novice DIY for sure.

    The device would need to act is a kind of extension of bus.  As an active hub.  But she would use the negotiation of data USB serial lines and in addition to reproduce one or more additional USB ports, intelligently inform the tablet to get with the program which is "now we're going to otg and recharge at the same time."

    This requires a smart external device with a processor Inside, no doubt.

    It seems to me that many other tablets have been able achieve avecjoint here the need for a smart external device and thus the flow must also be able to do.

    There is a device that claims to be able to work with the HP Jet 7 and 8 and provides same ethernet and USB and big DVI ports so loads the data stream.  But its expensive because it is active.  Se here:

    http://AMZN.com/B00OVDE0GC

    It's called a "Docking Station".

    A reference to a product that does exactly what I want (possibly without active electronic components) is here:

    http://AMZN.com/B00LTHBCNM

    It's by Kirin and it is a device of type squid with four USB ports.  Precisely, which is my goal.  But read in the comments stream 7 user indicated that he would not be OTG and load, not really clear if it worked as a hub USB OTG or not.  Another evaluator stated that she would not support even a single USB device much less fees of 8 Stream.  This device has a switch.

    I forgot to mention that some 'hackers' have claimed success with other tablets to deceive their devices by using a multi-step process to plug things in.  Usually in general they would get connected Tablet and load first, then they would return a switch or something remove some resistance or the signal was introduced by the first position of the switch. For some reason any Tablet would continue to require. Then the data lines would be free and they would plug in a usb key and it mounts correctly even if the tablet was always in charge.

    It's like the power circuit has a lock which does not allow it to return to the mode "power flow" as long as he still feels the power flows inward regardless of what software it is telling.  Full proposal here.

    These tips seem dubious to me.  Changes in the BIOS could change the way it works.  Also you can not be sure what actually happens if you do not have a schematic representation.  You could damage your tablet.  Many people will support icon in the operating system whether the Tablet is in charge.  But I'm sort of a low-risk guy and my policy is generally indicators of intereperet not to have meaning at all once a device is functioning in a non-standard setting.  Especially when it's something that I did not built and could not fix if I FRY.

    Hypothetical reasoning: tell me what data sensory discs really the State of the charging light screen?  This reflect the bit of hardware control programs actually feeding management and status on the port?  Or does it measure the direction of the flow of power, said in the section of the circuit battery monitoring?  Point - none of us have a schema because it's owner. To really be sure according to the smart electronic hardware, the port must be mode flow under advisement "of power. If it's in a "power flow out" mode and power will be delivered externally as well you wind upward with both power supplies the same power at the wheel nets.  In this case, the two opposing regulators attempting both to drive 5 V can have slightly different voltage calibrations.  That could lead to fighting between them, with more than 100% of their capacity.  For example if you try to regulate 4.95 real V and the other and other attempts to regulate 5.05 V.  Current then flows to the tune of 100 mV / a few milliohms in the cables linking the two.  This may be several amperes. (many)  In other words, like I said: you want the tablet to know that power is coming in don't go out and automatically hitting the internal switches needed for that to happen. Probably the icon should indicate this with precision, but in some wacky situation, he could not. There may be a chance that the icon could indicate the load and still be burning or focusing on some circuits of the tablet or the charger.

    Another thing, I could see that happening is if you play with these reported resistance types enough you might find a resistance value that winds up place the device in an intermittent condition.  In other words it keeps flipping back and forth quickly between OTG and fresh.  It can give the illusion that it works.  You can have marginal communication with your USB devices and battery could even load.  But will still be a lot of stress on the power circuit.

    It is difficult for me to risk a Tablet perfectly well if I don't know exactly what I'm doing.

    If a brave individual makes their own experimentation and verifies that it charges and OTGs and you tell the rest of us, you're a hero.

    Maybe one of you has a good knowledge on the USB standard to have more confidence in such an experience... like what the ID pin 4 REALLY supposed to work for example?

    That's what I know so far.  If you think you can help, thanks in advance, or if this helped you, then your quite welcome.

    It works

    http://Accessories.us.Dell.com/SNA/ProductDetail.aspx?c=us & l = to & CS = 19 & SKU = 470-abes & baynote_bnrank = 0 & baynote_irrank = 0 & ~ CK = baynoteSearch & dgc = CJ & cid = 47997 & lid = 4279734 & acd = 10550055-4485850-eb75dcb47e53437680ed323a1f4885fe

    Evidence

    http://targusblog.com/2014/11/25/how-to-turn-a-99-Tablet-into-a-workstation/

    But it's 4 x the price in Europe

    Have fun

  • Can a single USRP 2920 tansmit (Tx) and receive (Rx) at the same time?

    I know a USRP can be a transmitter and a receiver, but a single unit can send and receive at the same time?  The application in question involves the sending of an RF signal to a label of RFID and followed by the response of the tag with a single reading USRP.  I heard that the link between the channels can cause significant on because bleeding that is not insulation between the tracks, but could not find an example showing simultaneous Tx and Rx.  Is there an example or documentation that I'm missing?

    Thank you!

    Kristen Heck

    Academic ESF - middle of Southeast

    Hello Kristen,

    The USRP can send and receive at the same time.  You have because there are bleed more because of the lack of isolation, but documentation of the USRP is always formed and includes no information about this.  Here are the 2 screws that allows you to make simultaneous TX/RX.  Just to set the IP address in the two screws to the IP address of your USRP and run them.  You may need to change the rate of IQ and the frequencies of your application, but this very basic example should be a good starting point.

    Let me know if you have any other questions, I'd be happy to help you.

  • Questions about serial port read and write at the same time

    Hi I create a user interface for the communication serial port, where there are essentially 2 front panels, where the user enters commands one and the other where the prints of UART is delivered. I thought initially using a state machine but the reading and writing may be independent sometimes and so I can't rely on States. I searched a bit on the forum and he left me even more confused. Help, please.

    (1) in a thread that sessions visa duplicated has been used for writing and reading at the same time, is it recommendable? How will this affect performance?

    (2) essentially when the vi is reading data are it must constantly view as well, however, someone said that it takes too much memory to use shift registers, so how do I go about this? If using a State in queue after the loop of reading it affects the playback loop and be sequential?

    In addition anyway is to move the cursor to the latest data from the indicator

    (3) for the control of the user input, assumes that the user has entered an order in the control and press ENTER, then writing visa is launched, but if it comes in another string and press enter then write must be called again... is - it possible? will detect the previous commands in the control of compensation?

    (4) according to my understand the expectation for the event do not monopolize resources and writing can go in parallel, am I right?

    Thank you. I have attached a very basic vi which took me to the point, but I want to make it more robust. Please help especially in the part of the user interface.

    su_a,

    (1) you can have only one session to a port. Several UART can handle full duplex so performance is not affected.  At flow rates of high data and large amounts of data, buffering and latencies of BONE can become a problem.

    (2) who told you that shift registers using too much memory? Shift registers are usually the best way to transfer data from one iteration to another. String concatenation inside a loop (registry to offset or not) causes the chain to develop and may require re-allocation of memory.  Your VI never clears the string so its cold length become very large.

    Generally, you do not have an active cursor on an indicator.  If you want to always display the most recently received characters and turn on the vertical scroll bar use a property node to keep scrolls to the bottom.  This can be annoying for users if they attempt to manually move the scroll bar and find that the program continues to move it back automatically.

    (3) if the user has changed the value in the chain of command, when he hits enter the modified value event fires.  Simply strike brace does not change the value and does not trigger the event.  Not control need to be erased, but the value that he has to change.  If you want to send the same command again, have a button send a command may be a better choice.

    (4) write is a case of the event.  It is not in parallel with anything.  The structure of the event do not monopolize resources.  The other loop will run while it waits.

    The event loop will not stop when you press the STOP button. Probably it wll take two command: change events of value after JUDGMENT before any loop stops.  Replace the Timeout event (which never expires) with a STOP: value change event and a real wire of this judgment to the Terminal endpoint.  Remove the local variable.  Make mechanical locking when released.

    Lynn

  • Why can't acquire data from strain and resistance at the same time with a NI 9219 module?

    Hello

    I use a chassis with a NI9219 module 9172 cDAQ to try to acquire the strain and resistance at the same time, with the Labview SignalExpress software.  Is this possible?  When I try to display two values of signal at the same time, I get an error of assistant DAQ 50103 'the specified resource is reserved.  The operation could not be performed as indicated.  I used to be able to acquire the strain and tension at the same time, but now even that gives me error 50103.  I have hours trying to figure this out.  Any help would be greatly appreciated.

    Thank you

    Justin

    That's all!  Thank you very much, now I can sleep tonight - seriously!

    Thanks again,

    Justin

  • How to hide a control and change a background image at the same TIME

    Hello

    I made a slideshow on LabView VI, who also monitors data in real time to a data logger.

    The program works like this: -.

    Start/Page 1:-bottom pane displays a nice screenshot. A set of indicators displays the data in real time. Switches to Page 2 after 20 seconds.

    Page 2:-background to an another screenshot. Hide indicators in real time and a set of three graphs appear, displaying historical data. Switches after 20 years.

    Page 3 etc:-hide charts and indicators, a 'slide show' appears by changing the history pane. Back to page 1 after the sequence.

    Everything works fine, except for one thing: I can't hide indicators and background to change at once, resulting in a clumsy "discrepancy" between the two.

    I did one VI example to illustrate this. Simply select two separate images to the façade, run the VI and toggle the Boolean control to see what I mean.

    Any idea how to get indicators and background of change at the same time?

    Thanks in advance,

    Hello

    Hi Jin,

    have you tried to "DeferPanelUpdates" when you power on? This is a property of the component...

    So David value = TRUE, do all the switching, to redefine Defer to FALSE!

  • Is it possible to wait in a queue and a reporter at the same time?

    Hello!

    I'm trying to implement a model event producer/consumer with queues. The problem is that I have a certain value change events (for example from a slider) I want to make the tail upward; I want only the last value change events to be processed by the loop of consumption. That's because the consumer can spend more time in the execution (sometimes several seconds) and I want to warn all the events of middle slider to be queued up pending because I write them finally to the material. Therefore, a notification utility would be preferable to use a queue here. My question is if it is possible to make the same loop of consumers to wait in the queue, as well as on the warning system at the same time? I will be wiring the VISA session and other data through consumption, if she wants to avoid an extra loop that would wait on the registrant only. Or is there another possible workaround solution?

    Thanks in advance.

    Kind regards

    Anguel

    This example has a meaning?  It is based on Mark's original proposal.

  • I want my computer show CHINESE and KOREAN at the same time.

    Original title: Non - Unicode problem

    Hi everyone, I have a problem with the word non-unicode on some programs display.

    I know how to change it to display the non-unicode language (so you don't have to teach me how to change the "language for non-unicode programs")

    BUT I want my CHINESE and KOREAN computer show at some point.

    In present value, I can only show Korean Chinese Gold at any given time.

    It is very disturbing to change between the Chinese and Korean with, I need to restart each time when I need the program to show the word Chinese and Korean.

    I can't find anything in Google/Bing/Yahoo. If someone can show me how to show 2 Non-Unicode languages at the same time?

    OS: Windows 7 Home Premium Service Pack 1 (64-bit) English Version

    To be honest, I don't think this is possible the way you describe. Maybe someone else will prove me wrong on this point. There may be third-party translation software available and short passages of text, you can always use an online translation service.  I would recommend Bing translate, Google Translate or Reference.com translator. All are very good, but none is perfect.

  • How to configure a multihomed in Windows 7, wired network and wireless networks at the same time?

    Hello

    I have a fixed computer Windows 7, I need to configure for the use of wire and wireless networks.

    On the phone we transfer vast amounts of data, astronomy cameras than only products of 20 to 30 seconds, space images 3-4 GB each. The cameras are connected to the top of a tower, which in turn is connected via a 45 feet cable CAT-5 to the search engine.

    Internet access requires a wireless network connection.

    These two connections work - separately. I have to disable an and activate the other to pass. This jump back and foth is obviously a bit inconvenient.

    How to configure Windows 7 to manage both types of networks at the same time? On another forum I learned this kind of configuration is called multihoming, and it's something difficult to achieve.

    Having studied more about it, there is another possible solution called Internet connection sharing. that may be easier. I haven't used this option for years (since the routers were introduced) but is still active.

    Disable DHCP on the Dovado or use a cable between the PC and the laptop.

    Turn on the wireless on the PC and make sure that you have an internet connection. Disable wireless on the laptop. Connect the PC's LAN ports and laptop (via router or a cable crossover).

    IN the network of PCs and next to the connections Sharing Center, you must have 2 Ethernet and WiFi options. Double click on WiFi, then on the next screen, click Properties.

    The second tab in the next screen is sharing, check allow other users of the network to connect and then OK.

    Define the IP addresses for PC and laptop as in my previous post, but this time on the laptop set the default gateway to the IP address of the Wired of the PC port, the 1st DNS to the address of the Huawei and value of secondary school who suggested for your ISP.

    This affects your PC to access wireless internet and allows the laptop to access the internet via the PC

    Basic information about ICS are HERE

    Manuals for the Dovado HERE

  • Mr President, how can I enter two rows at the same time with different default values that only the first line to use see?

    Mr President.

    My worm jdev is 12.2.1

    How to enter two rows at the same time with different default values that only the first line to use see?

    Suppose I have a table with four fields as below

    "DEBIT" VARCHAR2(7) , 
      "DRNAME" VARCHAR2(50),
      "CREDIT" VARCHAR2(7) , 
      "CRNAME" VARCHAR2(50),
    

    Now I want that when I click on a button (create an insert) to create the first line with the default values below

    firstrow.png

    So if I click on the button and then validate the second row with different values is also inserted on commit.

    The value of the second row are like the picture below

    tworows.png

    But the second row should be invisible. It could be achieved by adding vc in the vo.

    The difficult part in my question is therefore, to add the second row with the new default values.

    Because I already added default values in the first row.

    Now how to add second time default values.

    Concerning

    Mr President

    I change the code given by expensive Sameh Nassar and get my results.

    Thanks once again dear Sameh Nassar .

    My code to get my goal is

    First line of code is

        protected void doDML(int operation, TransactionEvent e) {    
    
            if(operation != DML_DELETE)
                 {
                     setAmount(getPurqty().multiply(getUnitpurprice()));
                 } 
    
            if (operation == DML_INSERT )
                       {
                               System.out.println("I am in Insert with vid= " + getVid());
                           insertSecondRowInDatabase(getVid(),getLineitem(),"6010010","SALES TAX PAYABLE",
                            (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                           }
    
            if(operation == DML_UPDATE)
                              {                                                    
    
                                 System.out.println("I am in Update with vid= " + getVid());
                             updateSecondRowInDatabase(getVid(),
                                 (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                              }                      
    
            super.doDML(operation, e);
        }
        private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object value4, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "Insert into vdet (VID,LINEITEM,DEBIT,DRNAME,AMOUNT) values " +
                 "('" + value1 + "','" + value2 + "','" + value3 + "','" + value4 + "','" + value5 + "')";  
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }
                  }  
    
                  private void updateSecondRowInDatabase(Object value1, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "update vdet set  AMOUNT='"+ value5+"' where VID='" + value1 + "'";                     
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);  
    
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }                  
    
                  }
    

    Second line code is inside a bean method

        public void addNewPurchaseVoucher(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("VoucherView1Iterator");
                   RowSetIterator rsi = dciter.getRowSetIterator();
                   Row lastRow = rsi.last();
                   int lastRowIndex = rsi.getRangeIndexOf(lastRow);
                   Row newRow = rsi.createRow();
                   newRow.setNewRowState(Row.STATUS_NEW);
                   rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
                   rsi.setCurrentRow(newRow);
    
                   BindingContainer bindings1 = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter1 = (DCIteratorBinding) bindings1.get("VdetView1Iterator");
                   RowSetIterator rsi1 = dciter1.getRowSetIterator();
                   Row lastRow1 = rsi1.last();
                   int lastRowIndex1 = rsi1.getRangeIndexOf(lastRow1);
                   Row newRow1 = rsi1.createRow();
                   newRow1.setNewRowState(Row.STATUS_NEW);
                   rsi1.insertRowAtRangeIndex(lastRowIndex1 +1, newRow1);
                   rsi1.setCurrentRow(newRow1);
        }
    

    And final saveUpdate method is

        public void saveUpdateButton(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindingsBC = BindingContext.getCurrent().getCurrentBindingsEntry();      
    
                   OperationBinding commit = bindingsBC.getOperationBinding("Commit");
                   commit.execute(); 
    
            OperationBinding operationBinding = BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Commit");
            operationBinding.execute();
            DCIteratorBinding iter = (DCIteratorBinding) BindingContext.getCurrent().getCurrentBindingsEntry().get("VdetView1Iterator");// write iterator name from pageDef.
            iter.getViewObject().executeQuery();  
    
        }
    

    Thanks for all the cooperation to obtain the desired results.

    Concerning

  • IF and Else running both at the same time.

    Hello world

    I have a strange problem underneath the small piece of code, both if and other blocks are run at the same time.

    Kindly advise on this strange behavior.

    DECLARE

    p_year varchar2 (4): = 9999;

    BEGIN

    FOR I IN (SELECT lookup_code FROM fnd_lookup_values, meaning)

    WHERE lookup_type = 'PARALLEL_ALLOCATION')

    loop

    DBMS_OUTPUT. Put_line(i.Meaning ||) e -'|| i.lookup_code);

    IF i.meaning = THEN p_year

    DBMS_OUTPUT. Put_line ("year values now");

    DBMS_OUTPUT. Put_line(i.Meaning ||) e -'|| p_year);

    on the other

    DBMS_OUTPUT. Put_line (' year values in other ');

    DBMS_OUTPUT. Put_line(i.Meaning ||) e -'|| p_year);

    end if;

    end loop;

    END;

    /

    OUTPUT-

    9999 2012

    Now the values of the year

    9999 9999

    8888 2016

    Values of the year in the world

    8888-9999

    Select used in for loop is to have two values only i.e.

    sense lookup_code

    9999 2012

    8888 2016

    Expected results should be in part IF that is and on the other hand does not run.

    9999 and 2012 of DBMS_OUTPUT

    Nope...

    If you compare 8888 with 9999, it means that this condition is false (it is not true)...

    It will be ignored... in your case... (nothing will happen)

    You can also change your query... so, you can select just the data in your table when meaning is equal to a number...

    SELECT meaning, lookup_code FROM fnd_lookup_values
             WHERE lookup_type = 'PARALLEL_ALLOCATION'
    and meaning = p_year
    

    but... These are really programming basics...

  • Cannot restart or refresh my iPhone 7 from the "home" button and the sleep/wake button at the same time

    I'm having difficulty trying to restart and update my iPhone 7 using the Home button and the sleep/wake button at the same time, when I do my phone takes a screenshot of the home screen.

    Should I turn off my Touch ID?

    Basically my home button button and / standby works not together at the same time.

    You need hold the House and turn off the button for 20 seconds, until the Apple logo appears.

  • is it possible to combine ethernet and wifi connections to use both at the same time

    I want to fill the two connections without using third-party software can do this combine is wifi and ethernet, all use both faster speeds for

    Ethernet is the fastest connection to use your modem/router and it will not combine or run them both at the same time.

    To test your speed, try > http://www.speedtest.net/

    or > https://www.speakeasy.net/speedtest/http://www.speedtest.net/

    If you are unhappy with the speed of your ISP, you need to communicate with them or another ISP.

Maybe you are looking for