How to write java script in Openbravo

<<

subodh chaudhari

Posts: 39

Joined: Fri Mar 27, 2009 2:17 pm

Post Sat Feb 28, 2009 1:11 pm

How to write java script in Openbravo

Hello everybody,

I just want to know how to write java script in Openbravo

Actually i have tried it for just displaying the hello message using alert function

but it is not working

Can anybody tell me the more information about this ?


thanks..
Subodh
<<

Salvador Zapata

Posts: 24

Joined: Wed Mar 18, 2009 7:26 pm

Post Sat Feb 28, 2009 1:39 pm

RE: How to write java script in Openbravo

Hi Subodh,

Most windows on Openbravo are generated automatically with WAD. So, you can't write javascript on generated windows. You have a nice workarround using "Callouts". "Callouts" are piece of java code executed when some field change. Wad generate the needed javascript for the onChange event.

On the other hand, exist reports and special forms that are manually developed where you can write every free HTML, Javascript, CSS, etc.

regards.
<<

mike_cc mike_cc

Posts: 40

Joined: Fri Mar 27, 2009 10:06 pm

Post Mon Mar 02, 2009 10:17 pm

RE: How to write java script in Openbravo

Salvador:

I thought that though the windows are generated by the WAD that they are still pulling from basic html/xml templates, then it uses XMLengine and sqlc to fill in the data. Is that not correct?

thanks,
Michael
<<

Salvador Zapata

Posts: 24

Joined: Wed Mar 18, 2009 7:26 pm

Post Mon Mar 02, 2009 11:16 pm

RE: How to write java script in Openbravo

Hi Michael,

It is correct, and is for that reason that if you want to write permanent javascript code on AD Windows you should modify WAD and I don't recommend.

if you try to modify the html files generated by WAD, when you compile the application, WAD will regenerate this source code and the written javascript will be deleted.

Wich is the objective for using this Javascript?

Regards,

Salva
<<

mike_cc mike_cc

Posts: 40

Joined: Fri Mar 27, 2009 10:06 pm

Post Tue Mar 03, 2009 2:11 am

RE: How to write java script in Openbravo

I have no objectives other than understanding OB a little better. It makes since that if you recompile that you would loose your javascript, but it could be used for a quick impermanent fix.

However, I have been thinking about making a new tab for the projects module that would incorporate jsgnatt[1] for a visual reference. It will require a couple of js files. I might be able to do it as a report or a form.

Why aren't there any tutorials on the WAD? I don't like that aspect of OB, that it is so difficult to change the layout of the application, and that the the html is rewritten each time you make a request resulting in that you cannot use the back button. Very frustrating.

Cheers,
Michael
<<

mike_cc mike_cc

Posts: 40

Joined: Fri Mar 27, 2009 10:06 pm

Post Tue Mar 03, 2009 2:12 am

RE: How to write java script in Openbravo

Link for above
[1] http://www.jsgantt.com/
<<

Ismael Ciordia Vela

Posts: 400

Joined: Wed Mar 18, 2009 7:25 pm

Post Tue Mar 03, 2009 10:34 am

RE: How to write java script in Openbravo

Hi Michael,

there are two ways to add new functionality to openbravo:
1- using application dictionary: this way is the easiest and provides much better maintainance. But it is limited to the capabilities of current openbravo model
2- through coding your solutions: you can declare a form/process in the application dictionary and then code its implementation. This way is much more versatile -you can do whatever you want- but requires developer skills and a higher effort in the life cycle.

You can also extend the capabilities of openbravo application dictionary by adding new reference types. Have a look to this post: http://forge.openbravo.com/plugins/espforum/view.php?group_id=100&forumid=549512&topicid=6588795

We are working in the developers manual and it will include a tutorial of how to extend wad. And we plan to refactor it in 2.60 to improve extensibility.

But for the solution you plan to do I think it is better to implement it as a process/report. Once you have done it you can link to it from standard openbravo tabs -setting the process assigned to that tab- or directly from the application menu.

Hope it helps. Regards,

Ismael
<<

Ismael Ciordia Vela

Posts: 400

Joined: Wed Mar 18, 2009 7:25 pm

Post Tue Mar 03, 2009 10:43 am

RE: How to write java script in Openbravo

Michael,

have a look to this post [1], I guess it might help to design your solution.

Also, from 2.50 Openbravo supports modules, so you can develop your solution as a module that can be installed in other instances as an optional extension. For information about how to create a module look at [2], at least the developers guide.

Look forward your feedback. Regards,

Ismael

[1] http://forge.openbravo.com/plugins/espforum/view.php?group_id=100&forumid=549512&topicid=6604286
[2] http://wiki.openbravo.com/wiki/Projects/Modularity
<<

mike_cc mike_cc

Posts: 40

Joined: Fri Mar 27, 2009 10:06 pm

Post Tue Mar 03, 2009 4:41 pm

RE: How to write java script in Openbravo

Thanks Ismael,

The information you have given is very good. Again, I'm just tinkering around with the guts to see how easy it is to make changes to OB that go beyond adding new windows. One of the reasons I really like OpenBravo is the fact that you are very transparent and allow your community know what is going on and why and to understand the future projections better than most of the other opensource erps out there.

Thanks again,
Michael
<<

Ismael Ciordia Vela

Posts: 400

Joined: Wed Mar 18, 2009 7:25 pm

Post Tue Mar 03, 2009 4:54 pm

RE: How to write java script in Openbravo

Glad to hear that.

Let me know if you are interested in creating a module that provides visual reference to projects using jsGantt. I will be more than happy to help you.

Regards,

Ismael
Next

Return to Developers

Who is online

Users browsing this forum: No registered users and 1 guest

Website Terms


Designed by ST Software for PTF.