Cache.get (Object) when using the list and Arrays.asList as keys
HelloI saw a problem when doing the cache.get (object) with the list. Here's my test.
NamedCache cohCache = CacheFactory.getCache ("Test");
Key is a list
Key list = new ArrayList();
Key.Add ("A");
cohCache.put (key, 1);
System.out.println ("Get with Arrays.asList:" + cohCache.get (Arrays.asList ("A")));
System.out.println ("list:" + cohCache.get (key));
System.out.println ("list is equal to Arrays.asList:" + Arrays.asList("A").equals (key));
Actual output:
Get with Arrays.asList: null
List is equal to Arrays.asList: true
Download list: 1
Expected results:
Get with Arrays.asList: 1
List is equal to Arrays.asList: true
Download list: 1
Arrays.asList("A") and the key are equal but consistency does not return the value. I thought that, in cache.get (object) consistency returns if object.equals (key) is true.
Any idea?
Reg
Fatou.
Dasun.Weerasinghe wrote:
HelloI saw a problem when doing the cache.get (object) with the list. Here's my test.
NamedCache cohCache = CacheFactory.getCache ("Test");
Key is a list
Key list = new ArrayList();
Key.Add ("A");cohCache.put (key, 1);
System.out.println ("Get with Arrays.asList:" + cohCache.get (Arrays.asList ("A")));
System.out.println ("list:" + cohCache.get (key));
System.out.println ("list is equal to Arrays.asList:" + Arrays.asList("A").equals (key));Actual output:
Get with Arrays.asList: null
List is equal to Arrays.asList: true
Download list: 1Expected results:
Get with Arrays.asList: 1
List is equal to Arrays.asList: true
Download list: 1Arrays.asList("A") and the key are equal but consistency does not return the value. I thought that, in cache.get (object) consistency returns if object.equals (key) is true.
Any idea?
Reg
Fatou.
Hi Eric,.
There is a slight misunderstanding in how you think that the works of coherence.
For clustered caches Coherence does not return the value of the object key of equals to the key specified when caching, object instead, it returns When serialized forms of the key used to and used to get equal to one another.
If you use no POF, then most of the time Java serialization is used to serialize the objects of key, and in any case if you don't use of POF, and the name of the serialized object class is in the serialized form.
Now, the thing is that the key that you put in is a java.util.ArrayList. The key that you have tried to get with is a java.util.Arrays.ArrayList.
It's two different classes, so the serialized forms that store the name of class implementation (which is true in this case) cannot be the same. So consistency is not going to put initially entrance the key that it uses (the serialized form) is actually different from the original key, so there is no entry for the key used in the get() method, and correctly you get back null.
On the other hand, the two implementations ArrayList implement equals as defined in AbstractList, requiring not only the types of implementation of lists be the same, they apply just that the relation to the object is also a list, so two lists containing the same elements in the same order are equal as long as equals() on AbstractList is concerned, that's why your equals() check evaluates to true even if the types of implementation are different.
Best regards
Robert
Published by: robvarga on May 2, 2012 11:44
Tags: Fusion Middleware
Similar Questions
-
bug using the list and treeset
I have a problem in the real world where I get a list of the retail store and get the distance of the starting places group and a location closest to you find the 10 for each starting locations. I'm back from getdata a list of stores loop in each store and calculate the distance and put them in a treeset for sorting. Problem is when the second set of data is added to the treeset that the original game is replaced with a duplicate of the second set. a very simple test for this case is:
output:package treeset; import java.util.Comparator; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.TreeSet; import java.io.Serializable; //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // Class TreeSetExample //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- /** * The TreeSetExample demonstreates a odity in the sorting of list using a treeset * * @version 1.0, 04/06/2011 * @author Douglas Nelson * @author copyright Oracle 2011 * @author Unauthorized use, duplication or modification is strictly prohibited. */ public class TreeSetExample extends Object { //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // start constructor //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= /** * Constructs a TreeSetExample object */ public TreeSetExample() { } // end constructor //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // start getData //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= /** * getDatea */ public List<SimpleVO> getData() { List<SimpleVO> returnList = new LinkedList<SimpleVO>(); SimpleVO simpleVO = null; for (int i = 0;i < 5;i++) { returnList.add(new SimpleVO()); } // end for return(returnList); } // end getData //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // start runTest //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= /** * runTest - Test the insert sorting of a tree set with a list of data * @param loopCount number of time to load data into the saveset */ public void runTest(int loopCount) { List<SimpleVO> simpleList = getData(); SimpleVO simpleVO = null; TreeSet<SimpleVO> saveSet = new TreeSet<SimpleVO>(new simpleComparator()); SimpleVO tempSimpleVO = null; Iterator<SimpleVO> iterator = null; Iterator<SimpleVO> printIterator = null; int id = 0; for (int i = 0; i < loopCount;i++) { iterator = simpleList.iterator(); //-------------------------------------------------------------- // for each of the user's zip codes find the distance to the RSL //-------------------------------------------------------------- while (iterator.hasNext()) { simpleVO = iterator.next(); id ++; simpleVO.setName("" + id); saveSet.add(simpleVO); } // end while //-------------------------------------- // print saveset at the end of each load //-------------------------------------- System.out.println("list count after loop [" + (i + 1) + "] number of elements = [" + saveSet.size() + "] contents:"); printIterator = saveSet.iterator(); while(printIterator.hasNext()) { tempSimpleVO = printIterator.next(); System.out.println(" save simpleVO name = [" + tempSimpleVO.getName() + "]"); } // end while } // end For } // end runTest //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // start main //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= /** * IbotMailParser main thread * @param arg standard main input string array. */ public static void main(String[] arg) { System.out.println("Main - Started"); try { System.out.println("*************** starting test 1 *********************"); TreeSetExample treeSetExample = new TreeSetExample(); treeSetExample.runTest(1); System.out.println("\n"); System.out.println("\n"); System.out.println("*************** starting test 2 *********************"); treeSetExample.runTest(2); } // end try catch (Exception any) { System.out.println("Exception [" + any.getMessage() + "]"); } // end catch System.out.println("Main - we gone bye-bye...!"); } // end main //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // Class SimpleVO //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- /** * The SimpleVO is a value object pattern used for this example * * @version 1.0, 04/06/2011 * @author Douglas Nelson * @author copyright Oracle 2011 * @author Unauthorized use, duplication or modification is strictly prohibited. */ public class SimpleVO extends Object { /** * Default user name for Oracle connection. */ private String name = ""; //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // start getName //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= /** * Returns the name value associated with this attribute * * @return String - the Name parameter */ public String getName() { return(name); } // end getName //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // start setName //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= /** * Sets the name value for this attribute * * @param newName the Name to be set */ public void setName(String newName) { if (newName != null) { name = newName.trim(); } // end if } // end setName } // end SimpleVO //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // Class simpleComparator //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- /** * The SimpleComparator is a comparator object used for sorting simple value objects * * @version 1.0, 04/06/2011 * @author Douglas Nelson * @author copyright Oracle 2011 * @author Unauthorized use, duplication or modification is strictly prohibited. */ public class simpleComparator implements Comparator<SimpleVO>, Serializable { //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // start getName //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= /** * Returns the name value associated with this attribute * * @return String - the Name parameter */ public int compare(SimpleVO simpleVO_1, SimpleVO simpleVO_2) { return(1); } // end compare } // end SimpleComparator } // end class TreeSetExample
c:\treeset > java treeset. TreeSetExample
Hand - started
from test 1 *.
County from the list after several loop [1] items = [5] content:
you save simpleVO name = [1]
you save simpleVO name = [2]
you save simpleVO name = [3]
you save simpleVO name = [4]
you save simpleVO name = [5]
from test 2 *.
County from the list after several loop [1] items = [5] content:
you save simpleVO name = [1]
you save simpleVO name = [2]
you save simpleVO name = [3]
you save simpleVO name = [4]
you save simpleVO name = [5]
County from the list after several items loop [2] content = [10]:
you save simpleVO name = [6]
you save simpleVO name = [7]
you save simpleVO name = [8]
you save simpleVO name = [9]
you save simpleVO name = [10]
you save simpleVO name = [6]
you save simpleVO name = [7]
you save simpleVO name = [8]
you save simpleVO name = [9]
you save simpleVO name = [10]
Hand - we go... Bye Bye!
Published by: EJP 07/04/2011 10:44: Add code tags. Please use them.Here, I added a string comparison. TreeSet stil works.
package scratch; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import java.util.TreeSet; public class TreeSetWorks { public static void main (String[] args) throws Exception { List
list = new ArrayList (); Set insertionOrderSet = new LinkedHashSet (); Set comparator1OrderedSet = new TreeSet (new SimpleVOComparator1 ()); Set comparator2OrderedSet = new TreeSet (new SimpleVOComparator2 ()); for (int i = 5; i <= 15; i++) { SimpleVO vo = new SimpleVO(); vo.id = i; vo.name = "VO-" + i; list.add(vo); } System.out.println ("preshuffle list : " + list); Collections.shuffle (list); System.out.println ("postshuffle list : " + list); System.out.println (); for (SimpleVO vo : list) { insertionOrderSet.add (vo); System.out.println ("addded " + vo + " to insertionOrderSet : " + insertionOrderSet); comparator1OrderedSet.add (vo); System.out.println ("addded " + vo + " to comparator1OrderedSet : " + comparator1OrderedSet); comparator2OrderedSet.add (vo); System.out.println ("addded " + vo + " to comparator2OrderedSet : " + comparator2OrderedSet); System.out.println (); } System.out.println ("list : " + list); System.out.println ("insertionOrderSet : " + insertionOrderSet); System.out.println ("comparator1OrderedSet : " + comparator1OrderedSet); System.out.println ("comparator2OrderedSet : " + comparator2OrderedSet); } } class SimpleVO { int id; String name; public String toString() { return name; } } class SimpleVOComparator1 implements Comparator { public int compare(SimpleVO vo1, SimpleVO vo2) { return vo1.id < vo2.id ? -1 : vo1.id > vo2.id ? 1 : 0; } } class SimpleVOComparator2 implements Comparator { public int compare(SimpleVO vo1, SimpleVO vo2) { return vo1.name.compareTo (vo2.name); } } list : [VO-6, VO-5, VO-14, VO-7, VO-8, VO-11, VO-12, VO-15, VO-9, VO-10, VO-13] insertionOrderSet : [VO-6, VO-5, VO-14, VO-7, VO-8, VO-11, VO-12, VO-15, VO-9, VO-10, VO-13] comparator1OrderedSet : [VO-5, VO-6, VO-7, VO-8, VO-9, VO-10, VO-11, VO-12, VO-13, VO-14, VO-15] comparator2OrderedSet : [VO-10, VO-11, VO-12, VO-13, VO-14, VO-15, VO-5, VO-6, VO-7, VO-8, VO-9] -
When using the merge and when to use updated
Hi friends,
Given the best performance... purpose of this discussion is when we should use statement UPDATE and when we should use MERGE statement in oracle update of thousands of records.
Kindly Guide.
Kind regards
Himanshu
Hello
Looking for a couple to a few rules that you can use to decide whether to use the MERGE or UPDATE, without actually testing two meanings?
If so, use MERGE when
(1) (sometimes) need to add new lines
(2) it is simpler. This includes special cases
(2A) an UPDATE statement uses a subquery in the SET clause and then (mostly) repeats the same subquery in the WHERE clause
(2B) you want to use the analytical functions or CONNECT BY in a subquery
These rules are NOT guaranteed to work in all situations.
Kimmy says:
Hello
... My requirement is only UPDATED records about 200 to 500K (NOT followed by update of insertion).
So the rule (1) above does not apply in this case.
What I observed in the update using a MERGE statement and UPDATE is:
Update with the MERGER was faster however explain the bytes consumed to the query plan MERGE has been compared more update.
Use the tool that works best for your needs. If users are complaining that something shows more bytes used in a plan to explain, so maybe it's a reason for the UPDATE.
Where I work, where is the fastest is usually more important.
In addition, I want to get clearity
1. "if I should use MERGE if I need to update recrods using the unique table" as shown below: OR update will be good to use in this case:
MERGE INTO MKT_DATA inmkt
C using (SELECT Customer_Code, region, State OF CUSTOMER_DATA)
ON (inmkt. Distributor_Code = c.Customer_Code AND inmkt. DISTRIBUTOR_CODE IS NOT NULL)
WHEN MATCHED THEN
Updated the inmkt VALUE. Distributor_Region = c.Region,
inmkt. C.State = Distributor_Province;
UPDATE MKT_DATA inmkt
SET (inmkt. Distributor_Region, inmkt. Distributor_Province) =
(SELECT c.Region, c.State OF CUSTOMER_DATA c
WHERE c.Customer_Code = inmkt. Distributor_Code)
WHERE inmkt. DISTRIBUTOR_CODE IS NOT NULL;
2 statements above are not equivalent.
The UPDATE statement changes all the lines in the table mkt_data that have a distributor_code, this distributor_code be in the table customer_data or not.
You want something that is equivalent to the MERGE statement, you can use:
UPDATE MKT_DATA inmkt
SET (inmkt. Distributor_Region, inmkt. Distributor_Province) =
(SELECT c.Region, c.State
OF CUSTOMER_DATA c
WHERE c.Customer_Code = inmkt. Distributor_Code
)
WHERE THERE ARE
(SELECT 1
CUSTOMER_DATA C2
WHERE the c2. Customer_Code = inmkt. Distributor_Code
)
;
It basically uses the same auxiliary request 2 times (article 2 (a), so I would use MERGE if these are the results I wanted.
If you have a foreign key constraint, which ensures that each distributor_code in mkt_data will match a line in customer_data, then the 2 statements above will produce the same results. In this case, I find the UPDATE statement simpler and probably use it rather than MERGE.
2. to Updating huge amount of records MERGER must be used instead of update?
I don't know of all short reign as the "use X whenever you have more than 100,000 lines".
3. If in the update, I need to use several tables then I have to use MERGE?
MERGE IN MKT_DATA2 t
WITH THE HELP OF)
SELECT DISTINCT srt. Sales_Id, tmkt. Cust_Code, srt. PRODUCT_CENTER
OF srt, CUSTOMER_DATA c, MKT_DATA2 tmkt SALESTERR_PL
WHERE tmkt.state_Id = 10423
AND tmkt. Business = 'MARKETING'
AND c.CUST_CODE = tmkt. Cust_Code
AND c.Rollup_Code = srt. CUST_CODE
AND srt. PRODUCT_CENTER = tmkt.PL
) d
WE (t.state_Id = 10423
AND t.BA = 'MARKETING'
AND t.Cust_Code = d.Cust_Code
AND t.PL = d.PRODUCT_CENTER
AND t.Cust_Code IS NOT NULL
)
WHEN MATCHED THEN
UPDATE SET t.Sales_Id = d.Sales_Id;
UPDATE MKT_DATA2 tmkt
SET Sales_Id = (SELECT SALES_ID OF SALESTERR_PL srt
WHERE the srt. CUST_CODE = (SELECT ROLLUP_CODE FROM CUSTOMER_DATA c
WHERE c.CUSTOMER_CODE = tmkt. Cust_Code)
AND srt. PRODUCT_CENTER = tmkt.PL)
WHERE business = 'MARKETING'
AND state_Id = 10423;
Once again, those who are not equivalent. The UPDATE statement can change more lines than the MERGE statement.
In addition, you can use the MERGE statement:
MERGE IN MKT_DATA2 t
WITH THE HELP OF)
SELECT DISTINCT srt. Sales_Id, tmkt. Cust_Code, srt. PRODUCT_CENTER
OF srt, CUSTOMER_DATA c, MKT_DATA2 tmkt SALESTERR_PL
WHERE tmkt.state_Id = 10423
AND tmkt. Business = 'MARKETING'
AND c.CUST_CODE = tmkt. Cust_Code
AND c.Rollup_Code = srt. CUST_CODE
AND srt. PRODUCT_CENTER = tmkt.PL
) d
WE (t.Cust_Code = d.Cust_Code
AND t.PL = d.PRODUCT_CENTER
)
WHEN MATCHED THEN
UPDATE SET t.Sales_Id = d.Sales_Id
WHERE t.state_Id = 10423
AND t.BA = 'MARKETING'
- AND t.Cust_Code IS NOT NULL - does not need, said subquery 'c.CUST_CODE = tmkt. Cust_Code ".
;
If you would care to publish the sample data, I was able to test this.
4. when the UPDATE is preferred over the MERGER?
In simple cases, including situations where all you need to know are on the line itself, such as:
UPDATE emp
SET sal = sal * 1.05
Job WHERE NOT IN ('MANAGER', 'PRÉSIDENT')
;
-
Get errors when using the xml parsers in my client application.
Hello
I use JDE 4.5.0, Jdk 1.6. In my application, I need to read the xml data so I used the packages below
import java.io.File;
Import javax.xml.parsers.DocumentBuilder;
Import javax.xml.parsers.DocumentBuilderFactory;
to import org.W3C.DOM.document;
Import org.w3c.dom.Element;
Import org.w3c.dom.Node;
Import org.w3c.dom.NodeList;But when compiling it's show
Cannot resolve symbol
symbol: DocumentBuilderFactory class
location: packet analyzers
Import javax.xml.parsers.DocumentBuilderFactory;Cannot resolve symbol
symbol: class file
Location: package io
import java.io.File; ...............Same type of java file that uses similar packages is correctly compile another IDE (Editplus). That's why show this compilation errors. I scoured the forums of Sun they mentioned that "XML support is build in the JVM 1.4 and later." No need of extra pots. How do I set this compilation errors.
Please give your suggestion, thanks for the tip for the same thing.
Kind regards
Sunil.G
Thanks for your reply MSohm.
In my class used resulting classes that the errors below.
Import javax.xml.parsers.DocumentBuilder;
Import javax.xml.parsers.DocumentBuilderFactory;
now instead of what I used
Import net.rim.device.api.xml.parsers.DocumentBuilder;
Import net.rim.device.api.xml.parsers.DocumentBuilderFactory;reading file, I use (instead of java.io.File)
InputStream inputStream is getClass () .getResourceAsStream (_xmlFileName);.
Doc document = db.parse (inputStream); -
How to get a column using the logical AND operator on two columns?
All columns are the VARCHAR2 data type.
I got out of the table in this way:
col1 col2
but I want an extra column in this way:
True True
True false
False falsecol1 col2 result
as the clear sound output shows this column resut is logical operator AND
True True True
True false false
Fake fake fake
col1 and col2. How to get there?WITH t AS (SELECT 'True' col1, 'True' col2 FROM DUAL UNION ALL SELECT 'True' col1, 'False' col2 FROM DUAL UNION ALL SELECT 'False' col1, 'True' col2 FROM DUAL UNION ALL SELECT 'False' col1, 'False' col2FROM DUAL) SELECT col1,col2,CASE WHEN col1 = 'True' AND col2 = 'True' THEN 'True' WHEN col1 = 'True' AND col2 = 'False' THEN 'False' WHEN col1 = 'False' AND col2 = 'True' THEN 'False' WHEN col1 = 'False' AND col2 = 'False' THEN 'False' END AS RESULT FROM t
-
Go to sky
When using Sky go and try to watch movies or programs how do I get to run continuously without interruption and catch every few seconds.
The usual cause of this is that your broadband connection is not fast enough or you have multiple computers, try to use it at the same time.
This allows to check your speed broadband http://www.bbc.co.uk/iplayer/diagnostics#results
If the broadband speed does not seem to be the problem, please contact Sky
-
RunTimeException when you use the timer and TimerTask.
In the switchNext() method, it changes an image and some text in a Vertical management. When I run the application, I get a RunTimeException. However, when I have not used the timer and tested the method switchNext() with just a button method worked perfectly. How can I make it work with timer or another class that he will call every 30 seconds?
time = new Timer(); TimerTask task = new TimerTask() { public void run() { switchNext(); } }; time.schedule(task, 10000);
It would be useful to know what Exception you actually get.
However, I think that it is indeed related to the fact IllegalStateException the TimerTask is running in the "bottom", and you try to update your User Interface.
If you change the code as follows, it will work the method on the event Thread and so he has access to update the user interface.
public void run()
{
UiApplication.getUiApplicat () .invokeLater (new Runnable()public void run() {}
switchNext();}});
}You can find more information on the event thread here:
http://supportforums.BlackBerry.com/T5/Java-development/what-is-the-event-thread/Ta-p/446865
-
In our application, we try to add and delete records within a one: iterator lie to the backing bean list table.
According to the feature remove should not fire any validation form so we are settign Remove button including the immediate property. And add can throw validation before adding a new record.
Here the problem comes with button Delete with activated immeidate. The deletions list action recording is removed from the collection list at the beacking bean, but after that the interface iterator partial page refresh user displays with bad Recordset. Some how instead of getting the last recordings of server of the user interface displays the previous local values for input components.
For example: if I have 5 files in the list and delete record 2nd of collection. Backing bean (server side) the 2nd record is perfectly removal of list collection.
On the user interface, the iterator 4 records are displayed as the size of the list is 4, but instead of 2nd record the last record is not rendered. According to my understanding, as deleting comme la suppression touche key is set immediately then the some how these recordings (genereted the Id of component runtime inside the i1: 0:it1 etc...) Apply request vandekerckhove is not updated gettign, Hene showing the old local values inplace of these components of entry and this behavior is only for input components.
Can you suggest me a solution more come to the question above. Delete with immediate should unregister correspondent and only the record deleted if pannals UI.
JSFF code
<af:panelGroupLayout id="pgl1" binding="#{viewScope.formBB.mainPGL}"> <af:iterator id="i1" value="#{viewScope.formBB.allEmployees}" var="emp" rows="0" varStatus="vs" binding="#{viewScope.formBB.iteratorBinding}"> <af:panelFormLayout id="pfl1" maxColumns="4" rows="1" labelAlignment="top"> <!--<af:outputText value="#{vs.index}" id="ot1"/>--> <af:inputText label="First Name" id="it1" value="#{emp.firstName}" autoSubmit="true" required="true"/> <af:inputText label="Last Name" id="inputText1" value="#{emp.lastName}" autoSubmit="true" required="true"/> <af:commandImageLink text="Delete" id="cil1" immediate="true" actionListener="#{viewScope.formBB.deleteEmployee}"> <f:attribute name="index" value="#{vs.index}"/> </af:commandImageLink> </af:panelFormLayout> </af:iterator> <af:commandButton text="Add New Employee" id="cb1" actionListener="#{viewScope.formBB.addNewEmployee}"/> <af:spacer width="10" height="10" id="s1"/> </af:panelGroupLayout>
Delete the Action listener for the bean
private List <Employee> allEmployees; public List getAllEmployees() { return allEmployees; } public void deleteEmployee(ActionEvent actionEvent) { int index = (Integer) actionEvent.getComponent().getAttributes().get("index"); if(allEmployees != null && allEmployees.get(index) != null) { System.out.println("Emploeye Name:" + allEmployees.get(index).getFirstName()); allEmployees.remove(index); } //AdfFacesContext.getCurrentInstance().addPartialTarget(mainPGL); AdfFacesContext.getCurrentInstance().addPartialTarget(iteratorBinding); } public void addNewEmployee(ActionEvent actionEvent) { Employee addE = new Employee(); if(allEmployees != null) { allEmployees.add(addE); } else { allEmployees = new ArrayList <Employee>(); allEmployees.add(addE); } AdfFacesContext.getCurrentInstance().addPartialTarget(mainPGL); }
Jdev version - Build JDEVADF_11.1.1.7.0_GENERIC_130226.1400.6493
POC Application - https://drive.google.com/file/d/0BysBrGAsXoo0Qjh3VGkzZkRGck0/view?usp=downalod
Help, please.
You probably need to reset submitted values.
For this, you can use this util class: ResetUtils (reference Java APIs for Oracle ADF Faces)
For example: ResetUtils.reset (iteratorBinding);
BTW, you should never bind components to bean managed with a scope greater than the scope of the request.
Dario
-
Using the MF and the "open a new tab" + sign opens a new page with a list of site visited recently, which is a very useful tool. It works fine on my two desktop computers, but I can't it to work on the laptop.
I downloaded "New tab Pro" on the laptop (do not even see on desktop computers so don't think about) such that she was like the real deal but nope... do not work. Running the latest version of MF, ideas on how activate it please?
Thank you guys are going to mark as 'resolved' BTW it is no "folder on the desktop named old data from Firefox. Hmmmmmm.
-
I just noticed that (in comparison to Internet Explorer): in IE, when you preferred a Web page, it uses the actual name of the Web page (for example, for this page, it would be "Ask a Question Firefox Help" as the name of the bookmark), but in Mozilla, it uses the URL as the name of the bookmark. I was wondering if it was possible to change my Mozilla settings so that it uses the name of the Web page as the bookmark name instead of the URL? I hope that everyone understands what I am getting? If anyone can help me, I would really appreciate it. Thank you.
Firefox uses the tag title for the name of the newly saved bookmark.
When I bookmark on this forum page I get this for the 'name' of the bookmark.
How can I get Mozilla to use the name of the page for the name of the real instead of the URL bookmark when I bookmark a page | Firefox Support Forum | Firefox help
-
I a s 6 more and when using the phone, if my face touches the screen it clicks on the logout button and the phone hangs up the call. Is it possible to prevent this without holding the phone away from my face when calling?
iPhones have a proximity sensor which is supposed to automatically turn off the screen when you hold it in your face. If this is not the case you can take the phone and have it checked.
-
How can I clear the attraction of the browser to the bottom of the list, I followed the directions using the options and it will be not only clear
Entries in the location bar drop-down list with a yellow star (blue on Mac) at the right end of the bookmarks.
You can delete this an item marked with a bookmark that appear in the list, if you open this url in a tab and click on the yellow star in the address bar.
This will open the "Edit this bookmark" dialog box and you can click on the delete button to delete the bookmark if you want to delete such an entry marked with a bookmark. -
Hello
When you use windows live messenger, when in the chat and I write, other responses of the person, but all that shows is a load of alphanumeric characters, for example, 13223d 95-6618-11e0-a907-00248136cc7b. No idea of that which is causing this happens or a repair?
Thanks in advance.
Hello
The question you have posted is related to Windows Live, and would be better suited in the Windows Live forum. Please visit the link below to find a community that will provide the support you want.
-
computer will automatically connect to IE start up how can I stop this.
When I would use the computer and open IE when I'm ready to use it.
I have a ZYXEL router.
This has happened only since I checked a pop box that says connect automatically very stupid, I know, but now can not cancel.
help please
Hi Tansy,
Thanks for posting your query in Microsoft Community.
I understand how it could be frustrating when things do not work as expected. Please, I beg you, don't worry I'll try my best to resolve the issue.
I understand that you want to disable the open Internet Explorer at startup option.
Method 1
Step 1: I suggest to start the computer in safe mode with network and check if the problem persists.Startup options (including safe mode)
http://Windows.Microsoft.com/en-us/Windows7/advanced-startup-options-including-safe-modeStep 2: If the problem is solved in SafeMode with networking, then I suggest to perform clean boot and remove the program that is causing the problem.
How to perform a clean boot for a problem in Windows Vista, Windows 7 or Windows 8
http://support.Microsoft.com/kb/929135
Note: Follow step 3 of section of boot KB929135 to reset the computer in normal mode.Method 2
I suggest you run virus scan online by using the Microsoft safety scanner.Microsoft safety scanner
http://www.Microsoft.com/security/scanner/en-us/default.aspxNote:
when you do an antivirus online, you will lose data that are affected by the virus. Microsoft is not responsible for the loss of this data.See also: Stop a program from running automatically when Windows starts
http://Windows.Microsoft.com/en-in/Windows7/stop-a-program-from-running-automatically-when-Windows-startsThanks for posting the results and let us know if you need help to solve the problem and we will be happy to help you
-
Cursor turns in a circle when you use the pen and Wacom Tablet?
When you use the stylus and Tablet Wacom the cursor becomes a circle inscribed in a circle and use.
What type of Wacom tablet work? I have a Cintiq, and according to that tool I use, I tend to change the pointer in what ever I need.
But if you use an Intuos I can ask someone at Wacom Europe, since I work closely with them on the Wacom InfoChannel.
Let me know.
Maybe you are looking for
-
Firmware Apple 7.7.7 airport broke my Wan
I updated my network routers (Time Capsule connected to the internet with an Extender Airport Extreme and Airport Express) 7.7.7 and 7.6.7 respectively. Once I did, the Airport Express can only be seen by the network on the Airport utility, but shows
-
The scroll in my Mac El Capitan bar disappeared
Dear Sirs, please how to recover my scroll bar in my I Mac El Capitan. I used this morning with no problems and now where is it?
-
Help on the software triggers the analog output...
-
get pictures of the instrument
Hello I need images of the graph of the insrument, my computer is connected to the instrument via GPIB-USB-HS, can image (*.jpg) file was obtained by GPIB-USB-HS of the instrument. When VISA published 'outpdata' command, instrument transmits the resu
-
Installation error Code: 0 x 80070003
I tried to re install Vista on my white laptop & the above error (0 x 80070003) code came.