AprilandJake.com

Access JS object fields

Sometimes it is useful to be able to iterate through the fields in a javascript object and use the values kept therein for something spectacular. I've found this to be the case for POJSOs (+S = 'Script') that I pass down to the client with new-found data from the backend.

Pass Parameters to Javascript Callback

Callback functions are a nice feature of Javascript. It's nice to be able to just use a function handle to show that it should be called when a certain something completes. Sometimes, however, we want to do more than just specify a function handle. We want to pass parameters. Why? Because sometimes the callback method cares about other data that was available before the original request. Here's an example:

Pass Parameters to Jquery Event Functions

Jquery has some awesome event-handling abilities. The elusive ability to pass parameters into these event callbacks seems way harder than it should be. Nevertheless, I have found *a* solution. I really doubt it's the best one. I really hope it isn't.

JSF Modal Goodness

Meet the new web. The simpler the better. The cleaner the better. The more pleasing the colors the better. The fuzzier feelings the better. The latest fuzzies have been brought on by a slew of modals. Previously, we haven't used many modals in our layouts and designs, so here's the first working pattern on how to get this kind of stuff working.

This solution allows:


  • Content to appear in a modal

  • Validation errors post back to the modal

  • Edits made in a modal persist back to the database

  • Success messages appear on parent page

Id's from JSF, used in jQuery

For our view layer on our current project at work, we use JSF/Facelets + some jQuery goodness. I have found that at some times these two tech's have a hard time working with each other. I ocassionally have problems with the id's. Here's a nice little way to guarantee you id's are awesome.

ManyToMany Relationships in JSF

What a journey of discovery! I haven't done much many-to-many relationship management in JSF. Django makes it quite easy. But at work recently, I did it in JSF. It was quite the experience, hereafter chronicled.