Why the componeng id exists in the view when create a dynmaic table?

In the first page, i add a command button to create a managed bean containing a UIData component, whose the struture is dynamic in runtime, and then forward to other page to show the UIData:
JSP code:
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<f:view>
<body>
<h:form id="welcomeform">
<h:commandButton value="jump" action="#{welcomeForm.execute}"/>
</h:form>
</body>
</f:view>JAVA code:
package com.savage.dynweb;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
public class WelcomePage {
public String execute() {
DynPage dynPage = new DynPage();
dynPage.init();
FacesContext context = FacesContext.getCurrentInstance();
ValueBinding vb = context.getApplication().createValueBinding("#{requestScope.dynPage}");
vb.setValue(context, dynPage);
return "success";
}faces-config.xml:
<managed-bean>
<managed-bean-name>welcomeForm</managed-bean-name>
<managed-bean-class>com.savage.dynweb.WelcomePage</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/pages/test.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/pages/dynpage.jsp</to-view-id>
</navigation-case>
</navigation-rule>dynpage.jsp code:
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<f:view>
<body>
<h:form id="dynform">
<h:dataTable binding="#{dynPage.dynTable }" var="row" value="#{dynPage.records }"/>
<h:commandButton value="next" actionListener="#{dynPage.execute}"/>
</h:form>
</body>
</f:view>DynPage.java:
package com.savage.dynweb;
import java.util.*;
import javax.faces.application.Application;
import javax.faces.component.*;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
import javax.faces.event.ActionEvent;
public class DynPage {
private UIData dynTable;
private List<Map<String, String>> records;
public void init() {
String[] headers = new String[] {"name", "age", "sex", "birthday"};
records = new ArrayList<Map<String, String>>(10);
for(int i = 0; i < 10; i++) {
Map<String, String> record = new HashMap<String, String>(4);
record.put("name", "name" + i);
record.put("age", "age" + i);
record.put("sex", "sex" + i);
record.put("birthday", "birthday" + i);
records.add(record);
FacesContext.getCurrentInstance().getViewRoot().getChildren().clear();
Application app = FacesContext.getCurrentInstance().getApplication();
dynTable = new UIData();
for(String header : headers) {
UIColumn column = new UIColumn();
UIOutput output = new UIOutput();
ValueBinding vb = app.createValueBinding("#{requestScope.row." + header + "}");
output.setValueBinding("value", vb);
UIOutput facet = new UIOutput();
facet.setValue(header);
column.setHeader(facet);
column.getChildren().add(output);
dynTable.getChildren().add(column);
public void execute(ActionEvent event) {
init();
public UIData getDynTable() {
return dynTable;
public void setDynTable(UIData dynTable) {
this.dynTable = dynTable;
public List<Map<String, String>> getRecords() {
return records;
public void setRecords(List<Map<String, String>> records) {
this.records = records;
}face-config.xml:
<managed-bean>
<managed-bean-name>dynPage</managed-bean-name>
<managed-bean-class>com.savage.dynweb.DynPage</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>when I click the next button at the dynpage.jsp, it raised a exception:
java.lang.IllegalStateException: ******************ID "dynform:_id0:_id4"(means the ID "dynform:id0:_id4" has been existed in the view)��
com.sun.faces.application.StateManagerImpl.checkIdUniqueness(StateManagerImpl.java:201)
com.sun.faces.application.StateManagerImpl.checkIdUniqueness(StateManagerImpl.java:204)
com.sun.faces.application.StateManagerImpl.checkIdUniqueness(StateManagerImpl.java:204)
com.sun.faces.application.StateManagerImpl.saveSerializedView(StateManagerImpl.java:97)
com.sun.faces.taglib.jsf_core.ViewTag.doAfterBody(ViewTag.java:189)
org.apache.jsp.pages.dynpage_jsp._jspx_meth_f_005fview_005f0(dynpage_jsp.java:104)
org.apache.jsp.pages.dynpage_jsp._jspService(dynpage_jsp.java:67)
But when i append a code:
FacesContext.getCurrentInstance().getViewRoot().getChildren().clear();
in the method:init(), everything is ok, why?
Can anyone to tell me the why it raise the exception, and why I clear the children of the UIViewRoot, the exception is gone.

Hi Frank,
Thank you and it can work.
public void setLowHighSalaryRangeForDetailEmployeesAccessorViewObject(Number lowSalary,
                                                                          Number highSalary) {
        Row r = getCurrentRow();
        if (r != null) {
            RowSet rs = (RowSet)r.getAttribute("EmpView");
            if (rs != null) {
                ViewObject accessorVO = rs.getViewObject();
                accessorVO.setNamedWhereClauseParam("LowSalary", lowSalary);
                accessorVO.setNamedWhereClauseParam("HighSalary", highSalary);
            executeQuery();
but I have a quesiton in this way. in code snippet, it is first getting current row of current master VO to determine if update variables value of detail VO. in my case, current row is possibly null after executeQuery() of master VO and  I have to change current row manually like below.
any idea?
            DCIteratorBinding dc = (DCIteratorBinding)ADFUtil.evaluateEL("#{bindings.SSForecastSourceBlockView1Iterator}");
            ViewObject vo = dc.getViewObject();           
            vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo.executeQuery();
            vo.setCurrentRowAtRangeIndex(0);
            ((SSForecastSourceBlockViewImpl)vo).synchornizeAccessorVOVariableValues();

Similar Messages

  • PSE 9 and 5 will not import - says the file already exists in the catalog !

    I've already wasted 2 days looking for answers to this. When someone buys this program, at least half of the price is paying for the database in the Organizer - yet even John Ellis himself, who seems to know more than anyone about it, has gone to Lightroom. This is bad coding!!!
    Upgraded from 5 to 9. If you read my previous posts, this took 2 days too, and phone help from a tech, because it would not install in my XP computer. It did upgrade the Organizer from 5, although many of the symbols are unusable and don't work to help me identify my tags. However, now I see that neither 5 nor 9 is able to look at a file and display thumbnails that are in it.
    I move files around a lot for my business. Any half-way good database should be able to find the missing files, and also add any new images. Say I have 10 images in file A, then add 2 more to make 12. It can't see the added images! Says can't import, the file already exists in the catalog.
    I tried: updating thumbnails, recover, repair, in both 5 and 9 - nothing works. to import the images that I can SEE in these folders! I read here  that it will not import files if the same name is somewhere else. That alone is a problem.  But I think it's more than that: even if the file used to be in another folder, folder B, it won't recognize that it's in folder A now!
    Since PSE9 uses sql db, shouldn't that be better than 5 and be able to do simple tasks like this?
    Any advice or similar experiences eagerly welcomed.

    Thank you for replying, dj paiqe.
    Do you mean the first little section that says photos may not be displaying? Yes, those just reveal hidden photos and are very basic. I did them.
    I guess we disagree about databases and what they are designed to do, or maybe I didn't explain this well.
    I did not move the images outside of the catalog: I move them to various folders, all already imported WITHIN the catalog, as I send them to various editors. (these are all drawings, not photos, and I do this professionally, so it needs to work).
    Folder A and Folder B and Folder C have already been imported into the catalog. So if I move 2 images from folder B into folder A, the Organizer is simply lost, says image already exists, and everything is totally screwed up, as the image is no longer in folder B, and it can't find it in folder A!!! The problem is, unless I memorize the image name, say Image 9, I can't tell it to reconnect, as there is no longer an image in front of me! So there are 2 images, without names, now nowhere to be found. Inefficient, to say the least.
    I've never tried Lightroom or Filemaker, but I cannot believe that they would lose data like this. I think it's the Folder coding that's not working in PSE, and I wanted this to work so badly!!!!!
    I am willing to do it the PSE way, since you now have captions, keywords, etc, and it is a very powerful database, when it works. I understand that one is supposed to move images within the Organizer, obviously. But now many images are disconnected. I could start all over importing, but is there any way to do that without losing tags and categories?

  • I copied message to SMS field and sent. After that the message still exist all the time in the SMS field. When I open the application I must always first delete the "saved"  ones before I write the new one. What to do to finally/definitely delete the save

    I copied message to SMS field and sent. After that the message still exist all the time in the SMS field. When I open the application I must always first delete the “saved”  ones before I write the new one. What to do to finally/definitely delete the save message?

    sorry it's ios6

  • Connecting to EMS fails with No mapping for the Unicode character exists in the target multi-byte code page

    I am getting the following error when trying to connect to both my exchange servers.
    New-PSSession : [ex2013-002.nafa.ca] Connecting to remote server ex2013-002.nafa.ca failed with the following error
    message : No mapping for the Unicode character exists in the target multi-byte code page. For more information, see
    the about_Remote_Troubleshooting Help topic.
    At line:1 char:12
    + $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri ht ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
       gTransportException
        + FullyQualifiedErrorId : 1113,PSSessionOpenFailed
    EMS used to connect ok. I am not sure if there is any connection but Outlook was installed recently on the exchange server to enable mailbox level backups.
    Any help would be appreciated.
    Steve Hurst

    Hello Steve,
    Firstly, you cannot install Outlook with Exchange because they share certain dll files.
    About the EMS question, I suggest we try rebuilding the powershell virtual directory. If it still does not work, check the application log for more referernce.
    Thanks,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Simon Wu
    TechNet Community Support

  • How to check if the file already exists in the client directory

    Hi all.
    I'm on devsuite 10g. I'm using webutil to download files from DB using webutil function db_to_client.
    What I need is to check if the file already exists in the client directory and if yes to display a message to ask the user if he wants to overwrite or no. How can I make this???
    Here is the code that I'm using to download the file.
    Thanks all for the collaboration.
    Fabrizio
    declare
    file_path varchar2(2000) := null;
    BEGIN
    /** I ask where saving the file on the client machine **/
    file_path:= webutil_file.file_selection_dialog
    (directory_name => null,
    file_name => :bin_docs.name,
    file_filter => '',
    title => 'Saving file',
    dialog_type => save_file, --save_file
    select_file => TRUE);
    /** I download the file from DB to client **/
    if webutil_file_transfer.DB_To_Client_With_Progress
    ( file_path ,
    'BIN_DOCS',
    'DOC' ,
    'doc_id = '||:bin_docs.doc_id,
    'Downloading file',
    ' '||:bin_docs.name) then
    msg_alert('Download del file avvenuto con successo','I',false);
    else
    msg_alert('Si è verificato il seguente errore in fase di download '||SQLERRM,'I',false);
    end if;
    end;

    How about something like the below:
    Note: I have a yes/no alert to asking if they want to over-write the existing file.
    DECLARE
    file_path VARCHAR2(2000) := null;
    over_write BOOLEAN := TRUE;
    BEGIN
    /** I ask where saving the file on the client machine **/
    file_path:= webutil_file.file_selection_dialog
    (directory_name => null,
    file_name => :bin_docs.name,
    file_filter => '',
    title => 'Saving file',
    dialog_type => save_file, --save_file
    select_file => TRUE);
    IF webutil.file_exists(file_path) THEN
    /** check a file by the same name exists in the selected directory **/
    IF show_alert('Ask_overright') != alert_button1 THEN
    /** If we say no then set over_write value to false **/
    over_write := FALSE;
    END IF;
    END IF;
    IF over_write THEN
    /** I download the file from DB to client **/
    IF webutil_file_transfer.DB_To_Client_With_Progress
    ( file_path ,
    'BIN_DOCS',
    'DOC' ,
    'doc_id = '||:bin_docs.doc_id,
    'Downloading file',
    ' '||:bin_docs.name) then
    msg_alert('Download del file avvenuto con successo','I',false);
    ELSE
    msg_alert('Si è verificato il seguente errore in fase di'
    ||' download '||SQLERRM,'I',false);
    END IF
    END IF;
    END;
    cheers
    Q

  • No mapping for the Unicode character exists in the target multi-byte code page

    hi,
    i have an issue with sharepoint 2013 and IE 10.
    im using the sharepoint  rest web service and make an ajax data call to retrive data from sharepoint lists, the call fail and return a server error: "No mapping for the Unicode character exists in the target multi-byte code page". 
    i have to say that everything works fine with chrome and firefox. 
    what can i do for fixing it?
    Thanks a lot
    alon

    Hi,
    From your description, I know you get an issue with IE 10 in SharePoint 2013 when you use SharePoint REST API to retrieve data from SharePoint list.
    I am not quite sure what cause your issue. Could you provide your code, so I could test it in my environment and troubleshoot for you.
    In addition, you could test your issue in another computer or another version of IE.
    Best Regards
    Vincent Han
    TechNet Community Support

  • Why are the jpeg icons not visible in finder when created by PS6

    Why are the jpeg icons not visible in finder when created by PS6

    hi
    I have faced the same problem ... I didn't find the solution yet
    but please visit this link http://www.oracle.com/technology/products/forms/pdf/webicons.pdf
    you'll get everything you want to know
    I'm not try it yet.
    Best wishes

  • HT1349 I have registered my serial number but cannot continue the download because it says that the number already exists. This happened when I previously entered the number bt had to exit the program. How do I resolve this?

    I have registered my serial number but cannot continue the download because it says that the number already exists. This happened when I previously entered the number bt had to exit the program. How do I resolve this?

    Leigh...
    but cannot do this because I cannot access Mac App Store
    If you can't access the App Store from the Apple menu, Dock, or Applications folder installing the Mac OS X 10.6.8 Update Combo will reinstall the App Store for you.
    It's ok to do this even you are already running v10.6.8.
    Plants vs. Zombies, and that is all for additional software on here
    FYI:  Some third party software can cause issues with the App Store >   Mac App Store: Sign in sheet does not appear, or does not accept typed text
    Apple is not responsible for incompatibility isssues with third party software.

  • [svn:fx-trunk] 14009: DataGroup.getVirtualElementAt() needs to revalidate the element when the IR already exists but the data changes .

    Revision: 14009
    Revision: 14009
    Author:   [email protected]
    Date:     2010-02-05 12:53:05 -0800 (Fri, 05 Feb 2010)
    Log Message:
    DataGroup.getVirtualElementAt() needs to revalidate the element when the IR already exists but the data changes. 
    The element also needs to revalidate if it is resized, whether or not the IR existed before.  This wasn't part of the bug but Hans realized this when he did the code review.
    QE notes:
    Doc notes:
    Bugs: SDK-25354
    Reviewer: Hans
    Tests run: checkintests
    Is noteworthy for integration:
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-25354
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as

    Please can u answer it fast

  • I seem to not enter the correct answers to my security questions for itunes to buy an in-app purchase and also cannot answer the questions exactly like i answered them when creating the account for my ipod, how do i find out what answers i put

    I seem to not enter the correct answers to my security questions for itunes to buy an in-app purchase and also cannot answer the questions exactly like i answered them when creating the account for my ipod, how do i find out what answers i put for my ipod touch and itunes?

    Try these previous discusssions:
    recover answers to security questions: Apple Support Communities
    how do i change apple ID security...: Apple Support Communities

  • Call subtemplate if the corresponding node exists in the XML

    Hi,
    I have a requirement to call the sub template if the corresponding exists in the XML file. For example if the invoice node and the corresponding details are present in the XML file then i have to call the invoice sub template. Can any one suggest me how to check if the node exists or not in the XML file. Is there any specific command for this.
    Thanks

    Hi,
    Thanks a lot..it is working now as per ur suggestions..but am facing another problem here. Am calling the sub template from a main template. Headers and footers for both main and sub templates are different. So for calling the sub template i did section break (Insert -->Break , In section break-->New page) so that the header and footer of the main template wll not be repeated in the sub template. So in the new page am checking if the node exists or not the XML. If so then call the XML. If the node exists then sub template is called successfully. But if the node does not exists then a blank page is displayed for this since the call stmt is in the new page.
    So can you please suggest me how to suppress the blank page if the node does not exist.
    Thanks.

  • [help]how to know whether the given column exists in the table or not????

    Hi all, can anyone tell me how to write a C# code help me to know whether the given field exists.
    If it doesnt exists then i want to alter the table to include this column also
    I am able to write the code for alter table but i m not sure how do i check for its existence/nonexistence
    My Altering code
    {color:#800000}cmd.CommandText = "alter table " + row.ToString() + " add(" + sQuality + " varchar2(50), " +
    sTimeStamp + " varchar2(50), " +
    sValue + " varchar2(50))";
    cmd.CommandType = CommandType.Text;
    cmd.ExecuteReader();
    {color}

    Just iterate the datatable after completion and check for your column.
            public static DataTable MaterializeTableStructure(string _connectionString, string _tableName)
                DataSet ds = null;
                using (OracleConnection _oraconn = new OracleConnection(_connectionString))
                    try
                        _oraconn.Open();
                        string sql = "SELECT COLUMN_NAME, DATA_TYPE, NULLABLE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE FROM user_tab_columns where table_name='" + _tableName + "'";
                        using (OracleCommand cmd = new OracleCommand(sql, _oraconn))
                            cmd.CommandType = CommandType.Text;
                            using (OracleDataAdapter da = new OracleDataAdapter(cmd))
                                ds = new DataSet("MaterializeTableStructure");
                                da.Fill(ds);
                    catch (OracleException _oraEx)
                        throw (_oraEx); // Actually rethrow
                    catch (System.Exception _sysEx)
                        throw (_sysEx); // Actually rethrow
                    finally
                        if (_oraconn.State == ConnectionState.Broken || _oraconn.State == ConnectionState.Open)
                            _oraconn.Close();
                if (ds != null)
                    return ds.Tables[0];
                else
                    return null;
            }r,
    dennis

  • How to check if the file already exists in the application server directory

    Hi all. I'm on devsuite 10g.
    I transfer file from local machine to application server using webutil function webutil_file_transfer.client_to_as and I want to check if the file I'm transfering already exists on the server directory.
    How can I make this?
    Thanks all,
    Fabrizio

    use the text_io package and open the file in read-mode.
    like this
    declare
    xFileType text_io.file_type;
    begin
    xFileType := text_io.fopen('c:\temp\test.txt','R'); --file on the middle tier
    -- file exists;
    text_io.fclose(xFileType);
    exception
    when others then
    --file doesn't exist
    end;
    regards
    Christian

  • Trying to scan but I get an error "The file already exists in the catalog"

    I cannot scan, every time I try scanning I get an error "Nothing was imported. The files or folders selected to import did not contain any supported file types, or the files are already in the catalog.
    I checked the temp directory, Files do exist which I deleted several times ut it did not help.
    I updated the application which did not help.
    I ran repair and re-construct the catalog but that did not help either.
    Please help.

    I am sorry, but that does not help me very much.
    Fist:
    4) I had over 8000 photos and videos, I think Catalog cannot handle this big data base, so I guess its got corrupted and I had to remove the catalog and create multiple catalogs, which I think is terrible because I have browse through each catalog separately.
    This is not a big catalog, I have a catalog with 70 000 items and some have still much bigger catalogs. As you have discovered, splitting catalogs for this reason is not the solution.
    trcns a écrit:
    What I mean is
    1) Its not a scanner causing a problem,
    2) Its not Photoshop Element's scanning module causing the problem
    3) Its Photoshop Element's Catalog creating this problem
    Another way to put it is that you have the problem when using the organizer to scan several pictures. The files are scanned and saved on your disk (with an empty file name plus .jpg or .png extension). You can open them in the editor, but you can't 'import' them in the catalog unless the catalog is empty or you have not scanned prviously.
    Is that right?
    Since you have not scanned from the editor, it must  have been from the organizer.
    What I don't understand is which command you have issued to scan and what has happened then. What is your Elements version? You have stated that you are on Windows 8. It may help to know what is the model of your scanner.

  • More the one Po exists for the material

    Hi Plz help
    System giving erroru201D More then one Po exists for the material" while creating DO for subcontract PO.
    Manju

    Hii,
    Can you tell us the Error Message Number
    Regards,
    Kumar

Maybe you are looking for

  • Applicatio​n builder e run time

    To distribute my software created by application builder , I use "set up generator" program because I can use special colors, pictures and so on. Instead to run lvruntimeeng.msi (30Mb)separately, can I use only specific files (dll or something like t

  • How can i use iPhone 4s in bangladesh?

    I buy a iPhone 4s in UK with a sim.now I use the phone in Bangladesh.i insert Bangladeshi sim in phone a dialog come screen"activation required".i connect WiFi and try to activate but not active the phone.i have no original sim.why I active and use B

  • Why Is My Screen Greenish-Blue?

    I don't know what happened! I was on this survey where I had to view 3 videos. The site said it was installing a new application so I could do that but after I finished I saw that now there's a greenish-blue hue on my monitor and I don't know how to

  • Problem during generating cap file

    hello u all when i am tried to generate a cap file using class file by Converter exception is thown name as java.util.Zip.ZipException ------------please help me solve it.

  • Undefined symbol error when importing PyQt5.Core

    If I try to import (in python) PyQt5.QtCore, issues arise: ImportError Traceback (most recent call last) <ipython-input-1-2bb10a0eb39a> in <module>() ----> 1 import PyQt5.QtCore ImportError: /usr/lib/python3.4/site-packages/PyQt5/QtCore.so: undefined