katratxo on Software Development

tail -f /var/log/brain | grep -i software

How to build a Manual Window in Openbravo 3

with 7 comments

Here you have the recorded session on “How to build a View Implementation” in two parts.

I. The basics

II. Adding a button and an Action Handler

Timeline

  • 35m28s: I said “punto” that means “dot” in Spanish. A few seconds later I say “chuleta” that means “cheat sheet” in Spain.
  • 45m55s: I started talking on “Don’t be fooled by console.log
  • 52m02s: The importance of using OB.Constants.FIELDSEPARATOR and OB.Constants.IDENTIFIER
  • 57m15s: An idea on how to support a dynamic generation of a Selector in a view implementation

You can get the code of this example at: https://bitbucket.org/iperdomo/org.openbravo.training.manualwindow

Written by katratxo

May 18, 2012 at 11:45 am

7 Responses

Subscribe to comments with RSS.

  1. Hi Ivan,

    Great work,,very useful for all Openbravo developers.

    Thirumalai.

    Thirumalai

    May 23, 2012 at 7:59 am

  2. Hi Katratxo,

    just watched your two screencasts about building a manual window. Thank you for your effort!

    But when trying to comprehend and reproduce these steps in my local Openbravo workspace (Eclipse), I’m facing following problem:

    When opening my new view in OB an error “Error occured: No class and no template defined for view” rises up.

    When selected “OB Standard View” as Template, I’m getting the following error in JavaScript Console when open the create View (as reference – that’s 39:34 in your video):

    Uncaught SyntaxError: Unexpected token ,
    In ISC_Combined.js:312

    So I re-watched your cast again and figured out that you used module “Training View Implementation” (37:24 in video), but when creating the menu entry, you use module “Sample Manual Window” (38:25 in video). Why? Accidentally?

    I would kindly ask you for a hint how to get that solved.

    Thank you in advance,

    Victor

    Victor Roeder

    June 25, 2012 at 5:01 pm

  3. Hi Katratxo, thank you for your video, it’s very helpful. I’m having a technical issue with my Eclipse, every time I’m dealing with Javascript in Openbravo, Eclipse froze up and I must wait several minutes before it came back to “life”. Any thoughts?

    Alberson Melo

    January 8, 2013 at 5:32 pm

  4. Hi Ivan,
    great job, I’m working on a manual window and your post has been the base for my one; but I’ve a problem because I’m trying to add a widget in a form that should be a combobox related to sales region. SO I found a UI where it is used and I added this code (copyng from there:

    {
    name: ‘destination’,
    title: ‘Destination’,
    required: true,
    columnName: ‘C_Salesregion_ID’,
    inpColumnName: ‘inpcSalesregionId’,
    refColumnName: ‘C_SalesRegion_ID’,
    targetEntity: ‘SalesRegion’,
    gridProps: {
    sort: 2,
    autoExpand: true,
    editorProps: {
    displayField: null,
    valueField: null
    },
    displaylength: 32,
    fkField: true,
    showHover: true
    },
    type: ‘_id_144’
    }

    but ot just shows an empty combobox.
    So I thought I’ve to add its datasource and other few fields:

    {
    name: ‘destination’,
    title: ‘Destination’,
    required: true,
    columnName: ‘C_Salesregion_ID’,
    inpColumnName: ‘inpcSalesregionId’,
    refColumnName: ‘C_SalesRegion_ID’,
    targetEntity: ‘SalesRegion’,
    gridProps: {
    sort: 2,
    autoExpand: true,
    editorProps: {
    displayField: null,
    valueField: null
    },
    displaylength: 32,
    fkField: true,
    showHover: true
    },
    type: ‘_id_144’,
    init: function () {
    this.optionDataSource = OB.Datasource.create({
    dataURL: ‘/openbravo/org.openbravo.service.datasource/SalesRegion’
    });
    this.Super(‘init’, arguments);
    },
    displayField : ‘name’,
    valueField:”id”,
    defaultPopupFilterField : ‘name’,Roberto
    popupTextMatchStyle : ‘startsWith’,
    textMatchStyle : ‘startsWith’,
    outHiddenInputPrefix : ‘inporigin’,
    filterFields:[“name”]
    }

    With this code it ALMOST works, it has to problems:
    1) it doesn’t filter when you type in the widget
    2) It says “The entered value is a value not present in the list ….” when I select a value and give the focus to another widget

    Please can you help me?
    Tx a lot
    Roberto

    amicidirobertooberto

    March 31, 2013 at 12:43 am


Leave a reply to Alberson Melo Cancel reply