Welcome, Guest
Username: Password: Remember me

TOPIC: Me = Dumb, JDom = No, Now what? Ditching the JDom?

Me = Dumb, JDom = No, Now what? Ditching the JDom? 26 Feb 2012 10:35 #1449

  • iconvisual
  • iconvisual's Avatar
  • Offline
  • Senior Member
  • Keen Joomla! 1.7 Developer
  • Posts: 53
  • Thank you received: 5
  • Karma: 1
Hello All,

The title says it all really. I am not a good PHP/Javascript/CSS developer. That's just a fact and why I use J-Cook!

I cannot begin to understand how JDom works, I understand that it is supposed to be flexible to change it on my Layouts (i.e. Data Entry Forms). I am a simple man, and an xHTML page with CSS is easy for me to read, but JDom confuses me.

I've even searched the net for tutorials on JDom - Zip! Some old 2001 videos (YouTube) on JAVA and JDom..

I know how to modify "name_of_my_component.css" to alter the CSS, but that doesn't help me a lot.

Obviously I could tear apart my View - but if I do this (i.e. replace the whole 'default' view with my own code) it will probably break everything else.

I'm just sounding out here, hoping that someone might jump in and say "Well, here are your options.."

Do I / Can I literally replace the 'view's layouts on the Front End with 'bare bones' xHTML and CSS? (and JS).

Sorry about the rambling, hope someone can help me before I do my head in.

Regards,

Edward (Confused).
Keen Joomla! and PHP/MySQL developer. Excited about J-Cook.
The administrator has disabled public write access.

Re: Me = Dumb, JDom = No, Now what? Ditching the JDom? 26 Feb 2012 11:44 #1450

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Hi Edwardcox,

It is sunday, and tomorrow I come back to the forum.

JDom is nothing to do with Java.

First,
if you remove JDom calls in your component, it doesn't break the application layer. But you have to reconstruct manually the code. Try to copy/paste what is returned in HTML to have a base.

But JDom is really more powerfull if you correctly customize it.

Every control (input, select, imagepicker, etc...) is a single file.
So if you want to modify the HTML of a control, you will ONLY modify ONE file.


In the build() function of this file, you change the HTML output.
BUT, sometimes, the build() function is inherited (file, image, ...), so it makes it complicated.

TODO : look after the build() method in you JDom files, (and searching in its parent file if you don't find it)

build() function get the parameters and contruct with that.
It means that you can add as many parameters for that render method.

To add parameters, look in the __construct() method of this file.
Parameters ar inherithed too, so you only see specific parameters.
For example, dataObject is very common parameter, so it is asked in a low level files (html.fly, html.form...)


MORE ADVANCED :

For assets (javascript, css, images, ...)
it is little bit more complicated, but you can look after colorpicker to have an example.


Another good file to read is html.php wich contains some usefull functions to call from the build() function.

dom.php contains framework system and have also some usefull functions to access the files in general.


Sunday is a good day to discover JDom on your free time.

Enjoy it !!!
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: iconvisual
Time to create page: 0.088 seconds

Get Started