IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Iterator - for formatting HTML Table dynamically

  • 1.  Iterator - for formatting HTML Table dynamically

    Posted Sat March 29, 2008 11:54 AM

    Hi

    I’ve a requirement where I need to build a table dynamically based on an SQL query.


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 2.  RE: Iterator - for formatting HTML Table dynamically

    Posted Thu April 10, 2008 02:33 PM

    Yes, but the best way to do this is by building the table programmatically, using the jsf component apis (see http://java.sun.com/javaee/javaserverfaces/1.1/docs/API/overview-summary.html). Here are links to a few examples of building a table programmatically:

    http://www.icefaces.org/JForum/posts/list/2955.page
    http://www.manning-sandbox.com/message.jspa?messageID=41514
    http://forum.java.sun.com/thread.jspa?threadID=5238214&messageID=9978386

    The one thing you have to do differently with caf views from the examples using jsp is that the jsp examples simply use a “binding” attribute on an h:dataTable jsp to connect the programmatically-built table to the rendered page. With caf views, you should put the table-building code in a method called “beforeRenderResponse” in your page bean, and connect it to the the view by looking up a component (such as a panel) in your view, and adding the new table as a child of that component. Here’s an example:

    protected void beforeRenderResponse() {


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 3.  RE: Iterator - for formatting HTML Table dynamically

    Posted Wed April 16, 2008 03:11 PM


  • 4.  RE: Iterator - for formatting HTML Table dynamically

    Posted Mon May 12, 2008 12:27 PM

    Best way is to create an IPortletURL via your page bean’s createRenderUrl() method. You can use this API to add parameters. For example, the following java code would create a portlet url, set it’s base to the alias of a page containing some other portlet, and configure the “myParam” parameter of that other portlet:

    IPortletURL portletUrl = createRenderUrl();
    // display some other page
    portletUrl.setBaseURL(“/my.page.alias”);
    // configure some other portlet
    IPortletURL otherPortletUrl = url.addPortletURL(“other.portlet.alias”);
    // set some parameter of the other portlet
    otherPortletUrl.setParameter(“myParam”, “myValue”);

    // set the value of a link control to this string:
    String url = portletUrl.toString();

    See “http://www.ajax-softwareag.com/articles/Y4LCDN/Caf-7-1-1JavaDocs/com/webMethods/caf/portlet/IPortletURL.html” for the IPortletURL javadocs.

    Justin


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS