Dynamic forms with JSF

Hello guys !
I hope you can help me. I am trying to do something with JSF, but I am not sure if JSF is the right approach.
I am trying to build a dynamic web service, based on the information of a web service. That is I dont know the controls ( radio buttons, checkboxed, input boxes) , my form will have in advance, so I dont build any managed bean that maps all the controls.
What I thought , it is to have a collection, which has the description of all the questions and posible answers, and dynamically go through the collection and build the form. (that is something I can do with datatables), and then when the user submits the form , in the action method ...I would recover the "answers" based on the ID or name of the controls, but for my surprise I cannot set the name of the controls with JSF , so I am clueless to send the answers of the form.
I post the fill-up of the form to another web service which very briefl requires someting like this
<answers>
        <answerid></answerid>
        <answervalue></answervalue>
</answers>I might have the value , but not the answerid
Thanks,
Deibys

or is there a way I cam force the id of a control ?
<h:selectOneRadio id="#{question.questionid}"  layout="pageDirection" >
                         <f:selectItems value="#{question.answersOptions}" />
                    </h:selectOneRadio>this does not work for me
org.apache.jasper.JasperException: /encuestaRiesgo.jsp(22,4) PWC6314: According to the TLD, the attribute id is not a deferred-value or deferred-method, but the specified value co

