Mindoo Blog - Cutting edge technologies - About Java, Lotus Notes and iPhone

  • XPages series #8: Dynamically creating the UI of an XPage in Java

    Karsten Lehmann  November 10 2009 23:11:23
    This 8th part of the XPages series is more or less a link to a great blog posting that was just published my Tommy Valand.

    It demonstrates how you can create a dynamic web user interface by leveraging JSF features in your XPages application.
    In his example, Tommy produces a data table UIComponent with a snippet of Java code that is executed with the click on a button.

    Image:XPages series #8: Dynamically creating the UI of an XPage in Java

    I'm currently working on something similar for a customer project, but unfortunately I cannot say much about technical details at the moment.
    Basically, it's about dynamic application UI creation based on an abstract UI description. The system produces a dual-output: it dynamically creates the UI of an XPage, but it also creates a Java UI (e.g. a set of Swing components) with a similar form layout.
    Write once, run anywhere. :-)

    The concept includes its own data layer that works independent from Lotus Notes and has some fancy features like transaction logging (even for storing in Lotus Notes databases).

    I recommend that you take a look at Tommys posting and start thinking about your personal use case for this. Anything is possible.

    In my next blog series posting I'm going to write about my own bean manager for managed beans that I needed as a workaround for security limitations when running an XPages application in the Lotus Notes client.
    Comments

    1Tommy Valand  11/11/2009 8:01:45  XPages series #8: Dynamically creating the UI of an XPage in Java

    Thanks for the linky :)

    The buttons actually only change the sessionScope variable that is the Data Source of the dynamic Data Table, then do a partial refresh on the table, based on its id.

    The DataTable is created on Page Load, so that it doesn't have to be recreated every time an update happens.

    2RobShaver  11/13/2009 18:32:06  XPages series #8: Dynamically creating the UI of an XPage in Java

    My use case is a Domino based content management system where the content owner can modify the UI via the web browser.

    3Karsten Lehmann  11/13/2009 18:47:15  XPages series #8: Dynamically creating the UI of an XPage in Java

    Hi Rob,

    great idea! I was already wondering when the first one would come up with it. That should be possible to build, either with a set of repeater controls or with a completely dynamic approach that generates a UIComponent tree via code.

    When you use the repeater controls, just don't iterate over the data, but over a UI description instead (e.g. a list of Java objects that describe what to render in the web page).

    That should be pretty powerful with the right architecture.

    Best regards,

    Karsten

    4Mario Gutsche  04/13/2010 15:44:27  XPages series #8: Dynamically creating the UI of an XPage in Java

    Hi,

    thanks for this article.

    For my bachelor thesis i'm developing a xpage-portal and want to realise the portlets/widgets as custom components that will be added dynamically to the portal-page.

    Problem is: normal xsp components can be created with SSJS but custom component are UIIncludeComposite-Objects, that need a FacesPageDriver set and i have no idea how to get this Object via SSJS, i'm already digging through the decompiled sources without success.

    Do you know how to get the PageDriver?

    Best regards,

    Mario

    5Karsten Lehmann  01/17/2011 10:45:49  XPages series #8: Dynamically creating the UI of an XPage in Java

    No, I'm sorry, don't know how to get it.

    But you can add components dynamically to an XPage without a PageDriver:

    UIComponent panel=getPanel("panelId");

    UIComponent newCtrl=new UIOutput();

    //initialize value bindings in newCtrl

    ...

    //add control to the XPages tree

    panel.getChildren().add(newCtrl);

    6Miroslav Navratil  02/17/2011 8:08:53  XPages series #8: Dynamically creating the UI of an XPage in Java

    I'm trying to develop my workflow-type applications framework that would allow me to keep the complete business logic in JAVA class. So far I was not sure how to modify the UI based on user's action (e.g. showing a dialogue window when a user choose Submit for Approval button) in an effective and structured way and this seems to be possibly an option. Thanks for the post.

    7Gabriel Coutinho BrĂȘtas Netto  10/17/2012 16:17:26  XPages series #8: Dynamically creating the UI of an XPage in Java

    Hi, I have a problem creating a a data table inside a dialog. Either a dojo a dialog or a jquery one.

    Using jquery I cant update the fields contents to the bean I have associated with created in the datatable.

    In Dojo i cant seem to close the dialog even though I can update the bean property. The button doesnt seem to execute any server side code other then the partial update changing the properties.