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

Similar Messages

  • How to get the Dynamic UI component value from JSFF page to any managedbean

    HI ,
    We have list of bean objects in jSF page we are iterating the list of bean using the forEach loop and displaying the value into Input type text (UI component) value filed .
    If we try to get the UI component value in Managed bean we are not getting the dynamic values .
    The below piece of code used to retrieve the dynamic values from the JSF page doesn't have any form :
    UIComponent component = null;
    FacesContext facesContext = FacesContext.getCurrentInstance();
    if (facesContext != null) {
    UIComponent root = facesContext.getViewRoot();
    component = findComponent(root, componentId);
    then component type casting to the based on UI component which we trying to access and getting the value as " NULL " ..Please let me know how to get the dynamic values form the JSF ?
    Please let me know if any other approach or any changes required on above ?
    Thanks

    Hi,
    the root problem is this
    <h:inputText id="it3" value="#{familyList.ctn}" />
    <tr:commandButton text="Save" id="cb3"Note how each row writes to the same managed bean property, thus showing the same data. Instead your managed bean should expose a HashMap property that you then apply values to using a key/value pair. The key could be the ID of the field, which then you also should dynamically define e.g. cb<rowIndx>. The command button could then have a f:attribute assigned that has the row HahMap key as a value. This way you truly create value instances for the object
    Frank

  • Is it possible to use two diff forms in same jsp/jsf page?

    Hi all,
    My requirement is to submit the form based on selection of radio button.
    since half part needs to be jsp based which is not using any tags etc.
    But i am trying to use some jsf based component which requires to be inside <f:view><h:form> of
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    i.e. some <c:comboBox>
    </h:form> </f:view>
    Now earlier i was submitting the form as
    <form action="/techstacks-v2_1/reportAction.do" method="post" name=doSearch id='doSearch'>
    But now i found, in order to use combo box component which is entirely jsf based i need to use <f:view><h:form> which is kind of taking over the previous form submission mechiansm.
    I am trying to keep them separate as two differnt forms.
    one entirely jsp based and other as jsf based.
    Now my question is can i use such way of doing so or is there any better way of implementing so.
    My friend suggested that i can pass the value of jsf based form in hidden form to a input box of form to be submitted finally instead of submitteing two diff forms.
    but in that case also i ahev to use two forms in a single jsp/jsf page.
    suggest me something which can really work out.
    thanks
    vijendra

    You can use as many forms as you want as long as you don't nest forms. The HTML spec probibits that.

  • Making dynamic form flow on to next page

    Hello,
    I am trying to make a dynamic form that is expandable. I have succeeded in creating expanding fields, but have been unsuccessful in convincing those fields to flow on to the next page (which I have added). I have set all the content for my fields to flowed and have allowed page breaks in all of them. I suspect there might be a pagination issue, but I have not found any solid information about how to use it correctly. If I select any option other than the default in pagination (while the subform at the bottom of the page is selected), the whole form disappears. I realize I may have some inherent flaws in my design and will perhaps need to start over, but if anyone had a list of requirements for making things flow to the next page (after a set margin at the bottom of the page, i.e. at 1" from the bottom, the field entry splist, and continues at 1" from the top of page 2), I would be grateful.
    Thanks!

    Hi,
    I wondered if you might be able to help me solve another flow issue? I've got my form working quite well now, but I', having an issue with the text fields. My fields have captions that ask a question, and the response should be in the field. I wondered if there was a way to make the text fields wrap onto the beginning of the next line as they expand, rather than going onto the next line at the limit of the text field. For example-
    What is your favorite color?: (the response continues here and goes all the way to the end and on to the next
    line and continues here.
    rather than-
    what is your favorite color?: text text etc etc
                                              text text text etc etc.
    Does that make any sense? Is it possible? Should I throw this to the forum?
    Thanks!

  • Dynamic Form to Stop repeating when page is full

    I have a dynamic form with a repeating subform .. I want the form to stop repeating once it reaches the end of the page (whether horizontally or vertically)- At the moment, it goes off the page & continues repeating.. Is there a solution for this?
    Thank you!!

    Thanks, but the problem is Im designing a form similar to a blog that grows horizontally & vertically depending on the post / (subform instance) you reply to.. so there is no way of knowing at what instance it will reach the end of the page.. It might be the 10th or the 17th for example...
    Any help will be very greatly appreciated!
    Thanks

  • When my dynamic form is saved, the added pages (subsections) disapear.

    I have created a form and saved it as a dynamic file.
    There is a button to copy a subsection and allow the user to continually add section
    s and fill them out. When the user saves the form, the additional pages
    are not visable the next time the pdf is opened
    I dont see how to attach my form to this.
    thanks, Mark

    Open your form in Designer, under File/FormProperties/Defaults make sure the "Preserve script changes to form" is set to Automatic
    Paul

  • ORACLE 11G: Embedding an ORACLE Form within an ADF JSF page

    We are currently reviewing the options available to allow us to embed an ORACLE 11G form within an ADF application (11.1.1.4), we are aware of the 'oraformsfaces' functionality but wanted to ask whether there were any other options available to us within ORACLE 11G?
    The reason for the question is that we were informed by ORACLE prior to upgrading to ORACLE 11G that the facility to embed an ORACLE form was 'standard' within ADF 11G hence the reason for upgrading.
    Thanks in Advance!
    Neil

    As I noted before, when you seamless, if you mean the user will be unaware that he has switched from a Forms app to an ADF app then I think he will notice - some clever integration of things like JS maps and Graphs might be seamless but a complete ADF app would be obvious to a user. Physically the Forms widgets are a different technology to ADF Faces - you can get the colors the same, you can event get the widgets the same size but it will pretty much be impossible to get the same because you are not comparing apples and apples.
    Regarding your questions
    1) Do you mean the time it takes to start up the applet? Possible longer than ADF but not necessarily
    2) Each form runtime process will have its own database connection and each user has his own applet.
    3) "Considerable" is subjective - it will involve some work but we specifically built the JS api to help
    Your last point - are you refering to "evolve core business logic into a common layer" what I mean here is that if you have a business process (e.g. hire_employee) which involves creating a new record,ordering a laptop and getting a security pass - then you could take that code out of Forms and put it somewhere else. You could then call that code from Forms (your old apps that you still need) and also call it from your new apps (so calll that code rather than calling the Forms application to do the job). - Of course, there is effort involved there...
    One final point to make ADF is NOT Forms - its not the "new" Forms and it doesn't replace Forms - so any change between Forms and ADF is by no means "go to the next version" - they are different technologies with different sweet spots - moving one to the other will be a considerable effort, and I would say one which should also accompany business process changes (if possible) as well..
    Hope this helps
    Grant

  • Calling a method in the Custom ADF component from JSF page

    HI.
    I have created some custom compoents by extending the core ADF Components. Like i have a ComboBoxDefault component with it's ComboBoxDefaultTag.java and Controls.tld file.
    Now my requirement is i want to bind my label to this component from the JSF page. like
    <fwcontrols:label binding="#{listComponents.comboBoxDefaultLabel}" id="label1"/>
    <fwcontrols:comboBoxDefault binding="#{listComponents.cmbLocales}"
    value="en_GB" id="comboBoxDefault" autoSubmit="true" label="label1">
    <f:selectItems value="#{listComponents.locales}"/>
    </fwcontrols:comboBoxDefault>
    In my JSF page the label will have an id, and that id will be specified in the label tag of the component.
    In Tag.java file i have overrided the setProperty(FacesBean facesBean). In this method i have bind all my properties. In core JSF the setProperty method is provided with the UIComponent parameter, so i can call my method in component also. Which is not in case of ADF Faces.
    My main point is how i can call my method setLabel() which is in ComboBoxDefault.java so that i can set the label.
    Thanks in Advance.

    Thanks for all your replies. I want this kind of a functionality because Im trying to invove a DC (Child DC) from a Parent DC such that the Child DC's view is displayed onto the view container of the Parent DC. I have embedded using 'interface view of a component instance' in the Parent Window and am able to create the component and set usage though the onPlugDefault of the Child View.
    But I observe that when i make a call from the parent, the flow is like this:
    1. The wdDoInit of the Child Component Controller gets triggered first.
    2. Then the wdDoInit of the Child's <b>VIEW</b> gets triggered
    3. and <b>THEN</b> the onPlugDefault of the Child Component Interface View
    What I had actually wanted was to Fire onPlugDefault where Im calling a method LoadData(), after which the Child DC's view must be triggered so it can display the fetched data.
    What is actually happening is the view gets displayed, but no data is displayed in the view.
    Right now I have just given a work around where Im triggering <b>LoadData()</b> of the <b>COmponent COntroller</b> from the <b>wdDoInit</b> of the <b>VIEW</b>.
    Is there a better way to do this? I find it strange that I have to load the Data from the view.
    Thanks
    Jack

  • Dynamic Form

    Hey,
    I want to create a dynamic form, but how can I get the value of a dynamic form component? Here is a code snippet. I want to get the value of the inputHidden-component in the newausgabe Bean, but how?
    If I print out the parameter map I get the value but I don't know which key I have to use, because the form ist dynamic.
    InitialContext ctx = new InitialContext();
    abfragen = (Abfragen)ctx.lookup(Abfragen.class.getName());
    Map requestMap = context.getExternalContext().getRequestParameterMap();
    System.out.println(requestMap);
    // {_id5:7:testform:_id7=8, _id5:7:testform:rechnungId=8, _id5:7:testform=_id5:7:testform}
    <h:dataTable var="list" value="#{newausgabe.alleRechnungen}" styleClass="table">
         <h:column>
              <h:form id="testform">
                   <h:inputHidden value="#{list.rechnungId}" id="rechnungId"/>
                   <h:commandButton action="posten" value="#{list.rechnungId}"/>
              </h:form>
         </h:column>
    </h:dataTable>

    That will take you a little while to accomplish.
    <p>I am still improving my version:<br>
        QA: Quick Access An Oracle Forms utility form
    <br>The web pages are somewhat dated, but the latest fmx was created just a few months ago.
    <p>Here is a description of how QA was written:
    <p>QA has 100 data and title columns predefined in two blocks. When you select a table to display, I just display the required fields and position them as needed for the data columns in your table. I use the data from Oracle's ALL_TAB_COLUMNS table to get required information about your selected table. QA uses Oracle's DBMS_SQL dynamic sql package to interact with data in tables, and I had to write special pl/sql code in each of the transactional triggers (on-select, on-fetch, on-insert, etc.) to handle the IO. Because of some problems between Forms and DBMS_SQL, QA (in some situations) creates a package QA_SQL (using the Forms_DDL command), and then calls the procedures in the package to interact with DBMS_SQL. Recently, I have converted QA to use the Forms Exec_SQL package instead of DBMS_SQL.
    <P>I am currently working on handling tables with fat columns -- it has a limit of accessing rows with only less than 4000 bytes. Fat rows will take longer to access, and will take a different approach.
    <p>I have spent many hundreds of hours working on QA -- and I learned much of what I know about Forms developing it.
    Edited by: Steve Cosner on Nov 14, 2008 9:31 PM -- website change

  • Bizarre CFIF issue with dynamic form variables? Very strange...

    I can't figure out what I'm doing wrong here.  Here's my code.  Issue explained below.
                <cfquery name="reviewconfigloader" datasource="MOLMS">
                SELECT *
                FROM dbo.BaseModel
                WHERE dbo.BaseModel.AccountID = #molmsAccountID# AND.dbo.BaseModel.basemodelActive = 1
                </cfquery>
          <table width="100%" border="0" cellspacing="0" cellpadding="3">
            <cfloop query="reviewconfigloader"><cfif isdefined("form.baseconfig#reviewconfigloader.basemodelID#") AND ("form.baseconfig#reviewconfigloader.basemodelID#") NEQ "" AND ("form.baseconfig#reviewconfigloader.basemodelID#") NEQ 0><cfoutput><tr>
              <td width="40%" bgcolor="##F7F7F7" class="basemodelsub">     #form['baseconfig#reviewconfigloader.basemodelID#']#  #reviewconfigloader.basemodelName# #reviewconfigloader.basemodelSubName#</td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">x 14 </div></td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">$486/yr</div></td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">$1444/yr</div></td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">$1444/3 yr</div></td>
            </tr></cfoutput></cfif></cfloop>
          </table>
    What I'm doing here is fairly basic.I'm running a query with a number of configs in it...and then creating a loop to output them.  Ultimately, I only want the configurations that didnt have 0 submitted in the form on the previous page.  Each one of the configs in the config query has a dynamic form variable on the previous page with a quantity tied to it.  I am trying to eliminate all quantities past that aren't 0 (or not eliminate, just not show)...as you can see from the cfif statement.
    Here's where it gets weird.  You'll notice I output #form['baseconfig#reviewconfigloader.basemodelID#']#, just for testing, which shows me the quantity as it should.  I ran a test and put in a couple of 1s, 0s, 12s, 6s, etc in the form fields on the previous page.  If this thing worked, it wouldnt show anything for any of the records with their basemodelID value being submitted as 0.  Not the case.  It shows all records.  What is more hilarious is that it outputs perfectly in my test #form['baseconfig#reviewconfigloader.basemodelID#']#, showing the correct numbers entered in the previous form, the 1s, the 0s, etc, tied to each record.  But for whatever reason, the cfif code isn't catching it.
    What's even more bizarre...I replaced the cfif ("form.baseconfig#reviewconfigloader.basemodelID#") NEQ 0 with GT 12 (12 was the highest number that I put in the form) and it still showed all records.  Then I put it in as LT 12 and it showed nothing.  I decided  to take it one step further and put it in for GT 1231243242343 (random massive number), which it still showed all of the records.  So somehow, my CFIF statement thinks that  ("form.baseconfig#reviewconfigloader.basemodelID#") is a incredibly large number, although when I output it in the row below, it is the number it should be.
    I'm stumped.  Any ideas?  Thanks in advance!!

    Hey Dan...thanks....unfortunately...with the cfif testing, thats kinda what I'm
    doing because I dont have an "expected" value.  My expected value is anything a user inputs thats greater than zero, hence NEQ 0 and NEQ "". The real problem is taht what I'm outputting works and what the cfif clause is seeing is obviously very different.
    As far as your comment about looping out the variables and then setting a query equal to the value in a cfquery, remember...these are form objects and therefore nothing can be tied back to the database.  The result from the code is establishing a form variable (example.... form.basemodel1 (if 1 was the basemodelID from the database query) so it can capture whatever data the user has passed from the previous page in a text input.  So that input could have been 23, it could have been 1053.
    So really the only way to do it is create a query and loop out the variables.... and attach them to form objects (basemodel1, basemodel2, basemodel3 etc where the 1,2 and 3 are the unique ID's for those models in the database), and then look for where those form objects may have been filled in in the previous page by stating IF this form object not equal to 0 or "", output the data.
    Does that make sense?  Thanks for the help guys I'm completely stumped by this.  I've done this a million times with CFIF and I'm really struggling with why this isnt working....
    JE    

  • How to fire an event dynamically in JSF Page

    Hi All
    How to fire an event dynamically in JSF Page?
    Thanks
    Sudhakar

    Hi,
    Thanks for the response. I mean to say, if I create the components dynamically then how can I fire events for those components.
    In otherwords,
    If I create the Button dynamically with particular ID being set to that component, then how can I call button action event when the button is clicked??
    Hope you understand
    What is the role of MethodBinding mechanism here??
    Thanks
    Sudhakar Chavali

  • Issue tabbing across page breaks in dynamic form

    Hi all,
    I have a strange problem that I'm having trouble getting to the bottom of, relating to my dynamic form.
    This form grows and shrinks depending on how the user fills it out.  I have a questionnaire section where certain questions are hidden or shown depending on previous input.
    Things get interesting when I look at the tab order.  Sometimes when tabbing forward or backward across page breaks, the focus lands on a spot that I cannot identify.  There will be no cursor and I can not type.  However if I continue to tab in the same direction, I can see that it is still going in the correct sequence.  It just looks like for some reason, in those places, focus is put in the wrong component.  But if I type different input into the prior fields (ones that affect the length of the pages) that causes the field to move to different place where it's not adjacent to a page break, and then tabbing to the field in either direction works fine.  It seems that only when it's beside a page break, it becomes problematic.
    Also, it only seems to be a problem if the field gets moved to be adjacent to a page break AFTER the form is initially rendered.  If the field was originally beside a page break by default, then it seems to work fine.
    Just to rule out a possible problem with the tab order configuration, I set my from to Automatic tabs, and even went as far as removing all the <traversal> elements from the form.
    After doing either of those things, the problem still persists.
    Has anyone seen this before?

    Hi Eric,
    I have seen funny behaviour when tabbing within Preview in LC Designer. It may be picking up a read-only item in the Master Page.
    Good luck,
    Niall

  • 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.

  • Page Number Disappesrs when click on Reset button in Dynamic Form

    Dear all,
    In dynamic forms I have taken Page n of m field outside the content area in master pages.I have added the reset button in body pages of the form.In the pdf When I click on Reset button the page nos are disappearing along with the other data.
    I want the page no should not disappear.How can I get rid of this problem. If any body can please help me.
    Thanks a bunch in advance
    Regards
    Rakesh

    Firefox checks on the server if the file has been modified if you use the back button.<br />
    If the page was requested by sending post data to the server then Firefox sends that post data and asks for confirmation.<br />
    You can try to use the tab history of the Back button skip sites that require sending post data.
    You can also try if it works if you set to never check the server by setting the browser.cache.check_doc_frequency pref to 2.
    *http://kb.mozillazine.org/browser.cache.check_doc_frequency

  • Embedding a declarative component written in JSF 1.2 in a jsf page

    Hi ,
    I have a declarative component written in JSF 1.2 . I want to embed this declarative component in an ADF application which is using JSF 2.0.
    On creating a jspx page in JSF 2.0 & embedding decalrative component it just works fine but I have to embed it in a JSF page instead , which is not working.
    Any suggestions ?
    Thanks
    Vinit

    Hi,
    for JDeveloper 11g R2 you will need to know before whether the application you build uses JSPX page documents or Facelets. The technologies are different (introduced with JSF 2) and declarative components thus need to be build for the document type used by teh application
    Frank

Maybe you are looking for

  • I'm looking for a High Definition Ken Burns effect

    I put together an hour-long DVD every year of the best photos of my daughter. Every year I've used a program called *Still Life* to add the ubiquitous Ken Burns effect to about 25% of the stills. I've been very happy with the results. But, lo and beh

  • Error Message during settlement of Maintenance Order

    Hi, I was carrying out the month end settlement of Maintenance Order to Equipment specific Internal Order. I am getting the follow error message for two order. 'balancing field profit center in line item 001 not filled message no. glt2201' Can anyone

  • Data type more than 1000 length

    Hi All,      Iam creating a Function module.Using this funtion module i have to insert records into a custom table. in my table i want a field with length 1000.so i created that field using datatype as STRING.But when iam trying to insert the records

  • Clearing of foreign vendors

    Dear all, We have certain foreign vendors for which transaction  is already completed.Balance is laying zero in their accounts.Now when we are clearing those  open items the system takes  the exchange rate of  current date. In which we are not able t

  • Problem with hierarchy

    Hi, I am running a query which time dependent hierarchies in it. The two hierarchies have two different time ranges. But when I ran a query which set a key date and choosed one of two hierarchies. The error happened. Error message "abort Hierarchy ha