1. I think you could do this with an "onblur" event handler on the text field you are tabbing out from (I am not sure this is necessarily a wise decision from a UI standpoint though). The Javascript function could set a hidden field to a certain value. You would then submit the form to the server. OXF would match on the hidden field to determine that this action was taken, look at the id, complete the data from the db, and show a new page with the results filled out.
To add the "onblur" attribute, add a "d:onblur" attribute on the xforms:input element. The epilogue will automatically copy over the attributes that are in a custom namespace to the resulting HTML component.
2. It is correct that Struts comes with built-in client validation code. If you don't use Struts with OXF, you will have to either write your own client-side validation code, or to hook up Struts's or some other existing code. Other than that, there is no need to use Struts. If you decide to use Struts, you pretty much renounce all the benefits of the OXF controller, and of much of the end-to-end XML approach to writing applications.
I would recommend using Struts with OXF mainly if you plan to do most of your coding in Java (and/or leverage some existing Struts-based code), and if you plan using an XML approach only for the presentation layer.
Note that OXF 2.5 will have much better XForms-based support for validation.
-Erik
Tony Tay wrote:
> hi, > > 1. How can change the OXF Address Book example to pick up the record based > on the "id" field of the "friends" table, ie., when i "tab" out of this > "id" (to be added") column, it will go and pick up the data from the oracle > database and populate the remaining fields and allow up to make any final > changes to the data and update if i wish to back to the database. > > Please help me with any javascript (yet to master it) > > 2. Another question is, should the above be using the Struts as the > validation and retreiving of the data from database ? (i was looking at the > client-validation example) > > regards > tony
_______________________________________________ oxf-users mailing list [EMAIL PROTECTED] http://mail.orbeon.com/mailman/listinfo/oxf-users
