Dynamic Dialog creation?

Hello,
Can any one tell me how to create Dynamic Dialog, I follow below link but not able to understand properly
http://dev.day.com/docs/en/cq/current/developing/widgets.html#Custom%20Widgets
I want to develope below dialog.
Please tell me the process/steps...
Thanks in advance....

Rahul,
That would entirely depend on how you want your users managed, for example are they ApEx users, are they stored in a database table somewhere, are they stored in an LDAP directory?
As a simple example, if you stored user details in a database table then its as simple as -
1) Create a public page where the user can type in their username and password, this page then writes those details into your table so they can login (obviously your authentication method references the same table).
You can extend this to do the sort of registration you see on most sites, for example -
1) Create a public page to capture the user details, including email address
2) When the user submits the form, you generate a 'validation link' (using whatever method you like) and email that off to the address the user entered
3) User clicks on the link, which runs a procedure to update the status of that user from 'unverified' to 'verified' (for example)
4) User can now login
Without knowing more specifics its hard to advise.

Similar Messages

  • Dynamic Dialog in a Dialog Participant Step for Workflow

    Hello All,
    I am trying to create a Dynamic Dialog in the dialog participant step for a workflow.
    so when a user has the Dialog participant step opened up, if they select from a drop down, it will make another textfield hide/show.
    In a component dialog I can do something like
    var comment = this.find('name', './jrc:content/customComment')[0] to find the field to be shown/hidden.
    however when I run this inside a Dialog Participant step, the result is undefined.
    Any Sugguestion on how to approach this ?
    I am using a listener on the dropdown widget/attribute

    Hello,
    The find() method will not help you because it searches the property based on configured value which you can not pass in your scenario. If you dont have any constraint with your hide/show field then best way it to configured it with a property "id" (String) and give it some unique value which has not been used by any component in this dialog and then use below method to find out the component.
    this.getComponent(id)
    when you pass the "id" value the method will return that component and then you can show/hide it.
    I have used this approach many times which is easy and fast to find out the component in any container.
    Let me know if you face any issue.
    Thanks,
    Pawan

  • 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

  • Dynamic Dialog Praticipant step

    Hello experts,
               The OOTB cq comes with a "dialog participant step" and "dynamic participant step". I am looking for "dynamic dialog participant step". Any ideas of how to implement it ?
    Rama.

    I tried to customize this new component by combining the functionality of Dynamic Participant and Dialog Participant. I was able to customize the dialog (which shows up when I drag and drop the customized dynamic Dialog Participant Step) to refer to a dialog path ( as is OOTB Participant Step) and choose which  script to resolve the dynamic participant step. But at the run time had this issue where it was not assigning to the right group though the script returns correct value. I dont see any errors. But the major issue was I could not see the custom dialog. So took a new approch to resolve this.
    1. Create a new model
    2. Drag and drop the dialog Participant step and DONOT choose the group. Choose title and description, and also choose the custom dialog.
    3. Create a new java process step which would assign the a value to the property called PARTIPANT to the next step (combination of workflow transition objects and routes objects) in the workflow ( which in this case the dialog Participant).
    4. Code the logic in such a way that it returns the correct user group.
    5. Drag and drop a java process step on to the model prioor to the dialog Participant Step and choose the newly created java process.
    6. execute the workflow.
    7. Once the java process executes it would assign to the right group for the dialog Participant (  which we did not choose while we modelled it - Step 2)
    Hope this helps.
    Rama.

  • Does Seeburger's SFTP adapter support dynamic filename creation

    Hi all,
    Does the SFTP adapter support dynamic filename creation.
    If yes, then do we have to use UDF's and are there any specific settings that have to be done in the SFTP communication channel.
    Please provide a blog which helps in the configuration process of the above case.
    thanks,
    younus

    Dynamic Creation of File using counter in Seeburger Variable:
    1. Configuration Needed in the Communication Channel:
    The process of dynamic creation of files can be done we have to select the following checkbox in the receiver channel:
    Dynamic Attribute in receiver Channel:
    Import the following modules:
    Localejbs/Seeburger/solution/sftp
    Localejbs/Seeburger/AttribMapper
    Localejbs/ModuleProcessorExitBean
    Enter  the desired file naming convention:
    Use the Parameter GetCounter("ID") to the place where the counter is expected to come.
    2. Configuration Needed in the SeeBurger Workbench:
    If the J2EE server is listening on a port different from 50000 (which is the standard for the SAP client 000), the port number must be configured:
    Login into the seeburger workbench using the URL
    http://<localhost>:<port number>/seeburger/index.html
    Select Property Store.
    Create or edit the following property:
    Parameter
    Value
    Namespace
    http://seeburger.com/xi/SeeFunctions
    Key
    provider.servlet.server
    Value
    http://localhost:50000/ (where the port number 50000 must be set
    accordingly to the J2EE server configuration).
    Note: The configured value (server URL) has to end with a slash (/). Otherwise,
    SeeFunctions will not work correctly.
    If we need to start the counter from any specific value , it can be configured in the SeeBurger workbench, this value can be maintained in Mapping Variables :

  • Does UCM support dynamic page creation on contributor mode.?

    Hi All,
    Does UCM support dynamic page creation on contributor mode.
    We want to create new pages and link it into the existing pages
    is that possible?
    Thanks
    ~Hari

    You can create new secondary pages in contributor mode - you would normally do this via a dynamic list fragment though technically you could also achieve it by switching region content and creating new data files. You can then use the linz wizard to link between pages.
    If you are talking about creating new primary pages and sections in your site then you would need to use something like Site Studio Manager fragment.
    Tim

  • Building a dynamic dialog in Acrobat with Javascript

    I am attempting to figure out how to build dynamic dialogs within Acrobat using Javascript.
    I am attempting to write a generalized PDF page splitter.  The user selects a PDF document, and then the script analyzes the open document and determines that there are N pages in the document.  I am going to run through the document and make each page its own PDF.  Each page will be considered a certain kind of page, for example, Cover, Article, Ad, etc.  and the type of page it is will affect the naming convention I use when making the new, one-page file.  For example, let's say that pages 36, 37 and 38 are page, ad and article, respectively.  Then the names I will be using for each output file will be as follows:
    P12345Pg_036.pdf
    P12345Ad_037.pdf
    P12345Ar_038.pdf
    But there is no way for my code to actually look at a given page and decide that it is page, article, ad, or one of four cover types, etc.  So I want to build a dialog that looks something like this (assume a O is meant to be a radio button):
    Page          Pagetype
    1                  O Page      O Inner cover Front         O  Outer cover Front     O Ad           O   Article
    2             
    O Page 
    O Inner cover Front    
    O  Outer cover Front
    O Ad      
    O   Article
    3             
    O Page 
    O Inner cover Front    
    O  Outer cover Front
    O Ad      
    O   Article
    4             
    O Page 
    O Inner cover Front    
    O  Outer cover Front
    O Ad      
    O   Article
    N             
    O Page 
    O Inner cover Front    
    O  Outer cover Front
    O Ad      
    O   Article
    Beacuse each document varies in length, that means the dialog will need to be dynamic.
    I have looked at the Acrobat API and determined that defining a dialog looks something like this:
    var DialogABC = {
                                       initialize: function(dialog){},
                                       commit : function(dialog){},
                                       description:{}
    app.execDialog(DialogABC)
    What I do not know how to do is create the dialog specification on the fly.  Do I treat it as a string or is there some other way of making this happen?  How can I make a dynamic description that allows for a variable number of rows?
    Please let me know if you have any thoughts.  A good reference or example would serve just as well.
    TIA!
    John

    There are two approaches to this:
    1. Treating the dialog object as a literal object
    2. Treating it as a string
    If you treat it as a literal object you can manipulate it like any other object. Each function can be defined separately, and the items in the various arrays can be added or removed as you please.
    If you treat it as a string then you can construce that string in a dynamic way, using loops or if-conditions, as you please, and then use the eval() command to convert it to an object when done.
    Both approaches are quite complex and require a lot of scripting experience to implement correctly.

  • RE: dynamic widget creation

    This is a good tech note about this on the Forte website.
    -----Original Message-----
    From: Matthew Middleton [SMTP:[email protected]]
    Sent: Friday, 25 June 1999 11:11
    To: [email protected]
    Subject: dynamic widget creation
    I have done a few windows with dynamic widget creation. Sometimes it
    seems I have to have done self.Open before, to get things to appear
    properly, and sometimes not.
    What I would like is a summation of the issues involved here so I can
    write such code without resorting to trial and error.
    with advance appreciation,
    Matthew
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Tech Note 5156, which I have attached for your information.
    -----Original Message-----
    From: Foster, Todd [SMTP:[email protected]]
    Sent: Saturday, 26 June 1999 1:27
    To: 'Jason de Cean'
    Subject: RE: dynamic widget creation
    ? What technote ?
    -----Original Message-----
    From: Jason de Cean [SMTP:[email protected]]
    Sent: Thursday, June 24, 1999 9:19 PM
    To: 'Matthew Middleton'
    Cc: 'Forte Users'
    Subject: RE: dynamic widget creation
    This is a good tech note about this on the Forte website.
    -----Original Message-----
    From: Matthew Middleton [SMTP:[email protected]]
    Sent: Friday, 25 June 1999 11:11
    To: [email protected]
    Subject: dynamic widget creation
    I have done a few windows with dynamic widget creation. Sometimes
    it
    seems I have to have done self.Open before, to get things toappear
    properly, and sometimes not.
    What I would like is a summation of the issues involved here so Ican
    write such code without resorting to trial and error.
    with advance appreciation,
    Matthew
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive<URL:http://pinehurst.sageit.com/listarchive/>

  • Building dynamic dialogs for Acrobat.

    I am attempting to figure out how to build dynamic dialogs within Acrobat using Javascript.
    I am attempting to write a generalized PDF page splitter.  The user selects a PDF document, and then the script analyzes the open document and determines that there are N pages in the document.  I am going to run through the document and make each page its own PDF.  Each page will be considered a certain kind of page, for example, Cover, Article, Ad, etc.  and the type of page it is will affect the naming convention I use when making the new, one-page file.  For example, let's say that pages 36, 37 and 38 are page, ad and article, respectively.  Then the names I will be using for each output file will be as follows:
    P12345Pg_036.pdf
    P12345Ad_037.pdf
    P12345Ar_038.pdf
    But there is no way for my code to actually look at a given page and decide that it is page, article, ad, or one of four cover types, etc.  So I want to build a dialog that looks something like this (assume a O is meant to be a radio button):
    Page          Pagetype
    1                  O Page      O Inner cover Front         O  Outer cover Front     O Ad           O   Article
    2             
    O Page 
    O Inner cover Front    
    O  Outer cover Front
    O Ad      
    O   Article
    3             
    O Page 
    O Inner cover Front    
    O  Outer cover Front
    O Ad      
    O   Article
    4             
    O Page 
    O Inner cover Front    
    O  Outer cover Front
    O Ad      
    O   Article
    N             
    O Page 
    O Inner cover Front    
    O  Outer cover Front
    O Ad      
    O   Article
    This means a dynamic dialog.
    I have looked at the Acrobat API and determined that defining a dialog looks something like this:
    var DialogABC = {
                                       initialize: function(dialog){},
                                       commit : function(dialog){},
                                       description:{}
    app.execDialog(DialogABC)
    What I do not know how to do is create the dialog specification on the fly.  Do I treat it as a string or is there some other way of making this happen?  HOw can I make a dynamic description that allows for a variable number of rows?
    Please let me know if you have any thoughts.  A good reference or example would serve just as well.
    TIA!
    John

    Use this code to get all components of internal table.
    Then build fieldcatlog.
    DATA: tab_return type abap_compdescr_tab,
              components like line of tab_return.
    perform get_int_table_fields using    <fs_it> changing  tab_return.
    loop at tab_return into components.
      wa_fldcat-fieldname  = components-name.               "Field Name
      wa_fldcat-scrtext_m  = components-name.              "Column Heading
      wa_fldcat-inttype    = components-type_kind.     "Data Type
      wa_fldcat-intlen      = components-length.          "Data Lenght
      wa_fldcat-decimals = components-decimals.     "Data Decimal Places
    append wa_fldcat to it_fldcat.
    endloop.
    form get_int_table_fields  using    t_data type any table
                                changing t_return type abap_compdescr_tab.
       data:
       oref_table type ref to cl_abap_tabledescr,
       oref_struc type ref to cl_abap_structdescr,
       oref_error type ref to cx_root,
       text type string.
    *Get the description of data object type
       try.
           oref_table ?=
           cl_abap_tabledescr=>describe_by_data( t_data ).
         catch cx_root into oref_error.
           text = oref_error->get_text( ).
           write: / text.
           exit.
       endtry.
    *Get the line type
       try.
           oref_struc ?= oref_table->get_table_line_type( ).
         catch cx_root into oref_error.
           text = oref_error->get_text( ).
           write: / text.
           exit.
       endtry.
       append lines of oref_struc->components to t_return.
    endform.
    Regards
    Sreekanth

  • Dynamic Event Creation and Handling the events

    Hi All
    I am using WAS 6.4.
    I have two components say Component A and Component B in which Component A is a reusable component and is used by other components say for e.g the Component B.
    The following is the requirement.
    Component A should create buttons for other components dynamically.
    As an example, Component B specifies to Component A the buttons required say button B1 and button B2.
    Component B also contains methods M1 and M2 for the buttons created by the component A.
    Now I would like to associate these buttons created by component A with the methods created in Component B
    The number of buttons that are to be created may vary from component to component.
    If any one as any suggestion or solution, help me out.
    Thanks
    Regards
    NagaKishore

    Hi NagaKishore,
         I'm not exactly sure why you want to do this, but it is pretty easy if I switch it up a bit.  (Maybe you are trying to create a navigation page or something?) 
         Instead of your component B using component A, if you define a Web Dynpro interface in component A, then implement this interface in component B (or all component Bs), achieving your goal would not be too difficult.  It could define a generic method (or event) with a "button key" as an argument that would tell component B which button was pressed and allow it to behave as desired.  The Web Dynpro interface defined in A could also have an interface context that would allow the the button text to be passed along with (for the sake of simplicity) a "button key" that component that should be triggered when the button is pressed.  (Note this could be a varying size list as required.)
         The component B(s) need not be known until run-time.  They can be created using something like:
    wdThis.wdGet<Used Compontne Name>ComponentUsage().createComponent(<Component Name>,<Object Name (if in a different component)>)
         Once the component is created, the context can be accessed giving the list of buttons to create and the values.  The buttons can be created in the wdModifyView during the first pass of the creation of the view displaying the buttons (after the dynamic creation of the used components which can occur in the wdDoInit of the component controller).
         If the user presses a chosen button on component A, then the generic method (most likely an event) of component Bs interface is called and passed the "button key", component B then takes over.  Note this would also work if component B had a visualization component that must be displayed through an interface view that is defined on the web dynpro component interface that is implemented by B.
         Hope this helps or at least triggers discussion that will answer your question,
           --Greg

  • AFAB dynamic variant creation for Posting period.

    HI,
    Business Requirement :
    Business want to run AFAB transaction code every month automatically with schedule job.
    system should pick present month period in posting period field.
    i checked in variant creation  against posting period there is no dynamic " D " in selection variable column.
    how can i fix this.

    Hi Jani,
    Check with abaper if TVARV table can Help you in this case, or create a z program from AFAB. And add date field to it, and schedule job based on that,
    I think TVARV table will be a better approach.
    Another point to consider here would be that dep should be run once business is ready to do so, and has its own hick ups in business if corrections are required to be made after executing AFAB by job
    Regards
    Pankaj B.

  • Dynamic Datasource creation

    I am trying to create datasources dynamically. Using an example from a previous
    post,
    mbeanHome = lookupMBeanHome();
    JDBCDataSourceMBean dsMBean = (JDBCDataSourceMBean)mbeanHome.createAdminMBean(poolName,"JDBCDataSource",
    mbeanHome.getDomainName());
    dsMBean.setJNDIName(poolName);
    dsMBean.setPoolName(poolName);
    dsMBean.addTarget(tserverMBean);
    dsMBean.setPersistenceEnabled(false);
    How can I retrieve the proper TargetMBean reference to send to the addTarget method.
    Does anyone know where I can find an entire class example of dynamically creating
    datasources, or something similar.
    Thanks in advance,
    Fahd

    Hi Fahd,
    Here is a sample I posted here some time ago
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.util.Iterator;
    import java.util.Set;
    import javax.naming.Context;
    import javax.sql.DataSource;
    import weblogic.jndi.Environment;
    import weblogic.management.configuration.JDBCDataSourceMBean;
    import weblogic.management.configuration.ServerMBean;
    import weblogic.management.MBeanHome;
    * This class demonstrates dymamic creation,
    * using and deletion of DataSource via
    * Weblogic management API.
    public class DynamicDataSource {
    private Context ctx = null;
    private JDBCDataSourceMBean dsMBean = null;
    private MBeanHome mbeanHome = null;
    private ServerMBean serverMBean = null;
    // DataSource attributes
    private String cpName = "yourPoolName";
    private String dsJNDIName = "dynamic-data-source";
    private String dsName = "dynamic-data-source";
    // Security credentials
    private String password = "admPasword";
    private String serverName = "yourServer";
    private String url = "t3://localhost:7701";
    private String userName = "system";
    * Creates and starts up a DataSource using
    * management API.
    public void createDataSource() throws SQLException {
    System.out.println("Creating DataSource...");
    try {
    // Get context
    Environment env = new Environment();
    env.setProviderUrl(url);
    env.setSecurityPrincipal(userName);
    env.setSecurityCredentials(password);
    ctx = env.getInitialContext();
    // Lookup for MBean home
    mbeanHome = (MBeanHome)ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
    serverMBean = (ServerMBean)mbeanHome.getAdminMBean(serverName,
    "Server");
    // Delete if DataSource MBean already exists in active domain
    Set dsMBeanSet = mbeanHome.getMBeansByType("JDBCDataSource",
    mbeanHome.getDomainName());
    Iterator iter = dsMBeanSet.iterator();
    while(iter.hasNext()) {
    JDBCDataSourceMBean dsmb = (JDBCDataSourceMBean) iter.next();
    if (dsmb.getJNDIName().equals(dsJNDIName)) {
    dsMBean = dsmb;
    deleteDataSource();
    break;
    // Create DataSource MBean
    dsMBean = (JDBCDataSourceMBean)mbeanHome.createAdminMBean(
    dsName, "JDBCDataSource",
    mbeanHome.getDomainName());
    // Set DataSource attributes
    dsMBean.setJNDIName(dsJNDIName);
    dsMBean.setPoolName(cpName);
    // Startup datasource
    dsMBean.addTarget(serverMBean);
    } catch (Exception ex) {
    throw new SQLException(ex.toString());
    * Symply gets and closes a connection from dynamic
    * DataSource. Will throw a SQLException if datasource
    * does not exists.
    public void createConnection() throws SQLException {
    System.out.println("Getting Connection...");
    try {
    DataSource ds = (DataSource)ctx.lookup (dsName);
    Connection conn = ds.getConnection();
    conn.close();
    } catch (Exception ex) {
    throw new SQLException(ex.toString());
    * Shuts down and deletes DataSource from configuratrion
    * using management API.
    public void deleteDataSource() throws SQLException {
    System.out.println("Deleting DataSource...");
    try {
    // Remove dynamically created datasource from the server
    dsMBean.removeTarget(serverMBean);
    // Remove dynamically created datasource from the configuration
    mbeanHome.deleteMBean(dsMBean);
    } catch (Exception ex) {
    throw new SQLException(ex.toString());
    public static void main(String args[]) {
    DynamicDataSource dds = new DynamicDataSource();
    try {
    dds.createDataSource();
    dds.createConnection();
    dds.deleteDataSource();
    } catch (SQLException ex) {
    ex.printStackTrace();
    "Fahd" <[email protected]> wrote in message
    news:[email protected]...
    >
    I am trying to create datasources dynamically. Using an example from aprevious
    post,
    mbeanHome = lookupMBeanHome();
    JDBCDataSourceMBean dsMBean =(JDBCDataSourceMBean)mbeanHome.createAdminMBean(poolName,"JDBCDataSource",
    mbeanHome.getDomainName());
    dsMBean.setJNDIName(poolName);
    dsMBean.setPoolName(poolName);
    dsMBean.addTarget(tserverMBean);
    dsMBean.setPersistenceEnabled(false);
    How can I retrieve the proper TargetMBean reference to send to theaddTarget method.
    >
    >
    Does anyone know where I can find an entire class example of dynamicallycreating
    datasources, or something similar.
    Thanks in advance,
    Fahd

  • MXML Dynamic Object Creation

    Hi ,
    Static Object Creation :
    Eg:
        <mx:Fade id="ViewStack_EffectStart" duration="500" alphaFrom="0.0" alphaTo="1.0"/>
        <mx:Fade id="ViewStack_EffectEnd" duration="500" alphaFrom="1.0" alphaTo="0.0"/>
    <comp:ErrorBox id="errorBox" active="{active}" showEffect="{ViewStack_EffectStart}" hideEffect="{ViewStack_EffectEnd}"/> .
    The above static objects is working fine, but the problem is that we have lot of similiar static object which creates a memory issue.If we create dynamic objects, will it avoid the issue.Is dynamic objects advisible?.
    Thanks in advance.Please reply ASAP.
    Thanks ,
    San.

    hmn.. I don't understand your questions fully.
    What about create the fade object in "Model" and reference the same Fade object for all dynamic objects?
    or r u asking to find out how to create fade in actionscript?
    var fade:Fade = new Fade();
    fade.target = this;
    fade.alphaFrom = 0;
    fade.alphaTo = 1;
    fade.play();
    hope this helps,
    BaBo,

  • Please help with dynamic menu creation needs to have 5 levels

    Hi,
    I have run into a Coldfusion problem that I was hoping you
    could help me with.
    What I am trying to solve is the dynamic creation of at least
    5 levels of categories for a menu built with Coldfusion, and if
    possible an infinite amount of levels.
    Each of these also if it is at the end of the tree will have
    to have products under it aswell the category will only show up if
    there is products under it.
    To acomplish this I have created a database table called
    "Categories" which contains the fields shown in the linked
    spreadsheet. I am using the "cat_parent" to hold the value of the
    parent of the current record. When the parent is a top level menu
    item I have assigned this a cat_parent id of "0". Using this method
    I am able to do a self join on the table (where "cat_parent" =
    "cat_id") to extract the relationship between parent and child
    records throughout the table. This works fine. And I have created
    output for 5 levels of display.
    There are 3 issues left that I could not work out.
    - Firstly my coding method loops through each node of the
    tree with one query to create each category of the menu. This means
    one query per menu category and as the client could have up to 200
    categories in the menu and I am concerned that the solution that I
    have come up with is too processor intensive.
    - Secondly the way that I have created the category menu is
    hard coding in the levels needed so there is only 5 not an infinite
    amount which would be preferable but is not essential.
    - Finally I could not work out how to not create "parents" in
    the tree if there is no products for the end child category.
    Meaning that if there is for example a category > subcategory
    > subsubcategory but there is no products associated with the
    end category - "subsubsubcategory" then it's parent and so on will
    not display until one of them has products.
    Here
    is a link to a zip file that includes: the cfc that contains
    the query function (categories.cfc), the page that is creating the
    categories menu (lefnav.cfm), a simple cfc that contains a products
    query just for testing (products.cfc) along with a spreadsheet of
    the Categories table's fields.
    I would greatly appreciate any suggestions.
    Thanks for any time and help you can give me on this

    This should at least get you started in the right direction.
    http://www.sitepoint.com/article/dynamic-menu-coldfusion
    Bryan Ashcraft (remove brain to reply)
    Web Application Developer
    Wright Medical Technologies, Inc.
    =============================
    Macromedia Certified Dreamweaver Developer
    Adobe Community Expert (DW) ::
    http://www.macromedia.com/go/team
    "shunnyboy" <[email protected]> wrote in
    message
    news:e2h9hs$kp5$[email protected]..
    > Hi,
    >
    > I have run into a Coldfusion problem that I was hoping
    you could help me
    > with.
    >
    > What I am trying to solve is the dynamic creation of at
    least 5 levels of
    > categories for a menu built with Coldfusion, and if
    possible an infinite
    > amount
    > of levels.

  • Why dynamic table creation with struts working only for JDK1.3.1_02 version

    Row
    import java.util.Vector;
    public class Row
    private static int colsize;
    private Column[] columns;
    public void setColumns(Column[] columns)
    System.out.println("SetColumns");
    this.columns = columns;
    public void setColumn(int i, Column column)
         System.out.println("setting"+ i+"th column"+column);
    public Column[] getColumns()
    return null;
    public Column getColumns(int i)
    System.out.println("Column"+i);
    System.out.println("Colsize"+colsize);
    if(columns == null)
    columns= new Column[colsize];
    if(columns[i] == null)
    columns[i] = new Column();
    return columns;
    public int getColsize()
         return colsize;
    public static void setColsize(int size)
         colsize = size;
    Column:
    public class Column
    private String value;
    public void setValue(String value)
    System.out.println("Value="+value);
    this.value = value;
    public String getValue()
    return value;
    ApplicationResources:
    button.cancel=Cancel
    button.confirm=Confirm
    button.reset=Reset
    button.save=Save
    database.load=Cannot load database from {0}
    error.database.missing=<li>User database is missing, cannot validate logon credentials</li>
    error.fromAddress.format=<li>Invalid format for From Address</li>
    error.fromAddress.required=<li>From Address is required</li>
    error.fullName.required=<li>Full Name is required</li>
    error.host.required=<li>Mail Server is required</li>
    error.noSubscription=<li>No Subscription bean in user session</li>
    error.password.required=<li>Password is required</li>
    error.password2.required=<li>Confirmation password is required</li>
    error.password.match=<li>Password and confirmation password must match</li>
    error.password.mismatch=<li>Invalid username and/or password, please try again</li>
    error.replyToAddress.format=<li>Invalid format for Reply To Address</li>
    error.transaction.token=<li>Cannot submit this form out of order</li>
    error.type.invalid=<li>Server Type must be 'imap' or 'pop3'</li>
    error.type.required=<li>Server Type is required</li>
    error.username.required=<li>Username is required</li>
    error.username.unique=<li>That username is already in use - please select another</li>
    errors.footer=</ul><hr>
    errors.header=<h3><font color="red">Validation Error</font></h3>You must correct the following error(s) before proceeding:<ul>
    errors.ioException=I/O exception rendering error messages: {0}
    heading.autoConnect=Auto
    heading.subscriptions=Current Subscriptions
    heading.host=Host Name
    heading.user=User Name
    heading.type=Server Type
    heading.action=Action
    index.heading=MailReader Demonstration Application Options
    index.logon=Log on to the MailReader Demonstration Application
    index.registration=Register with the MailReader Demonstration Application
    index.title=MailReader Demonstration Application (Struts 1.0-b1)
    index.tour=A Walking Tour of the Example Application
    linkSubscription.io=I/O Error: {0}
    linkSubscription.noSubscription=No subscription under attribute {0}
    linkUser.io=I/O Error: {0}
    linkUser.noUser=No user under attribute {0}
    logon.title=MailReader Demonstration Application - Logon
    mainMenu.heading=Main Menu Options for
    mainMenu.logoff=Log off MailReader Demonstration Application
    mainMenu.registration=Edit your user registration profile
    mainMenu.title=MailReader Demonstration Application - Main Menu
    option.imap=IMAP Protocol
    option.pop3=POP3 Protocol
    prompt.autoConnect=Auto Connect:
    prompt.fromAddress=From Address:
    prompt.fullName=Full Name:
    prompt.mailHostname=Mail Server:
    prompt.mailPassword=Mail Password:
    prompt.mailServerType=Server Type:
    prompt.mailUsername=Mail Username:
    prompt.password=Password:
    prompt.password2=(Repeat) Password:
    prompt.replyToAddress=Reply To Address:
    prompt.username=Username:
    registration.addSubscription=Add
    registration.deleteSubscription=Delete
    registration.editSubscription=Edit
    registration.title.create=Register for the MailReader Demostration Application
    registration.title.edit=Edit Registration for the MailReader Demonstration Application
    subscription.title.create=Create New Mail Subscription
    subscription.title.delete=Delete Existing Mail Subscription
    subscription.title.edit=Edit Existing Mail Subscription
    LogonForm
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    public class LogonForm extends ActionForm
    private String username;
    private String password;
    private String errors;
    public String getUsername()
    return username;
    public void setUsername(String username)
    this.username = username;
    public void setPassword(String password)
    this.password = password;
    public String getPassword()
    return password;
    public String getErrors()
         return errors;
    public void setErrors(String errors)
         this.errors = errors;
    public ActionErrors validate(ActionMapping mapping,
    HttpServletRequest request) {
    ActionErrors errors = new ActionErrors();
    if ((username == null) || (username.length() < 1))
    errors.add("username", new ActionError("error.username.required"));
    if ((password == null) || (password.length() < 1))
    errors.add("password", new ActionError("error.password.required"));
    return errors;
    TableForm
    import org.apache.struts.action.ActionForm;
    import java.util.Vector;
    public class TableForm extends ActionForm
    private static int rowsize;
    private Row[] rows;
    public Row getRows(int i)
    System.out.println("Row"+i);
    System.out.println("Rowsize"+rowsize);
    if(rows == null)
    rows = new Row[rowsize];
    if(rows[i] == null)
    rows[i] = new Row();
    return rows[i];
    public Row[] getRows()
         return null;
    public void setRows(Row[] rows)
         System.out.println("SetRows");
         // this.rows=rows;
    public static void setRowsize(int size)
         rowsize = size;
    public int getRowSize()
         return rowsize;
    LogonAction
    import java.io.IOException;
    import java.util.Hashtable;
    import java.util.Locale;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpSession;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.action.ActionServlet;
    import org.apache.struts.util.MessageResources;
    public class LogonAction extends Action
    public ActionForward execute(ActionMapping mapping,
                        ActionForm form,
                        HttpServletRequest request,
                        HttpServletResponse response)
         throws IOException, ServletException {
    LogonForm logonForm = (LogonForm) form;
    System.out.println(logonForm);
    System.out.println(logonForm.getUsername());
    System.out.println(logonForm.getPassword());
    if(logonForm.getUsername().equals("test") && logonForm.getPassword().equals("test"))
    //TableForm tform = new TableForm();
    //tform.setRowsize(2);
    //tform.getRows(0).setColsize(2);
    //tform.getRows(1).setColsize(2);
    //request.getSession().setAttribute("tableForm",tform);
         System.out.println("Table Form setRowSize");
    TableForm.setRowsize(2);
         System.out.println("Table Form set ColSize");
    Row.setColsize(2);
         System.out.println("Returning success");
    return mapping.findForward("success");
    else
              ActionErrors errors = new ActionErrors();
              errors.add("password",
    new ActionError("error.password.mismatch"));
    saveErrors(request, errors);
    //logonForm.setErrors("LoginError");
    return mapping.findForward("failure");
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE struts-config PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
    "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
    <!--
    This is the Struts configuration file for the example application,
    using the proposed new syntax.
    NOTE: You would only flesh out the details in the "form-bean"
    declarations if you had a generator tool that used them to create
    the corresponding Java classes for you. Otherwise, you would
    need only the "form-bean" element itself, with the corresponding
    "name" and "type" attributes.
    -->
    <struts-config>
    <form-beans>
    <!-- Logon form bean -->
    <form-bean name="logonForm"
    type="LogonForm"/>
    <form-bean name="tableForm"
    type="TableForm"/>
    <form-bean name="profileForm"
    type="ProfileForm"/>
    </form-beans>
    <global-forwards>
    <forward name="success" path="/Profile.jsp"/>
    </global-forwards>
    <!-- ========== Action Mapping Definitions ============================== -->
    <action-mappings>
    <!-- Edit user registration -->
    <action path="/logon"
    type="LogonAction"
    name="logonForm"
    scope="request"
    validate="false"
    input="/Test.jsp">
    <forward name="success" path="/Table.jsp"/>
    <forward name="failure" path="/Test.jsp"/>
    </action>
    <action path="/table"
    type="TableAction"
    name="tableForm"
    scope="request"
    validate="false">
    <forward name="success" path="/Bean.jsp"/>
    <forward name="failure" path="/Table.jsp"/>
    </action>
    <action path="/profile"
    type="ProfileAction"
    name="profileForm"
    scope="request"
    validate="false"
    parameter="method">
    <forward name="edit" path="/EditProfile.jsp"/>
    <forward name="show" path="/Profile.jsp"/>
    </action>
    </action-mappings>
    </struts-config>
    Test.jsp
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html:html locale="true">
    <html:form action="/logon" >
    <center>
    <table>
    <tr>
    <td> Username </td>
    <td> <html:text property="username" size="16" maxlength="16"/> </td>
    <td> <html:errors property="username" /> </td>
    </tr>
    <tr>
    <td> Password </td>
    <td> <html:password property="password" size="16" maxlength="16"
    redisplay="false"/> </td>
    <td><html:errors property="password" /> </td>
    </tr>
    </table>
    </center>
    <center> <html:submit property="submit" value="Submit"/> </center>
    </html:form>
    </html:html>
    Table.jsp
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html:html locale="true">
    <html:form action="/table" >
    <center>
    <table>
    <tr>
    <td> <html:text property="rows[0].columns[0].value" /> </td>
    <td> <html:text property="rows[0].columns[1].value" /></td>
    </tr>
    <tr>
    <td> <html:text property="rows[1].columns[0].value" /> </td>
    <td> <html:text property="rows[1].columns[1].value" /></td>
    </tr>
    </table>
    </center>
    <center> <html:submit property="submit" value="Submit"/> </center>
    </html:form>
    </html:html>

    The above application runs only with JDK1.3.1_02 and not with any other version. This application is creating dynamic table using struts.
    Can anybody help me on the same
    also appending web.xml contents:
    <?xml version="1.0" ?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <!-- Action Servlet Configuration -->
    <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
    <param-name>application</param-name>
    <param-value>ApplicationResources</param-value>
    </init-param>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
    <param-name>debug</param-name>
    <param-value>2</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>2</param-value>
    </init-param>
    <init-param>
    <param-name>validate</param-name>
    <param-value>true</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <!-- Action Servlet Mapping -->
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    <!--Welcome file list starts here -->
    <welcome-file-list>
    <welcome-file>
    /test.jsp
    </welcome-file>
    </welcome-file-list>
    <!-- Struts Tag Library Descriptors -->
    <taglib>
    <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
    </taglib>
    </web-app>
    validate-rules.xml
    <!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
    <!--
    This file contains the default Struts Validator pluggable validator
    definitions. It should be placed somewhere under /WEB-INF and
    referenced in the struts-config.xml under the plug-in element
    for the ValidatorPlugIn.
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
    /WEB-INF/validation.xml"/>
    </plug-in>
    These are the default error messages associated with
    each validator defined in this file. They should be
    added to your projects ApplicationResources.properties
    file or you can associate new ones by modifying the
    pluggable validators msg attributes in this file.
    # Struts Validator Error Messages
    errors.required={0} is required.
    errors.minlength={0} can not be less than {1} characters.
    errors.maxlength={0} can not be greater than {1} characters.
    errors.invalid={0} is invalid.
    errors.byte={0} must be a byte.
    errors.short={0} must be a short.
    errors.integer={0} must be an integer.
    errors.long={0} must be a long.
    errors.float={0} must be a float.
    errors.double={0} must be a double.
    errors.date={0} is not a date.
    errors.range={0} is not in the range {1} through {2}.
    errors.creditcard={0} is an invalid credit card number.
    errors.email={0} is an invalid e-mail address.
    -->
    <form-validation>
    <global>
    <validator name="required"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateRequired"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    msg="errors.required">
    <javascript><![CDATA[
    function validateRequired(form) {
    var isValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oRequired = new required();
    for (x in oRequired) {
         var field = form[oRequired[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea' ||
    field.type == 'file' ||
    field.type == 'select-one' ||
    field.type == 'radio' ||
    field.type == 'password') {
    var value = '';
                                  // get field's value
                                  if (field.type == "select-one") {
                                       var si = field.selectedIndex;
                                       if (si >= 0) {
                                            value = field.options[si].value;
                                  } else {
                                       value = field.value;
    if (trim(value).length == 0) {
         if (i == 0) {
         focusField = field;
         fields[i++] = oRequired[x][1];
         isValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return isValid;
    // Trim whitespace from left and right sides of s.
    function trim(s) {
    return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
    ]]>
    </javascript>
    </validator>
    <validator name="requiredif"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateRequiredIf"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    org.apache.commons.validator.Validator,
    javax.servlet.http.HttpServletRequest"
    msg="errors.required">
    </validator>
    <validator name="minlength"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateMinLength"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.minlength">
    <javascript><![CDATA[
    function validateMinLength(form) {
    var isValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oMinLength = new minlength();
    for (x in oMinLength) {
    var field = form[oMinLength[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea') {
    var iMin = parseInt(oMinLength[x][2]("minlength"));
    if ((trim(field.value).length > 0) && (field.value.length < iMin)) {
    if (i == 0) {
    focusField = field;
    fields[i++] = oMinLength[x][1];
    isValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return isValid;
    }]]>
    </javascript>
    </validator>
    <validator name="maxlength"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateMaxLength"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.maxlength">
    <javascript><![CDATA[
    function validateMaxLength(form) {
    var isValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oMaxLength = new maxlength();
    for (x in oMaxLength) {
    var field = form[oMaxLength[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea') {
    var iMax = parseInt(oMaxLength[x][2]("maxlength"));
    if (field.value.length > iMax) {
    if (i == 0) {
    focusField = field;
    fields[i++] = oMaxLength[x][1];
    isValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return isValid;
    }]]>
    </javascript>
    </validator>
    <validator name="mask"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateMask"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.invalid">
    <javascript><![CDATA[
    function validateMask(form) {
    var isValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oMasked = new mask();
    for (x in oMasked) {
    var field = form[oMasked[x][0]];
    if ((field.type == 'text' ||
    field.type == 'textarea') &&
    (field.value.length > 0)) {
    if (!matchPattern(field.value, oMasked[x][2]("mask"))) {
    if (i == 0) {
    focusField = field;
    fields[i++] = oMasked[x][1];
    isValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return isValid;
    function matchPattern(value, mask) {
    return mask.exec(value);
    }]]>
    </javascript>
    </validator>
    <validator name="byte"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateByte"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.byte"
    jsFunctionName="ByteValidations">
    <javascript><![CDATA[
    function validateByte(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oByte = new ByteValidations();
    for (x in oByte) {
         var field = form[oByte[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea' ||
    field.type == 'select-one' ||
                                  field.type == 'radio') {
                                  var value = '';
                                  // get field's value
                                  if (field.type == "select-one") {
                                       var si = field.selectedIndex;
                                       if (si >= 0) {
                                            value = field.options[si].value;
                                  } else {
                                       value = field.value;
    if (value.length > 0) {
    if (!isAllDigits(value)) {
    bValid = false;
    if (i == 0) {
    focusField = field;
    fields[i++] = oByte[x][1];
    } else {
         var iValue = parseInt(value);
         if (isNaN(iValue) || !(iValue >= -128 && iValue <= 127)) {
         if (i == 0) {
         focusField = field;
         fields[i++] = oByte[x][1];
         bValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return bValid;
    }]]>
    </javascript>
    </validator>
    <validator name="short"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateShort"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.short"
    jsFunctionName="ShortValidations">
    <javascript><![CDATA[
    function validateShort(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oShort = new ShortValidations();
    for (x in oShort) {
         var field = form[oShort[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea' ||
    field.type == 'select-one' ||
    field.type == 'radio') {
    var value = '';
                                  // get field's value
                                  if (field.type == "select-one") {
                                       var si = field.selectedIndex;
                                       if (si >= 0) {
                                            value = field.options[si].value;
                                  } else {
                                       value = field.value;
    if (value.length > 0) {
    if (!isAllDigits(value)) {
    bValid = false;
    if (i == 0) {
    focusField = field;
    fields[i++] = oShort[x][1];
    } else {
         var iValue = parseInt(value);
         if (isNaN(iValue) || !(iValue >= -32768 && iValue <= 32767)) {
         if (i == 0) {
         focusField = field;
         fields[i++] = oShort[x][1];
         bValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return bValid;
    }]]>
    </javascript>
    </validator>
    <validator name="integer"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateInteger"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.integer"
    jsFunctionName="IntegerValidations">
    <javascript><![CDATA[
    function validateInteger(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oInteger = new IntegerValidations();
    for (x in oInteger) {
         var field = form[oInteger[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea' ||
    field.type == 'select-one' ||
    field.type == 'radio') {
    var value = '';
                                  // get field's value
                                  if (field.type == "select-one") {
                                       var si = field.selectedIndex;
                                  if (si >= 0) {
                                       value = field.options[si].value;
                                  } else {
                                       value = field.value;
    if (value.length > 0) {
    if (!isAllDigits(value)) {
    bValid = false;
    if (i == 0) {
         focusField = field;
                                  fields[i++] = oInteger[x][1];
    } else {
         var iValue = parseInt(value);
         if (isNaN(iValue) || !(iValue >= -2147483648 && iValue <= 2147483647)) {
         if (i == 0) {
         focusField = field;
         fields[i++] = oInteger[x][1];
         bValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return bValid;
    function isAllDigits(argvalue) {
    argvalue = argvalue.toString();
    var validChars = "0123456789";
    var startFrom = 0;
    if (argvalue.substring(0, 2) == "0x") {
    validChars = "0123456789abcdefABCDEF";
    startFrom = 2;
    } else if (argvalue.charAt(0) == "0") {
    validChars = "01234567";
    startFrom = 1;
    } else if (argvalue.charAt(0) == "-") {
    startFrom = 1;
    for (var n = startFrom; n < argvalue.length; n++) {
    if (validChars.indexOf(argvalue.substring(n, n+1)) == -1) return false;
    return true;
    }]]>
    </javascript>
    </validator>
    <validator name="long"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateLong"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.long"/>
    <validator name="float"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateFloat"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.float"
    jsFunctionName="FloatValidations">
    <javascript><![CDATA[
    function validateFloat(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oFloat = new FloatValidations();
    for (x in oFloat) {
         var field = form[oFloat[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea' ||
    field.type == 'select-one' ||
    field.type == 'radio') {
         var value = '';
                                  // get field's value
                                  if (field.type == "select-one") {
                                       var si = field.selectedIndex;
                                       if (si >= 0) {
                                       value = field.options[si].value;
                                  } else {
                                       value = field.value;
    if (value.length > 0) {
    // remove '.' before checking digits
    var tempArray = value.split('.');
    var joinedString= tempArray.join('');
    if (!isAllDigits(joinedString)) {
    bValid = false;
    if (i == 0) {
    focusField = field;
    fields[i++] = oFloat[x][1];
    } else {
         var iValue = parseFloat(value);
         if (isNaN(iValue)) {
         if (i == 0) {
         focusField = field;
         fields[i++] = oFloat[x][1];
         bValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return bValid;
    }]]>
    </javascript>
    </validator>
    <validator name="double"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateDouble"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.double"/>
    <validator name="date"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateDate"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.date"
    jsFunctionName="DateValidations">
    <javascript><![CDATA[
    function validateDate(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oDate = new DateValidations();
    for (x in oDate) {
    var value = form[oDate[x][0]].value;
    var datePattern = oDate[x][2]("datePatternStrict");
    if ((form[oDate[x][0]].type == 'text' ||
    form[oDate[x][0]].type == 'textarea') &&
    (value.length > 0) &&
    (datePattern.length > 0)) {
    var MONTH = "MM";
    var DAY = "dd";
    var YEAR = "yyyy";
    var orderMonth = datePattern.indexOf(MONTH);
    var orderDay = datePattern.indexOf(DAY);
    var orderYear = datePattern.indexOf(YEAR);
    if ((orderDay < orderYear && orderDay > orderMonth)) {
    var iDelim1 = orderMonth + MONTH.length;
    var iDelim2 = orderDay + DAY.length;
    var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
    var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
    if (iDelim1 == orderDay && iDelim2 == orderYear) {
    dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
    } else if (iDelim1 == orderDay) {
    dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
    } else if (iDelim2 == orderYear) {
    dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
    } else {
    dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
    var matched = dateRegexp.exec(value);
    if(matched != null) {
    if (!isValidDate(matched[2], matched[1], matched[3])) {
    if (i == 0) {
    focusField = form[oDate[x][0]];
    fields[i++] = oDate[x][1];
    bValid = false;
    } else {
    if (i == 0) {
    focusField = form[oDate[x][0]];
    fields[i++] = oDate[x][1];
    bValid = false;
    } else if ((orderMonth < orderYear && orderMonth > orderDay)) {
    var iDelim1 = orderDay + DAY.length;
    var iDelim2 = orderMonth + MONTH.length;
    var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
    var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
    if (iDelim1 == orderMonth && iDelim2 == orderYear) {
    dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
    } else if (iDelim1 == orderMonth) {
    dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
    } else if (iDelim2 == orderYear) {
    dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
    } else {
    dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
    var matched = dateRegexp.exec(value);
    if(matched != null) {
    if (!isValidDate(matched[1], matched[2], matched[3])) {
    if (i == 0) {
    focusField = form[oDate[x][0]];
    fields[i++] = oDate[x][1];
    bValid = false;
    } else {
    if (i == 0) {
    focusField = form[oDate[x][0]];
    fields[i++] = oDate[x][1];
    bValid = false;
    } else if ((orderMonth > orderYear && orderMonth < orderDay)) {
    var iDelim1 = orderYear + YEAR.length;
    var iDelim2 = orderMonth + MONTH.length;
    var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
    var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
    if (iDelim1 == orderMonth && iDelim2 == orderDay) {
    dateRegexp = new RegExp("^(\\d{4})(\\d{2})(\\d{2})$");
    } else if (iDelim1 == orderMonth) {
    dateRegexp = new RegExp("^(\\d{4})(\\d{2})[" + delim2 + "](\\d{2})$");
    } else if (iDelim2 == orderDay) {
    dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})(\\d{2})$");
    } else {
    dateRegexp = new Reg

Maybe you are looking for

  • Why WordFinder Doesn't work?

    Okay so i have an e-book that you can highlight text, select text and copy paste and so forth.  But Wordfinder doesn't work it tries searching but can never find a word no matter what. So i don't get whats the error going on here.

  • Illustrator CS5 arrow exported in svg 1.1

    Hi all, it looks to me that an arrow created in Illustrator CS5 and exported in a svg 1.1 file is later recognized as a stroke+triangle (two disconnected objects). It just want to make sure that I did not miss anything. The option "preserve Illustrat

  • Query construction issue...

    I have a parameter in my proc called xParam and I'm trying to incorporate it into one of my cursors. Here is what my current cursor looks like: select * from tablex where id in (1,2) and xParam = 'ALL' or           id = 1 and xParam = 'FIRST' or     

  • Min needed to run my music lib on a Mac Laptop?

    I have lost my iTunes music library (including approx 70 CDs of songs, all 65 subscribed podcasts -- worse, which episodes I have listened to and which I haven't -- as well as all my purchased music and about 35 Audiobooks) twice since I loaded iTune

  • Jdev 10.1.3 - JWE

    Hi, Are there any plans for porting JWE 9.0.5 to JDev. 10.1.3? If so, when can I expect to be able to downloadthe new JWE? Øivind