Dynamic Form Creation in JSF

Hi ,
I wanted to know how to create dynamic form meaning in Database i have some rows and the user is provided the option to chose which all he wants to include... Only using the ticked ones i need to generate the form...
Can anyone tel me hw to do dis

Use the rendered attribute to conditionally show fields or not. It will be far less work than generating a dynamic form with a matching dynamic backing bean...

Similar Messages

  • Dynamic form creation

    Hi all,
    Does anyone know if it is possible using dreamweaver, php and mysql to create a web form dynamically dependant on which database fields are active?
    Basically, I have a survey table to collect the data and an active fields table. What I wish to do is have the survey form entry page change automatically dependant on which fields are marked active in the 'active fields' table.
    e.g.:
    Survey Table:
    - Survey Item 1
    - Survey Item 2
    - Survey Item 3
    Active Fields Table:
    - Survey Item 1 - True
    - Survey Item 2 - False
    - Survey Item 3 - True
    In the above example a form would be created showing only Survey Items 1 & 3. If 2 was set to true, then the form would show survey items 1, 2 & 3. The created form should allow the user to be able to enter the relevant data which is then saved back to the database.
    To make things slighty more complex, it would be great if these fields could be placed in particular areas of the page depending on category type:
    e.g.:
    Survey Item 4 is added and belongs to Survey Item 1's category (defined in the Active fields table), so would therefore show as;
    Survey Item 1
    Survey Item 4
    Survey Item 2
    Survey Item 3
    Any ideas, pointers, links or vids would be gratefully received. Thanks in advance.
    Regards
    Paladindc

    Sure, it's possible, but you would need to code this by hand. It's not a good data model.
    Take a look at this thread for a better data model:
    http://forums.adobe.com/thread/824129?tstart=0
    That model would allow you much more flexibility and would be much easier to achieve what you are attempting.

  • 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 Form componants in my jsf page?

    how could i make dynamic form componant in my jsf page ,depend on user inputs or result from database or whatever , where i use sun studio creator ???

    you need to use the "rendered" attribute of the components...
    for example in your jsp put this...
    <h:outputText value="Hello" rendered="#{myBean.renderHello}"/>
    the render hello method looks like this in your backing bean "myBean"
    public boolean getRenderHello() {
    return true; // or false
    if getRenderHello() returns true, "Hello" will be displayed, if getRenderHello() returns false, it will not...
    you can also use expressions in the jsf... for example...
    <h:outputText value="Hello" rendered="#{myBean.someNumber == 5}"/>
    if the "getSomeNumber()" method in your backing bean returns 5 it will be true and "Hello" will show up... otherwise it won't... :)
    Hope this helps...
    -Garrett

  • XML Schema binding - dynamic form

    I am new to Designer and XML. I have been given a basic interactive form and have persevered for a couple of (often frustrating) weeks to extend its functionality to link to an xml schema and provide for dynamic record creation. Unfortunately I am still having problems when adding new instances of subforms.<br /><br />I have a main form for reporting issues. Underneath it there are major components on a subform (can be multiple major components for each issue) and under major components are sub-components (can be multiple sub-components for each major component) on a child subform of major. I can add and delete instances of the subforms for both levels of records.<br /><br />I have created an xml schema based on the form since it already existed, and so the form fields have not inherited properties from the schema. However, I have bound the fields in the form to the xml fields through a data connection. The schema basically looks as follows (bot not literally the same as you will see from the tags):<br /><br /><element complextype issue><br />   <element issueId string/><br />   ...<br />   ...<br />   <element complextype majorcomponent unbounded><br />   <element majcomponentname string/><br />   ...<br />   <element complextype subcomponent unbounded><br />      <element subcomponent string/><br />      <element quantity string/><br />      ...<br />      ...<br />      </element><br />   </element><br /></element><br /><br />My problem is as follows: <br /><br />When I add an instance of a sub-component or major component subform, the first new instance appears to work correctly. However, every subsequent one inherits the values of the previous record and when it is changed, it changes the values of existing fields of the same name but of a different node. When I change each element in the xml schema to "unbounded", the forms appear to work properly but the values are then not nested correctly in the outputted xml data file (many records will appear under one sub-component, for example, when a new sub-component should be added for each).<br /><br />I suspected my problem might be that the "unbounded" property in the schema of the major component and sub-component elements are not linked to the Designer form because the major component and sub-component subforms are not bound to the xml schema. The reason they are not bound is because if I bind the subform, the first element, major/sub component name as applicable, loses its binding.<br /><br />I am sorry if this doesn't make any sense but I am hoping that someone might recognise the problem I am talking about as it is really creating much bother.<br /><br />Thanks.

    Thanks Justin for the reply. Unfortunately I can't explain exactly what was happening because I didn't keep sufficient notes and now the form is behaving differently. You are right in that when I bind the subform to the xml schema element, child fields do change their bindings from a full to a relative path. I had seen this before on all except the first field on a subform, which had losts any binding reference at all.
    I finally gave up on the schema and bound the forms to sample xml data. This fixed my problem. Now (several days later), I have revisited the problem and deleted my data connection to the xml file to connect to the schema once again. I am quite sure I have not changed the schema at all, nor the form, but for some reason it now appears to work correctly.
    I will continue to work with it, once again but thanks very much for your interest.

  • Dynamic Table Creation & Fill Up

    Hello,
    Can anyone please guide where I can find examples for dynamic table creation (programmaticaly), with dynamic number of columns and rows, used to place inside text components (or whatever) to fill them with data.
    All programmatic.
    Using JSF, ADF BC
    JDeveloper 10.1.3.1
    Thanks
    Message was edited by:
    RJundi

    Hi,
    Meybe this article helps: http://technology.amis.nl/blog/?p=2306
    Kuba

  • Can someone point me to a dynamic form example?

    I'm very new to JSF.
    Simply put, I want to be able to create a page that can have a dynamic form on it. A form with potentially several fields on it defined at run time. Making it even more exciting, it will ideally support the File Upload as well.
    Do I need to create an entire JSF component for that, or can I assemble standard JSF components at run time and present the page?
    Is there an example somewhere that someone could guide me to?

    take a look at: http://jroller.com/page/RickHigh/20051130

  • A very comlicated dynamic form

    Hi guys,
    I am pretty new to JSF and I have to get a dynamic form working. Here you can see a mockup of the form, which has to be created. Blocks of drop down filed should be added and removed dynamically by clicking on the "+" and "-" buttons.
    My first idea was to make templates for the different blocks as follows:
    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:s="http://jboss.com/products/seam/taglib"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:a4j="http://richfaces.org/a4j"
          xmlns:rich="http://richfaces.org/rich">
                                       <h:panelGroup>
                                            or<br />Can
                                            <h:selectOneMenu styleClass="components">
                                                 <s:selectItems value=""     noSelectionLabel="Select Subject" />
                                            </h:selectOneMenu> execute
                                            <h:selectOneMenu styleClass="components">
                                                 <s:selectItems value="" noSelectionLabel="Select Operation" />
                                            </h:selectOneMenu> on
                                            <h:selectOneMenu styleClass="components">
                                                 <s:selectItems value="" noSelectionLabel="Select Object" />
                                            </h:selectOneMenu>
                                       </h:panelGroup>
                                       <h:panelGroup>
                                       <h:commandButton value="+" styleClass="components"/> <h:commandButton value="-" styleClass="components"/>
                                       </h:panelGroup>
                                       <h:div name="mydiv"/>
    </ui:composition>and then update these divs with the templated blocks. Unfortunately I dont know if that would be the right way to go. I would appreciate it if you could steer me in the right direction with some code examples and ideas.
    MANY THANKS!

    Thank you for the reply. So on the back I will have something like an arraylist of row objects and the + and - would remove objects from the list? Am I getting it right? Do you by any chance know any tutorial or an example to which i refer?
    Thanks!

  • Create a dynamic form where selected text boxes appears, based on options chosen in a drop-down box

    HELP!!! Can anyone please provide some guidance on how to create a dynamic form where selected text boxes appears, based on options chosen in a drop-down box.
    I have a form which – based on the department that's selected from a drop-down box – will have different form fields/text boxes, etc, made available.
    Is this possible in LiveCycle, if so, can you please provide the script/info - as needed.
    Thanks,

    In the preOpen event of the second dropdown list you put something like (in formCalc):
    if (dropdown1 == 1) then
    $.clearItems()
    $.setItems("Year, 2 Year,  3 Year")
    elseif (dropdown1 == 2) then
    $.clearItems()
    $.setItems("3 Year,  4 Year")
    endif

  • Get values from dynamic form items

    Hi All,
    I create a dynamic form with text input component
    private function buildForm():void{
                    var numberOfColumns:Number = 5
                    var formItem:FormItem = new FormItem();
                    var hBox:HBox = new HBox();
                    for(var i:Number=0; i< numberOfColumns; i++) {
                        var formInput:TextInput = new TextInput();
                        formInput.text = "test";
                        formInput.id = "txt_" +i;
                        hBox.addChild(formInput);
                    formItem.addChild(hBox);
                    loansForm.addChild(formItem);
    I can see the text input components, update the values.
    How can I get the updated values from the input components?
    I try  this["txt_" + i].text  but not working. It's not finding the component with the dynamic value.
    Any ideas?
    Thanks
    Johnny

    Hi,
    Here is the related thread, u will get some help
      http://forums.adobe.com/message/3075226
    Thanks and Regards,
    Kanchan Ladwani | [email protected] | www.infocepts.com

  • 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

  • Dynamic Forms and WF

    Hello,
    I have designed a dynamic form, where user can add rows dynamically by clicking a button on the form, the form is working fine in preview in designer.
    this form is initiating a LC WF process, but, if I deploy this form to form manager as an XDP and choose to render it to PDF, adding rows function does not work, however if I save this as dynamic PDF from LC designer and deploy it again to form manager, it works !!
    However, I can not use PDF generated from LC Designer since I found that commenting and annotations are not working ( I am using acrobat ) which is an important feature, also, web services calls are not working even, again from Acrobat!
    How can I set the form server installed with workflow server to render XDP templates into dynamic PDF forms ?
    Or alternatively how to enable commenting and fix web service calls in PDF rendered form ?
    Thank you for help,
    Greetings,

    By default Forms and Form Manager are configured to render a PDF as either static or dynamic based on some values in the XDP. By default those values will tell it to render a static PDF. What you can do, in Designer save as a dynamic PDF, then open the dynamic PDF in Designer and save as an XDP. Upload that XDP to Form Manager, the tags will be present to tell it to be rendered as a dynamic PDF. There's a better way if you are using Designer 7.1 and Forms 7.1, but since I don't know your environment this is a way that will work regardless of versions.
    Annotations will not work in dynamic PDF's though. Currently annotations make no sense in dyanmic PDF's since the template of the PDF can dynamically change while annotations are bound to a specific location. IE: You have a dynamic PDF that is initial 4 pages and add an annotation to page 4. Later the template of the PDF changes based on data and user interaction and it is now a 2 page PDF, but the annotation is still on page 4 which no longer exists...
    Chris
    Adobe Enterprise Developer Support

  • Remove scroll bars in dynamic form

    Hi all,
    I'm starting to kick myself every time I put a post here.  Apologies and thank you for everyone's help - slowly but shortly I'll be one of the people answering the questions.
    Really easy one (I think).  A have a dynamic form, which updates a dynamic list.  Is there a way to alter a text area in the dynamic form, so that it is a fixed area  i.e. when you get to the end of the line/characater usage, the cursor goes down to the next line rather than creating a horizontal scroll bar and running forever into the distance.  I have played around with Wrap options without luck, the css doesn;t seem to play much of a part as this is an actual text area in Dreamweaver as opposed to a CSS clipping in the list.
    Thanks again,
    Nathan

    NJFuller wrote:
    Perfect! Thank you Albert.  Is it possible to add virtual wrap to a box in a dynamic list?  As that is not presented in a normal html form'ish style way.....?
    Hi Nathan,
    as a Dynamic List displays pure text only, you´ll need to help yourself by formatting the displayed column using PHP. There are several ways to add "virtual" line breaks, and the most straightforward (though certainly not the most elegant) solution would be to apply the PHP function wordwrap which wraps a string to a given number of characters.
    The following example will wrap the text after 40 chars, and the "wordwrap" function will - as always - have to replace ADDT´s default "KT_FormatForList" function:
    <?php echo wordwrap($row_rsqueryname1['columnname'], 40, "<br />\n"); ?>
    Cheers,
    Günter

  • How to make my dynamic form pages flow correctly?

    I have created a dynamic form which has multiple questions with expandable text fields that will take multiple pages once completed.  I do not know how to make the form flow correctly past the first page.  I can attach the form if I knew how to do that.

    Thank you Paul.  Your editing assistance was greatly appreciated. I think I now understand that there should be only one page subform that is flowed, regardless of how many text box objects I have in my questionnaire. This did the trick.

  • Is it possible to update multiple tables with a dynamic form?

    I have columns from two tables populating a dynamic form. I am trying to have the form update both tables on submit. I have tried both a linked transaction and a custom transaction but I am not making progress. Only the master table is being updated. Is it possible with ADDT to update two tables with a dynamic form?

    I meant
    SXMSMSTAT
    SXMSSYERR
    Thanks.

Maybe you are looking for