ADF Struts JSP SelectList

JDeveloper 10g JSP, Struts and ADF application.
I am developing a search form that has a number of criteria fields one of which is a selectlist.
The code that is generated when I drop the data control as a single select list onto the jsp page is as follows:
<html:select property="SearchCodeType">
<html:optionsCollection label="prompt" value="index" property="SearchCodeType.displayData"/>
</html:select>
The list is populated and I can select a value, however the value I need is the value of the prompt not the value of index (the prompt is a string) to be assigned to the parameter SearchCodeType when I submit so I can use this when adjusting the where clause of my view object to return the correct results.
I am looking for a Struts/ADF/JSP solution.

Have you guys find a way to save(commit) the multi-selection that is created as a part of the list. Steve Muenek put me in the right directions but if you guys have find a way or code please let me know since the time is running short and I would hate to move to another tool to get this functionality.
I have the implementation methods using BC4J/View Object and do understand I'll need to override the create() method but just don't know how to read the records using the iterator or from the array of strings that is saved after the user has created multiple selections.
We are using ADF Struts at least for now.
Thanks a lot,
Kamran

Similar Messages

  • Adf-Struts/JSP/BC4J- and setting date fields from jsp

    Hi,
    I'm working with the new ADF Frameworks (JDev 9.0.5.1) and ran into some questions regarding exception handling using BC4J, Struts and JSPs.
    I have a DATE column in database and an entity and VO with a datefield with type oracle.jbo.domain.Date.
    My JSP shows a textfield and the user should enter a valid date. Everything fine, until date is of wrong format or contains illegal characters...
    Problem:
    ADF tries to do a setAttribute on the datefield in VO row which expects a parameter with type oracle.jbo.domain.Date. When the user entered e.g. "NiceWeather" as date, I get an IIlegalArgumentException while converting to the correct Date format. This exception isn't thrown by bc4j as AttrValException and therefore my JSP renders a global error instead of a message directly behind the date field.
    I tried to validate the datefield in my DataForm and in my Action in the validateModelUpdates() method, but with no fitting solution.
    Any ideas how to validate a datefield with adf/struts/jsp/bc4j?
    Thanks for your help!
    Torsten.

    Torsen - In the first instance I'd recommed that you try and handle it declaritively using the Struts Validator Framework . See http://otn.oracle.com/products/jdev/howtos/10g/StrutsValidator/struts_validator_howto.html
    There is a section in there on how to use the validator with ADF databound pages and you can check the format the user enters via generated JavaScript.
    Also check out the matching sample project:
    http://otn.oracle.com/sample_code/products/jdev/10g/ADFandStrutsValidator.zip - this has a data field check on it as well

  • [freelance job] Experienced ADF/Struts/JSP View-Controller developer

    Hi,
    I'm looking for a freelance "10.1.2 JDeveloper":
    - First task: Development of multi-lingual Struts View and Controller for login, logout, contact, free registration(create/modification of account info, new password, ...) pages.
    Period: may, june 2005 and more if first collaboration is succesful.
    Skills on following technologies are required:
    - View: Struts tags , Struts-el tags , JSTL , JSP , Servlets => no javascript, no UIX, no faces
    - Controller: ADF/Struts
    - Model: Oracle ADF-BC 10.1.2 Oracle 10g Database
    We provide the static html pages + css files and the ADF-BC model components.
    We develop/enhance the Model service methods based on your requirements.
    You "translate" the static html pages to Struts/Struts-EL/JSTL/JSP and the necessary ADF-Struts controllers that inter-act with our ADF-BC Model.
    Contact: [email protected]
    Regards
    Fred
    PS Sorry for polluting this technical forum with this kind of request.

    Dear all..
    I have change the block program, but still can't run..
    My EmpAction.java like these
    ==============================================
    package BindTest7.view;
    import BindTest7.model.EmpViewImpl;
    import java.text.DateFormat;
    import java.text.ParseException;
    import
    oracle.adf.controller.struts.actions.DataActionContext;
    import
    oracle.adf.controller.struts.actions.DataForwardAction;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.ViewObject;
    import java.util.Date;
    public class EmpAction extends DataForwardAction
    protected void prepareModel(DataActionContext ctx) throws Exception {
    super.prepareModel(ctx);
    ctx.getBindingContainer().findIteratorBinding("FindEmpView1Iterator")
    .setFindMode(true);
    public void onSearch(DataActionContext ctx) {
    ctx.getBindingContainer().findIteratorBinding("EmpView1Iterator")
    .executeQuery();
    //-public void onFilter(DataActionContext ctx)
    //recovery view
    ApplicationModule
    am=ctx.getBindingContainer().getDataControl().getApplicationModule();
    ViewObject EmpView=am.findViewObject("EmpView");
    //recovery dates
    String
    d1Str=ctx.getHttpServletRequest().getParameter("hiredate");
    String
    d2Str=ctx.getHttpServletRequest().getParameter("endDate");
    java.text.SimpleDateFormat formatter =
    new java.text.SimpleDateFormat("dd/MM/yyyy");
    Date d1=null;
    Date d2=null;
    // parse method could try a ParsingException,
    // it doesn't happpeend when dates are correct
    try
    d1=formatter.parse(d1Str);
    d2=formatter.parse(d2Str);
    catch (Exception e)
    //set where clausole
    EmpView.setWhereClauseParams(null);
    EmpView.setWhereClause("Hiredate>=:1 and Hiredate<=:2");
    EmpView.setWhereClauseParam(0,d1);
    EmpView.setWhereClauseParam(1,d2);
    EmpView.executeQuery();
    ===============================================
    Please help me....
    I just want to make a little modification on Steve Muench's Example
    by placing two input form for hiredate column so that
    the user only put the date
    on the query " between hiredate :1 and :2
    I'm waiting...
    regard
    erie

  • confused ADF/Struts/JSP: Data entry page question

    Scenario: If I have a master page, say department, and a detail for entering new employees for that department (say emp).
    Page1: Browse Page of Departments
    link to [create] new emp in this department
    Page 2:
    Emp Input form
    If I want to display information such as the Department#, name, and location in the second page, what should I do?
    a) drop a read only version of dept here, and do a setCurrentRowWithKey and an Emp creation action prior to going to the page
    b) pass parameters from the calling page, and fire an emp create action prior to getting to the page
    If I go the route of (b), what's the easiest or recommended way of doing it?

    a) Seems like the best approach here

  • Login Box example and source code on adf struts and JSP

    Dear all..
    I want to make application using ADF struts and JSP using oracle 10g Jdeveloper.
    The user should login into the login box and verify everyone who has right to enter the home.jsp.
    Anybody could help me with the source code as well as the step by step explanation...
    I'm looking forward the help...

    http://www.oracle.com/technology/products/jdev/collateral/papers/10g/reviewer/viewlets/reviewer_struts_viewlet_swf.html

  • COMMIT problem in TopLink, Struts, JSP and ADF Databinding sample

    In the sample Developing a J2EE Application using TopLink, Struts, JSP and ADF Databinding,
    I followed all the steps to build a department browse page and a edit page.
    But when I get to Step number 23 in "Create a JSP to Edit Departments" I have a problem with the commit.
    Only after I make a change in the form and click the sumbit button, the commit and rollback buttons become active. And After I click the commit button the data gets commited to the database but the page inofmation changes to the very first department record, not the current one.
    How do I make those buttons active with out the extra click on the submit?
    After I click the commit button, how do I keep the current data on the screen?
    Thanks for you help.

    Shay,
    Thanks for the reply.
    For #1, I was able to do the following and get away with not having to press submit first. I just removed the bindings for disable. I hope that does not cause any problems?
    <input type="submit" name="event_Commit" value="Commit" />
    <input type="submit" name="event_Rollback" value="Rollback" />
    For #2, How I add an action on an HTML button? My UIModel.xml for the edit department page currently has two actions on it. Commit and RollBack. Is it linked through the "name" attribute of the input tag?

  • Help with simple display and add in ADF/Struts app

    I created a simple ADF/Struts application based on the HR schema. I have a department view object and entity object based on the Departments table. From the Struts page flow designer, I create a data page action (viewDepartments) that binded to a departments view object by dragging the departments view object as a "Read-Only" form from the palette with the navigation buttons --- this page will just display the departments. Next, I created another data page action (addDepartments) that allows a user to add a department. I did this by dragging the departments view object from the palette as an "Input Form" and then dragging the "Create" operation onto the data page action. Each data page action has its own JSP of course.
    I'm noticing that every time when I go to to the "addDepartments.do" and then go to "viewDepartments.do", a blank record is added to the view object. Why is this? Also, I want the Submit button to do the "save and commit" in one step. How do I do that?
    If it helps, I can email anybody the workspace file so that you can see this behavior.
    Thanks.

    Try following this step by step tutorial to see if it will make things better for you.
    http://otn.oracle.com/obe/obe9051jdev/adftojsp/defaultendtoend.htm#t3

  • How to use ActionForm validate() method in ADF/Struts project

    Hi
    We are developing a project using ADF/Struts. We are not planning to use entity level validation. Rather we prefer to have it at Struts Form Bean level. So we need to have validate() method in Form Bean.
    That mean we need to have seperate bean for all the actions /jsp. The ADF's DataForm form bean is not gonna work for us. Is that correct.
    Please let me know...am I in the right direction.
    That could be a different discussion why we don't prefer entity level validation

    You can use the Struts validator plug-in (there's a howto on doing that on OTN) and it will handle the basics for you through XML definitions.
    If you want to specifically have a Form bean with a Validate() then the issue is that the current "DataForm" is a generic bean driven of the databinding files, so yes you'd have to write a bean per screen to use instead and loose that benefit of having a universal Bean. (Internally the DataPage and DataActions will respect the ActionForm APIs so you can pluf your own ActionForm subclass in with no problem.
    Plan B might be to leave the DataForm Bean in place and instead override the lifecycle of the datapage, probably in prepareModelUpdates()

  • Passing a url parameter to a method using ADF and JSP

    Hi
    (JDEV10.1.3 : ADF BC, JSP, STRUTS)
    I have a text input on my JSP Page which I need to pass the content as an argument for the dataaction which is implemented in my application Module as a method to set the where clause of a query. I do not know How to set the Method's NDValue. I have tried:
    NDValue='${pageContext.request.parameterMap[ComplexID]}'
    But it always returns null
    hint: ComplexID is my txtBox name on the JSP page.
    I need to pass request.getParameter("ComplexID") but as an NDValue it is not accepted.
    note that ComplexID is not a databind object, It has been created by myself as an HTML element.

    What result do you get when you enter the following into your browser:
    http://mylocalhost_IP/path/to/component/questions.cfc?method=getQuestionsXML&quizid=2 ?
    (Replace http://mylocalhost_IP/path/to/component/ with the correct path to your component)
    Are the results valid/well-formed XML?  Is there any extraneous text that might interferre with the XML processing?  I noticed your xPath was looking for an element called "question s" - Is that the correct name of the element in your XML?  Is there really a space in the name?
    See if you can troubleshoot the issue using your browser first before adding it back into the Spry call.
    Hope that helps!
    - Michael

  • ADF/Struts Generated tag code variations? Struts html:text vs Html input

    Hi,
    JDev 10.1.2.1
    ADF/Struts
    I noticed that the JDev IDE generates different code for a same component/binding combination.
    Example:Data Control of type Input form with same VO selection.
    Generated code for 1 field:
    case 1)
    JSP code:
    <tr>
    <td>
    <c:out value="${bindings['TitleLang1'].label}"/>
    </td>
    <td>
    <html:text property="TitleLang1"/>
    </td>
    </tr>
    HTML output:
    <tr>
    <td>
    Short Title Language 1
    </td>
    <td>
    <input type="text" name="TitleLang1" value="Preliminary Demo">
    </td>
    </tr>
    case 2)
    JSP code:
    <tr>
    <td>
    <c:out value="${bindings['TitleLang1'].label}"/>
    </td>
    <td>
    <input type="text" name="<c:out value='${bindings.TitleLang1.path}'/>" value="<c:out value='${bindings.TitleLang1}'/>"/>
    </td>
    </tr>
    HTML output:
    <tr>
    <td>
    Short Title Language 1
    </td>
    <td>
    <input type="text" name="VB_TitleLang1" value="Preliminary Demo"/>
    </td>
    </tr>
    Case 1 generated code is obvious to me, the html name of the field equals the field binding id.
    In Case 2, the VB_ prefix is added and the binding variable references bindings.fieldName.path?
    Could someone explain me the second flavor?
    When should we use the path reference and replace the Struts html:text tag with html input tag?
    Thanks
    Fred

    I dont think you can mix static values and rt expressions together in attribute values.
    String onBlurString = "dontLeaveItEmpty(this);referenceEntered(" + recordNumber + ")" ;
    html:text styleClass="textFieldInTable" name="refrences" property="referenceName" onblur="<%=onBlurString%>" />cheers,
    ram.

  • How to retrieve values from the struts DAO to Struts JSP

    Hi friends,
    I have one question. i want to display values in the struts jsp file from the struts DAO class. can anyone tell how do it.
    Appreciated for your help.
    Thanks
    G1 :)

    Hi Santosh,
    Thanks for your prompt reply.
    Actually, my problem is i want to display complete rows from the DAO to JSP page. I'm displaying all the rows in the DAO from DB.
    But i dont know how to retrieve all these data from DAO. Can i take arraylist.??
    DAO:
    ------------     public Customers getData(Customers customers){ // Reading data from DB
         //ArrayList list = null ;
         try
              Connection conn = getSQLConnection();
              Statement statement = conn.createStatement();
              String qry = "select * from register";
              ResultSet resultSet = null;
              PreparedStatement pstat = conn.prepareStatement(qry);
              // pstat.setString(1, customers.getFname());
              resultSet = pstat.executeQuery();
    //Print the data to the console
    while(resultSet.next()){
              String fnam = resultSet.getString(1);
              String lnam = resultSet.getString(2);
              String gen = resultSet.getString(3);
              String addres = resultSet.getString(4);
              String cit = resultSet.getString(5);
              String zip = resultSet.getString(6);
              String county = resultSet.getString(7);
              String emal = resultSet.getString(8);
              System.out.println("First name:"+fnam);
              System.out.println("Last name:"+lnam);
              System.out.println("Address:"+addres);
              customers.setFname(fnam);
              customers.setLname(lnam);
              customers.setGender(gen);
              customers.setAddress(addres);
              customers.setCity(cit);
              customers.setZipcode(zip);
              customers.setCountry(county);
              customers.setEmail(emal);
                   statement.close();
                   conn.close();
              }catch(Exception e1){
                   e1.printStackTrace();
              return customers;
    Bean:
    I have specified in this line in Bean:
    request.getSession().setAttribute("customers", customers);
    But in JSP. how will i populate all these data. Pls..send some code.
    I'm sorry this is just practicals. i'm not doin any real time project. that;s why i have placed all these code.
    Thanks for your patience for resolving my problems.
    Thanks
    G1

  • Error comes  while adding a ADF BC/JSP portlet

    Hello all,
    I built a portlet using ADF BC & JSP,the Provider's Test Page showed successfully.
    1)I created an empty project;
    2)I created an Business Component from Tables;
    3)I created a portlet using Oracle PDK portlet wizard--in the same project which the Business Component from Tables exist.
    4)I create error.jsp and made the code <%=exception.toString()%>,and add the <%@ page errorPage="error.jsp"%> in the portlet's showPage;
    5)I drag and drop the tableView form DataControl Panel;
    6)I make deployment profiles--war file,and deploy the portlet to a standalone OC4J;
    7)Registed to Oracle Portal;
    8)In the Portal,when I added the portlet to a new page,the portlet showed nothing but the following message:
    java.lang.NoClassDefFoundError: oracle/jbo/mom/PropertyNameValueDef
    what's wrong? Could anybody give me a help?
    Thanks~

    Hello,
    Have you deployed the ADF Runtime in the OC4J instance you are using ?
    See Jdeveloper Menu: Tools/ ADF Runtime Installer.
    Regards
    Tugdual Grall

  • How to use VPD in Java/Struts JSP portlet with SSO

    DB = 10.1.0 (Standard Edition)
    Portal = 9.0.4.1
    10gAS = 9.4.0.1 (EE)
    I am in the beginning stages of developing some portlets that will be Java/Struts JSP based. We use SSO and have implemented some VPD security in our DB by creating some views that use SYS_CONTEXT('USERENV','CURRENT_USERID').
    These Java portlets connect to the DB using a defined JDBC connection for the OC4J container they are deployed in. The problem I'm having is that the call to SYS_CONTEXT is returning the user of the JDBC connection and not the SSO user. So far I have been unable to find any documentation that will point me in the right direction to get this configured properly.
    Deployment and configuration are as follows. Deploy war file to custom container on app server. In the configuration of the OC4J contain the app used the containers default JDBC connection using the oracle.jdbc.pool.OracleDataSource class. Max and Min open connections are blank.
    In the portal configuration under Navigator - Providers tab we defined a new Registered Provider. In the Connections tab for the provider we Specify the URL Http://hpsrv02.simsol.com:7777/discovery-portlets/providers. Under "Specify how the user's identity will be set by the Portal..." the "The user has the same identity in the Web providers application as in the Single Sign-On identity" is selected. Under "User/Session Information" User is selected and Login Frequency is set to "Once per user session". Then we created a new portal page and created a new portlet with the new provider.
    Just an FYI I do have Discoverer working with VPD and any report portlet, dynamic page portlet and any other type of portlet I created all work correctly with VPD it is just the java/struts one that is not working.
    So does any one have any insight into what configuration steps I have missed?
    Any help is much appreciated,
    Ed Klinger

    Ed,
    Your java code must get the SSO username (it's just a HTTP header variable) :
    ie: code sample...
    Enumeration e = request.getHeaderNames();
    while (e.hasMoreElements()) {
    String name = (String)e.nextElement();
    String value = request.getHeader(name);
    out.println("<br> "+name + " = " + value);
    if (name.toUpperCase().trim().equals("OSSO-USER-DN")){
    dn_user=value;
    out.println("<br>******** USER DN = "+dn_user);
    Then, the SSO username can be used in the VPD policy.
    Note that there is a difference between the sso username and the database username . SSO username is not known by database (CURRENT_USERID will return a database username)
    Discoverer worked OK in your case with the SYS_CONTEXT (.. CURRENT_USERID) because authentication is made by database user, probably.

  • How to use javascript functions in struts jsp page

    hi
    iam using struts jsp pages. here iam calling one javascript function. but iam not able to access the form in javascript.
    wat i have to give as form name to get the elements of the form.
    please reply me soon
    it is urgent
    vamsi

    your form has no name liek this one:
    <html:form action="/userRegistration.do" >so you cannot access the elements inside your form?
    accessing the elements inside the form will be like this:
    document.forms[0].propertyName.value;

  • ADF Struts on Login Box with User on DB

    Dear All,
    I read the respond on my last post about the login box and it was help me a lot.
    Now, my problem are how to make a login box on ADF Struts technology which the username and password verification from user and privilage on oracle database?
    Noone can connect to menu and the privilage from oracle database regulate the data that will be display.
    I hope somebody will help me with the step by step configuration. I'm new in these technology...
    Thanks a lot

    this is probably a question for the JDEV forum.
    Regards
    Grant ROnald
    Forms Product Management

Maybe you are looking for

  • Connecting to an external display using the setting optimised for built in screen?

    i am having trouble connecting to an external display with the lid closed and the settings is optimised for built in display. it was working nicely until yesterday when i changed the resolution. and now i cant take it to optimised for built in displa

  • Graphic Problem in OS X Mavericks?

    well, i upgraded my machbook pro 15' to OS X Mavericks and now have been encountering graphic problems. This is the Do Not Disturb part in my notification center. Any Solution? Regards,

  • Ask the Expert: Different Flavors and Design with vPC on Cisco Nexus 5000 Series Switches

    Welcome to the Cisco® Support Community Ask the Expert conversation.  This is an opportunity to learn and ask questions about Cisco® NX-OS. The biggest limitation to a classic port channel communication is that the port channel operates only between

  • XP parallels some acceptance situations

    I have been using XP in parallels on my macbook pro, some of the software I have to run on it, is brand new chinese control software for LED displays. Some of these products I can run on my XP and some I have to run on a dell, the problem as I see it

  • X6 and headphones problem

    My X6.00/32 (V21.0.0004) does't recognize headphones. When I insert phones into the jack and press "headphones" choice it gives me stupid message "use telephone's microfon", so I can't use radio. I have tried different headphones and played with sett