4

In my customization i want to create 2 CreateLineFrom form in same window/Table in WEBUI.

Usually we call our WClass file in WCreateFromFactory (static by giving tableID and Class name) in Zkwebui

My Question is how use another "CreateLineFrom" form in Same Window?

Kara
  • 6,115
  • 16
  • 50
  • 57
Silviaa
  • 475
  • 8
  • 35

2 Answers2

0

If you need one more Create Line From button functionality through only configuration changes then you need follow following point

  1. Drop the AD_FIELD_COLUMN index of AD_Field table,
  2. Create one more record in Field tab of Window, Tab And field window.

Ex :- Field Name as Crate Lines From2
Column AS CrateFrom And save the record.
Now and by using field sequence tab you can align second Crate Lines From2 button.

This thing you can do without changing the code.


If you are ready to change the code then modify AbstractADWindowPanel.java class

in actionButton method you can find the

    else if (col.equals("CreateFrom")) code 

just update this code as follows

 else if (col.equals("CreateFrom") || col.equals("newFieldName"))

Now you can add above your desired column in following tables and column should be newFieldName (What ever you written in java code) C_Invoice, M_InOut, M_Movement, C_BankStatement.

Steps to show field in a form :-

  1. Open Table And column Window And select above any table
  2. Crate a System element with newFieldName and save it
  3. Enter Database column Name and Name as same
  4. Select the length as 1
  5. Reference as button and save the record
  6. Now click on the synchronize column button
  7. Now open any respective Window, Tab Field and select the Tab tab
  8. Click on the Create Fields button, You will get newly created button
  9. You can align the field by using Field and Field sequence tabs

let me know why do you need 2 same fields in one tab, is this related to security ? if it is then we can achieve very simple way

Giri
  • 507
  • 6
  • 23
  • I need to display datas from 3 windows/tables in CLF(possible) but my client requested for differentiate with 2 buttons.Had 2 class file for same table s_registeredClasses.put(I_C_Order.Table_ID,WCreateFrom1.class); s_registeredClasses.put(I_C_Order.Table_ID,WCreateFrom2.class); – Silviaa Nov 19 '13 at 09:43
  • I didn't get your point functionally. but technically your idea is not full-fill the requirement, because your are setting order table id to map. After that system compares the table id ( get from the context) with map table id. Here map always return last applied value only. let me know on which basis you are trying show different views end-user? – Giri Nov 19 '13 at 10:47
0

In adempiere functionality can't create 2 CLF form in Same Window because hashmap stored the last given value i.e when i execute it call the " WCreateFrom2UI.class"

private static HashMap<Integer, Class<? extends ICreateFrom>> registeredClasses = null;

static
{       
    s_registeredClasses.put(I_C_Order.Table_ID, WCreateFrom1UI.class);   
    s_registeredClasses.put(I_C_Order.Table_ID, WCreateFrom2UI.class);  
}

Created New Button named as "CreateFromIM" ,added the action in AbstractADwindowPanel and created new Class WCreateFromIMFactory that is copy of WCreateFromFactory

    if (col.equals("CreateFrom")  ) {
        ICreateFrom cf = WCreateFromFactory.create(curTab);

    } 
    else if (col.equals("CreateFromIM") )  
        ICreateFrom cf = WCreateFromIMFactory.createIM(curTab);

        } 
Silviaa
  • 475
  • 8
  • 35