Similar Messages

  • How to save a completed form that was created as a dynamic form, with expandable files?

    I have created a dynamic PDF form with expandable fields etc. As this is to be accessible for customers to completed, how can they save a completed copy on their own PC?
    I tried it myself and I receive an error msg stating that I can only save a Blank Copy of this Form:  Data typed into this form will not be saved. Adobe Reader can only save a blank copy of this form.
    How can I create a dynamic form (with expandable fields/flowable layout etc) that allows the applicant to not only complete the form but also, to save a completed copy?

    Thanks! That worked , however I now have an additional issue.
    While the form works in Internet Explorer (I'm using IE11), in that it's viewable, it opens and allows me to save etc) it doesn't work in Google Chrome and I'm getting the below error message:
    Any ideas on why it doesn't display in Chrome and does in IE (I'm using the same PC and I'm using Adobe Reader XI)!
    there are other PDF forms on site that are not dynamic but are fillable, and these are opening!
    Thanks

  • Dynamic table with JSF

    Hi, ALL!
    I need to create the dynamic table which should be able to automatically add th e rows after getting command from server without redrawing the whole page.
    Is it possible to do it with JSF ?
    Or I have to use smth else?
    Thank you

    You should use ajax.

  • Dynamic Forms with Subforms and Text Fields

    I've been reading all of the messages relating to subforms and dynamic forms and have used many of the suggestions, but haven't found anything that addresses the problem I am having. I'm using Designer 7.0. I've saved my form as a dynamic form, I've set my text fields for multiple lines and expand to fit. My problem is that as soon as I set the parent subform to Flow Content, everything moves to the left margin. I've tried grouping items together within a subform in hopes that the items will maintain their position on the page, but everything always moves to the left margin. I'm creating a legal form that needs to have text and a text field centered at the top of the page. Below that to the left is a text field that needs to be able to expand with two text fields to the right of it. Below that are additional text fields that need to expand as needed.
    Am "stacking" my subforms incorrectly and setting the wrong subform to Flow Content? Or, can you now lock a field to a specific position? Any help would be greatly appreciated.

    Unfortunately, I hadn't understood that you needed the fields to expand in height and everything below them to move down the page. In that case, you'll need to use flowed subforms.
    Having all objects move to the left side of the page is expected when setting a subform to flowed. That's because the flow is top-down, left-right.
    One thing you could try is making the text field that needs to be centered exactly as wide as the flowed subform and then setting its left- and right-hand margins to an equal number. This would ensure an equal amount of space on the left- and right-hand sides and because the field would be as wide as its flowed container (subform), entering multiple lines of text would result in everything below moving down.
    I've attached a sample form where the page subform has been set to flowed, the text field at the top is a multi-line/height-expandable text field with its width set to the page width and its left- and right-hand margins both set to 2in and the button and check box objects are pushed below the text field.
    When text is entered into the text field, it expands in height and causes the button and check box to move down.
    To achieve other horizontal and vertical positioning/offsets, you could play with the margins of all the fields that need this.
    Stefan
    Adobe Systems

  • How to create a dynamic form with bind variables :schema & :table_name

    My application has two LOV's, one to select a schema, and the next to select a table within that schema. I then have a button which passes me to a report which displays the data in that table.schema.
    I now want to create a link to a form where I can edit the record based on the rowid of that table.schema, but it doesn't appear that I can create a dynamic form where I pass the schema.table_name and rowid. Is this possible? Can anyone advise how I can do this? The form builder only wants a fixed schema/table name.
    Thanks in advance.
    Stuart.

    Hi Stuart,
    In this sort of situation, you will need to be a bit creative.
    I would suggest a pipeline function called as if it was a report.
    Then you can pipe out the required fields.
    Since you will have a variable number of fields, you could use two of the multi row field names for your field names and values.
    Then after submit, you can create your own procedure to loop through the fields (stored for you in the Apex package) and update the table as required.
    Not very specific I'm afraid, but it should work.
    Regards
    Michael

  • Pre-populate dynamic form with XFDF

    I am trying to pre-populate a form saved in Designer as a dynamic form. If the form is saved in either the 6.0 compatibile, or the 7.0 static pdf file format, my XFDF file works fine. If I open the PDF in Designer and save it as a dynamic form, the XFDF file opens the form in reader, but no data is populated.
    I have searched everywhere and haven't found any information on this. Any help is greatly appreciated.

    OK... so here's the update. The PDF file only has one vertically expanding field (a "Description") field on the page and it takes up about 2 vertical inches. If I open the PDF in Reader I can type into it and everything expands and flows correctly. If I use an XFDF file that contains a lot of data in the Description field, everything comes up perfectly. However, if I either modify my XFDF file, OR create an XFDF file that only has a tiny amount of data in the Description field (1-2 lines), the PDF is opened and no data is displayed anywhere in the form. If you click on a text field, any data that should be there magically appears. When you navigate out of that field, it disappears.
    This only happens if the XFDF file has a Description field value that doesn't cause the PDF Description field to expand past the 2 inches.
    I am new to Designer 7.0 and this is my first file that has dynamic flowing fields... is this a bug, or am I missing a property somewhere?
    Thanks

  • Clear a form with JSF?

    Hello,
    I have a simple form with a user name and two password fields:
    <h:form>
    <h:inputText value="#{NewUser.name}"
                   required="true"
                   id="newUserName"/>                              
    <h:inputSecret value="#{NewUser.password}"
                   required="true"
                   id="newUserPassword"/>                              
    <h:inputSecret value="#{NewUser.confirmPassword}"
                   required="true"
                   id="newUserConfirm"/>
    <h:commandButton value="#{Message.add_user_cmd}"
                        actionListener="#{NewUser.addNewUser}"/>                              
    <h:commandButton value="#{Message.add_user_clear}"
                        action="#{NewUser.init}"
                        immediate="true"/>                              
    </h:form>
    the init method in the bean just resets the values:
         public String init()
              setName("");
              setPassword("");
              setConfirmPassword("");
              return null;
    All seems fine, but it I enter a name value and hit clear, the value is not removed. I guess there is a simple solution to this as loads of people must need to do it, but I just can't see how?
    Thanks
    Neil

    The submitted value of the component is set to null after updating the corresponding
    managed bean. Because you specify immediate="true", the Update Model Values Phase
    is skipped and the HtmlInputText component still holds the submitted value which is
    used in the Render Response Phase.
    The most simple solution is here:
    <input type="reset" value="clear"/>

  • Building the site structure for a dynamic website with JSF

    Hi,
    I am still a JSF-beginner.
    I try to build a fully-functional base-demo-application with a fix and a dynamic part.
    Fix part for menu, dynamic part for site-content.
    At the moment, the JSF-hyperlinks of the main menu work, but any JSF-parts in the included documents of the dynamic part are not shown. I guess, this is dued to inclusion of subviews, but I cannot find any similar examples in the web to come one step further.
    Here my complete demo:
    faces-config.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
    <faces-config xmlns="http://java.sun.com/JSF/Configuration">
    <navigation-rule>
    <from-view-id>*</from-view-id>
    <navigation-case>
    <from-outcome>site1</from-outcome>
    <to-view-id>/site1.jsp</to-view-id>
    <redirect>
    </redirect>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>*</from-view-id>
    <navigation-case>
    <from-outcome>site2</from-outcome>
    <to-view-id>/site2.jsp</to-view-id>
    <redirect>
    </redirect>
    </navigation-case>
    </navigation-rule>
    </faces-config>
    web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <context-param>
    <param-name>com.sun.faces.verifyObjects</param-name>
    <param-value>false</param-value>
    </context-param>
    <context-param>
    <param-name>com.sun.faces.validateXml</param-name>
    <param-value>true</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
    </context-param>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>
    <welcome-file-list>
         <welcome-file>
    index.jsp
    </welcome-file>
    </welcome-file-list>
    </web-app>
    index.jsp:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <% response.sendRedirect("/jsfportal/site1.jsf"); %>
    site1.jsp:
    <?xml version="1.0" encoding="UTF-8" ?>
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <% String site = "1"; %>
    <%@ include file="base.jsp" %>
    dynamic_site1.jsp:
    <h1>Welcome to site 1</h1>
    Have fun visiting our portal
    site2.jsp:
    <?xml version="1.0" encoding="UTF-8" ?>
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <% String site = "2"; %>
    <%@ include file="base.jsp" %>
    dynamic_site2.jsp:
    <h1>Welcome to site 2</h2>
    Go to site 1: *<!-- And this is the JSF-link that is NOT shown: -->*
    <f:view>
    <h:form>
    <h:panelGrid border="0" columns="0">
    <h:commandLink id="p1" action="site1" value="Site 1" />
    </h:panelGrid>
    </h:form>
    </f:view>
    base.jsp:
    <%@ page language="java" %>
    <%@ page import = "java.io.*" %>
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%
    String title = "";
    int siteInteger = 0;
    String dynamic_site = "";
    if ( site != null )
    if (
    ( site.length ( ) > 0 )
    ( site.length ( ) <= 30 )
    if ( isNumeric ( site ) )
    siteInteger = Integer.valueOf ( site ).intValue ( );
    switch ( siteInteger )
    case 2: title = "Site 2";
    dynamic_site = "dynamic_site2.jsp";
    break;
    default:
    title = "Site 1";
    dynamic_site = "dynamic_site1.jsp"; // Start page
    %>
    <html xmlns="http://www.w3.org/1999/xhtml"
    lang="de" xml:lang="de">
    <head>
    <title>
    <%= title %>
    </title>
    <meta name="description" content="test site" />
    <meta name="keywords" content="test site" />
    </head>
    <body>
    <div width="100%" style="text-align:left">
    <table width="970" border="0" cellspacing="0" cellpadding="0" style="background-color:#ffffaa;margin-top:25px;">
    *<!-- this is not good style putting CSS directly into HTML but it is a demo now ;) -->*
    <colgroup>
    <col width="970" />
    </colgroup>
    <tr>
    <td valign="top" align="left" style="padding:25px;">
    +<h1>+
    JSF portal
    +</h1>+
    </td>
    </tr>
    </table>
    <table width="970" border="2" cellspacing="0" cellpadding="0" style="background-color:#f5f5f0">
    <colgroup>
    <col width="270" />
    <col width="700" />
    </colgroup>
    <tr>
    <td valign="top" align="left" style="padding:25px; padding-left:40px;padding-bottom:320px;">
    <f:view>
    <h:form>
    <h:panelGrid border="0" columns="0">
    <h:commandLink id="p1" action="site1" value="Site 1" />
    <h:commandLink id="p2" action="site2" value="Site 2" />
    </h:panelGrid>
    </h:form>
    </f:view>
    </td>
    <td valign="top" align="justify" class="haupttext" style="padding:24px;">
    <p align="justify">
    <f:subview id="subview1">
    <jsp:include page="<%= dynamic_site %>" flush="true">
    <jsp:param name="" value="" />
    </jsp:include>
    </f:subview>
    </p>
    </td>
    </tr>
    </table>
    </div>
    </body>
    </html>
    <%!
    public boolean isNumeric ( String myInput )
    if (myInput == null || myInput.length() < 1)
    return false;
    int start = 0;
    if (myInput.charAt(0) == '-')
    start = 1;
    for(int i = start; i < myInput.length(); i++)
    if (!Character.isDigit(myInput.charAt(i)))
    return false;
    return true;
    %>
    Who can name me that code positions responsible for that the JSF link in the dynamic part is not shown?
    It is not that it does not work it is not shown. The JSF tree seems to be cut because of wrong use of view and subview etc.
    (To put view tags in site1.jsp and site2.jsp does not help.)
    (Once having afforded an example it should go... (*Then* with JSTL, external CSS, etc. ;) )
    Dynamical site structure with include files is the big problem at the moment.)
    bye, Maik

    I found your following suggestions for such cases (seems you are the only profound JSF freak in the world...? :-) )
    Switch between subviews in one main page
    http://balusc.blogspot.com/2007/01/dynamic-jsf-subviews.html
    But the main problem for me is that I never find complete examples, but always fragments and it would be important for a beginner to have at least once a complete JSF example over a few subviews, especially here where it is very easy to corrupt the internal tree.
    (Some examples use the subview tags in the calling JSP, some in the called e.g.... Does not matter where to put it? Some use verbatim tags for HTML code outside JSF, some don't... and so on)
    Can anyone give me an URL for a complete example of a JSF site (with all files as possible, I am not very patient, too, but in this case it makes sense to have it entire ;-) ) with dynamic switches of subviews as preferentially used for bigger portal sites?

  • Dynamic form in jsf?

    Hi all, i am very new to JSF. I was wondering if it were possible to create a dynamically changing form using only JSF (without java script). Say, i need a tabbed pane that will have tabs added on clicking some button on the screen. If it is possible, does anyone know of a good code sample online? Thank you very much!!

    OK, this was a bad example. Here is another example:
    JSF:<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@taglib uri="http://www.ibm.com/jsf/BrowserFramework" prefix="odc"%>
    <odc:tabbedPanel binding="#{MyBean.tabbedPanel}" />
    <h:form>
         <h:inputText value="#{MyBean.bfPanelId}" />
         <h:inputText value="#{MyBean.bfPanelName}" />
         <h:commandButton value="add" action="#{MyBean.addBfPanel}" />
    </h:form>MyBean.javapackage mypackage;
    import com.ibm.faces.bf.component.html.HtmlBfPanel;
    import com.ibm.faces.bf.component.html.HtmlTabbedPanel;
    public class MyBean {
        // Inits
        HtmlTabbedPanel tabbedPanel = new HtmlTabbedPanel();
        String bfPanelId;
        String bfPanelName;
        // Actions
        public void addBfPanel() {
            HtmlBfPanel bfPanel = new HtmlBfPanel();
            bfPanel.setId(getBfPanelId());
            bfPanel.setName(getBfPanelName());
            getTabbedPanel().getChildren().add(bfPanel);
        // Getters
        public HtmlTabbedPanel getTabbedPanel() {
            return tabbedPanel;       
        public String getBfPanelId() {
            return bfPanelId;
        public String getBfPanelName() {
            return bfPanelName;
        // Setters
        public void setTabbedPanel(HtmlTabbedPanel tabbedPanel) {
            this.tabbedPanel = tabbedPanel;
        public void setBfPanelId(String bfPanelId) {
            this.bfPanelId = bfPanelId;
        public void setBfPanelName(String bfPanelName) {
            this.bfPanelName = bfPanelName;
    }Note that I'm using IBM's odc components. I don't have experience with Tomahawk, but this might give you some insights.

  • Dynamic forms in jsf

    Hi all,
    This question has probably been asked a thousand times, but I can't find the answer.
    I am an experienced Struts developer, but now I want to create an application using jsf.
    It will be some kind of quiz with multiple choice questions. The problem is that the number of questions is not fixed, so for 1 quiz there can be 10 questions and for another one 20.
    In struts I know that there is something called map-backed action forms that can be used for this kind of thing.
    Does jsf have something like this? I can't seem to figure it out.
    Thank you.

    There is one thing that I don't like in the example. The generation of components in the backing bean. I am trying to generate them inside my jsp, but it won't work.
    This is the code I use.
    The jsp page
    <body><h:form binding="#{backing_quiz.form1}" id="form1">
            <p>
              <h:dataTable value="#{backing_quiz.questions}" var="question">         
                <h:column>                   
                  <h:outputText value="#{question.questionText}"/>
                  <h:selectOneRadio layout="pageDirection">             
                        <f:selectItems value="#{question.answers}" />                       
                  </h:selectOneRadio>             
                </h:column>
              </h:dataTable>
            </p>
            <p>
              <h:messages/>
            </p>
            <p>
              <h:commandButton value="commandButton1"
                               binding="#{backing_quiz.commandButton1}"
                               id="commandButton1"
                               action="#{backing_quiz.commandButton1_action}"/>
            </p>     
          </h:form></body>The backing bean with session scope.
    public class Quiz {
        private HtmlForm form1;
        private HtmlDataTable dataTable1;
        private HtmlCommandButton commandButton1;
        private ArrayList questions = null;
        private HtmlSelectOneRadio selectOneRadio1;
        private UISelectItem selectItem1;
        private UISelectItem selectItem2;
        private UISelectItem selectItem3;
        public void setForm1(HtmlForm form1) {
            this.form1 = form1;
        public HtmlForm getForm1() {
            return form1;
        public ArrayList getQuestions() {
            if(questions == null) {             
                System.out.println("Create new list");
                questions = new ArrayList();
                Question question = new Question();
                ArrayList answers = new ArrayList();
                answers.add(new SelectItem(1,"vraag 1 antwoord 1"));
                answers.add(new SelectItem(2,"vraag 1 antwoord 2"));
                answers.add(new SelectItem(3,"vraag 1 antwoord 3"));       
                question.setQuestionText("vraag 1");
                question.setAnswers(answers);
                questions.add(question);
                question = new Question();
                answers = new ArrayList();       
                answers.add(new SelectItem(1,"vraag 2 antwoord 1"));
                answers.add(new SelectItem(2,"vraag 2 antwoord 2"));
                answers.add(new SelectItem(3,"vraag 2 antwoord 3"));
                answers.add(new SelectItem(4,"vraag 2 antwoord 4"));
                question.setQuestionText("vraag 2");
                question.setAnswers(answers);
                questions.add(question);
            return questions;
        public void setDataTable1(HtmlDataTable dataTable1) {
            this.dataTable1 = dataTable1;
        public HtmlDataTable getDataTable1() {
            return dataTable1;
        public void setCommandButton1(HtmlCommandButton commandButton1) {
            this.commandButton1 = commandButton1;
        public HtmlCommandButton getCommandButton1() {
            return commandButton1;
        public String commandButton1_action() {
            // Add event code here...
            System.out.println("add item with number " + (((Question)questions.get(0)).getAnswers().size()+1));
            ((Question)questions.get(0)).getAnswers().add(new SelectItem((((Question)questions.get(0)).getAnswers().size()+1) , "Nieuwe vraag " + ((Question)questions.get(0)).getAnswers().size()+1 ));
            return null;
    }The commandButton1_action() needs to add an answer to the first question. This is in fact the backsite where quizes can be created.
    When the action is called an it's redirected to the same page, the answer is added, but due to the fact that the page is rerenderd, the previously selected are gone.
    Is this clear or do I need to give more explanation?

  • Certified dynamic form with 3 signatures

    I've never made a certified form before and I'm having trouble understanding the process. Does anyone have a generic certified form that I can use as a guide or an indepth article explaining this type of form?
    What I want to happen is for the features bar (Help and Radio buttons, and Clear button) at the top of the form to become invisible after the first signature is applied. The features bar isn't a legal portion of the form. It becomes a distraction for one wanting to archive a .jpg copy and it would look better for it to just disappear on signing.
    The form is dynamic otherwise the Radio button labels won't go invisible on demand.
    Adobe's instruction aren't helpful. They state one must change the "Preserve scripting changes to form when saved:" to manual and write script for the preSave event and use the delta property for a certified form. There are no examples of this that I can find.
    The problem I'm having occurs when the form is signed in all 3 places. There follows a list of all the changes made to the form after signing.
    The signing flow is from left to right. Prior to the last signature, the signer checks an approval/disapproval box and dates the decision. The last signature (on the right) locks the form using the "Form Object Collections..." statement modified to suit the situation.
    Any help is appreciated.
    Thanks,
    Fred

    hi raf--
    i just checked our queue of enhancement requests and have no further word to offer on our built-in dml proc's being able to support compound pkeys of more than two columns. it's in the queue, though, so that's a start. re coding the proc's yourself: it's really just a matter of fetching the data you need in one proc and updating it in another proc. the only level of complexity that comes to mind would be implementing some kind of optimistic locking mechanism to maintain data integrity. these three pieces can be quite easily divided into two processes on an HTML DB page. have the fetch process fire with a "Process Point" of "On Load - After Header" and the update one fire "On Submit - After Computations and Validations". the rest of the solution is just pl/sql.
    hope this helps,
    raj

  • Dynamic form with multiple master pages

    I have a 7 pg form that has different data in the footer area. I placed the footer info on it's own separate master page and set the page to the corresponding page numbers. I moved the content area above the footer section so my content can flow to the next page properly. But my problem is since I set the Pagination area to "Place: Top of Page "Page 2" and the rest accordingly, I'm getting an almost blank page with the data from the previous page and the next page pushes to a separate page of its own for every page. Not sure how to make the form flow continuous, this is my first time having to do a form this way. Typically I set the pages when I'm done to "Following Previous" instead of "Top of Next page" in the Pagination Place field for each section and everything works fine then. I've never had to deal with a different master page for each page in the form.
    Any help or suggestion would be greatly appreciated.
    Jim

    If you have 7 pages with different footers, wouldn't it be easier to have the footer also part of the body page instead of Master page.
    Unless you are adding dynamic content at runtime, you can keep the footer in the body page itself. That way you can avoid multiple master pages.
    If you still have issues, you can share the form, so I can have a look at it.
    Thanks
    Srini

  • Controlling instances in  dynamic forms with a  strange twist.

    Hello,<br /><br />Is there a way to program a numeric text field that controls the number of instances of a subform? For example, I would like to have a nested subform appear twice in the form if the user enters 2 in the numeric field. But more importantly, I would like to see its corresponding XML output appear like the following:<br /><br /><SUBUNIT_1><br />   <LENGTH></LENGTH><br />   <SEQUENCE><br />       ELEESGGGLVQPGGRQSPEKGLETHYAE<br />   </SEQUENCE><br />   <N_TERMINAL>Yes</N_TERMINAL><br />   <C_TERMINAL></C_TERMINAL><br /></SUBUNIT_1><br /><br /><SUBUNIT_2><br />   <LENGTH></LENGTH><br />   <SEQUENCE><br />       ELEESGGGLVQPGGRQSPEKGLETHYAE<br />   </SEQUENCE><br />   <N_TERMINAL>No</N_TERMINAL><br />   <C_TERMINAL></C_TERMINAL><br /></SUBUNIT_2><br /><br />If you pay close attention to the above code, you will see that I want the parent tag's ending digit incremented each time the subform is repeated.  <SUBUNIT_1> <SUBUNIT_2> <SUBUNIT_3> ect  . . .<br /><br />That is the twist! Is this programmatically possible?<br /><br />Regards.<br /><br />Harold

    Harold,<br /><br />The code to create a specific number of instances is as follows:<br />JavaScript <br />Subform1.setInstances(2); <br />or<br />Subform.instanceManager.setInstances(2); <br />FormCalc <br />comments.setInstances(2); // Subform name = comments <br /><br />If you are looking for documentation watch out: it's listed as setInstance rather than setInstances!<br /><br />If your form is associated to a specific data structure via a Data Connection (typically an XSD) then a subform repeats based on a repeating element in  the XML or, if the subform instances are instatiated programatically as yours would need to be, then the generated data will have repeated elements.<br /><br />If, however, your form fields are not bound to any specific data structure then you've got your work cut out but I think you could achieve the twist you require. I think you will have to write some code to build the XML structure that you require. Your code can refer to the fields on the form to extract the data and build the <dataset>. You'll need to know about scripting DOM (Document Object Model) to achieve this.<br /><br />A third option, if you are using Forms Server or LC Workflow to process the form submission, is to write Java code that processes the submitted data and transforms it to the required strucure.<br /><br />Or a fourth that has just crossed my mind is to associate an XSLT stylesheet to the form to process the outgoing doing. I'm afraid I don't really know any more about that to be 100% sure that would satisfy your requirement.<br /><br />Hope these ideas help.<br /><br />Neil

  • Dynamic Forms with Bindings

    Hello all,  need some help,
    I have an odbc connection to an excel file and I have made a data connection to the excel document. I can see my two fields in my dataconnection.
    What I want to do is for each row in my excel table I want to output its counterpart field and value on the pdf document. but I am having trouble doing this. I can only output the first row. I have made a subform and set it to minimum 1 instance. Please see my image below for a better explanation, I would really appreciate if somebody could explain to me how I can do this, or even better give me an quick example file.
    http://docs.google.com/Doc?id=dcj7tdvs_4fwbq65qf

    On line 57 of the script I added this code:
    // Loop through each record and make a new instance of MovieSF for each one
    //initialize a countervar  j = 0;
    while (!oDB.isEOF())
         //Get a reference to exist subforms (o indexed)
          if (j <= 3){ 
              var oNewPerson = xfa.resolveNode("ExpandingSF[" + j + "]");     }
    else {  
              // Create a new instance and get a reference to it.
               var oNewPerson = _ExpandingSF.addInstance(0);     }
         //increment counter
         j = j + 1;
    Paul

  • Itextsharp using livecycle form with dynamic table

    Hello all, after searching Google for the past two days and not able to find any relevant information, hence this post.
    Some background:
    1) Created a pdf form using Adobe Livecycle designer 9.
    2) It is a dynamic form with textboxes and a table configured to repeat rows dynamically.
    3) Testing form using xml data within designer works just fine.
    Requirement:
    Need to populate form dynamically using data from database.
    Solution:
    Found iTextSharp (free assembly) which assists with populating existing pdf form.
    Issue
    This assembly works without any issue when populating textfields (see sample code below). The problem I am facing is with the dynamic table where in I am not able to reference rows greater than 1. Since the pdf template contains a table with just one row referencing the first row using acrofield works.
    I was under impression since this is a dynamic table with repeat enabled, in asp.net if I referenced row2 onwards the table would grow automatically. Which I have come to realize is not going to be possible.
    So I am looking for ideas on how I can accomplish this. I wish this could have been a fixed row table then reference rows would have been easier. However in this situation the table has to be dynamic.
    Any ideas thoughts would be appreciated.
    Below is my sample code:
    PdfStamper ps = null;
    try {
    // read existing PDF document
    PdfReader r = new PdfReader(
    // optimize memory usage
    new RandomAccessFileOrArray(Request.MapPath("itext.pdf")), null
    ps = new PdfStamper(r, Response.OutputStream);
    // retrieve properties of PDF form w/AcroFields object
    AcroFields af = ps.AcroFields;
    // fill in PDF fields by parameter:
    // 1. field name
    // 2. text to insert
    af.SetField("txtCompany", "Company name");
    af.SetField("txtDateDepartLocation", "date depart location");
    af.SetField("txtDate","test date");
    af.SetField("txtServiceNumber", "Service number");
    af.SetField("Table2.Row1.Cell1", "1test");  this works
    //doesnt work!!!
    af.SetField("Table2.Row2.Cell1", "1test");
    af.SetField("Table2.Row3.Cell1", "1test");
    // make resultant PDF read-only for end-user
    ps.FormFlattening = true;
    // forget to close() PdfStamper, you end up with
    // a corrupted file!
    ps.Close();
    catch { }
    finally { if (ps != null) ps.Close(); }

    Hi FourEyes;
    Try using this.
    Select Col1, Col2, Col3
    into :P1_Field1, :P1_Field2, :P1_Field3
    from Your_Table
    Where (your conditions);

Maybe you are looking for

  • A big problem: The Application Deads During Running.

    Hi! everyone: We four colleagues are developping an application use the observer/observerable pattern. In the normal case, this application starts about 20-40 threads some of which repait the GUI and some manipulate the database. With no exception an

  • Can I use my iPhone in china

    Can I use my iPhone 4S bought in the US in china?

  • Itunes help rated songs that shouldn't

    hello, has anyone else had the problem of one day opening up you itunes and you have a whole bunch of rated songs in my top rated that you didnt even do. they are at a 5 stars but there not solid black like when you normal rate songs there a transpar

  • Search a file in KM using a custom coding using KM APIs

    Hi, How can I search a file along with its verions in the KM repository using KM APIs? Thanks, Vamshi

  • Airport Extreme card mysteriously just stops working

    While rushing out of my flat yesterday, I closed my Powerbook, while downloading files from Firefox. Upon getting to work, I noticed that the Airport status was not in the menu bar. I was quite surprised to find that system preferences and system pro