RE: [iPlanet-JATO] Href click & tiled view display

Srinivas,
I hope that I am not oversimplifying your first question; repost if I do not
answer your question. Independent of JATO, HTML Form button sumbits will
include the scraping of data off the form input fields; the data will passed
as part of the body of the HTTP request. Therefore, you would expect to
receive all your inputs during the Button submit. In the case of a button,
a HTTP POST request is invoked. Href clicks, only submit the NVPs which are
encoded on the HREF URL. Therefore, it is impossible (under normal
circumstances) to retrieve the inputs from the FORM during the Href click.
In the case of a Href, a HTTP GET request is invoked. Some customers have
used a pattern in which Javascript is used to capture the Href onClick()
event to perform some runtime modifications to the HREF URL before the HTTP
GET request is submitted. I recommend to always have the LogProxy2 utility
running during development so that the HTTP requests and repsonses can be
debugged. If you setup the LogProxy2 (downloadable from this Group's Files
repository) then you would see the HTTP requests in the LogProxy2's console
window.
TiledView question: Remember, each TiledView requires a "primary
DatasetModel" which it uses for iteration of the tiles. It can be
confusing, but the API call of
<ContainerView>.getDefaultModel()
has no relation to the implementation class called DefaultModel. See the
Javadoc (excerp below)
/migtoolbox-1.1.1/doc/jato/api/com/iplanet/jato/view/ContainerView.html#getD
efaultModel()
"Returns this view's default model. The default model is typically used by
DisplayField children for default value storage (if they are not bound to
any other model). This method should always return a valid model instance.
Note that the default model need not be an actual instance of DefaultModel,
although this is usually the case."
Both of your TiledView's (inner and outer) are ContainerViews, each having
their own property for [get/set]DefaultModel(). Likewise, the ViewBean
parent of the outer TiledView is a ContainerView as well. With these facts
in mind, consider the behavior of the ModelManager. The ModelManager will
ensure that only once instance of specifically named model will be provided
during a request scope. Therefore, everytime that you make a call to
<ModelManager>.getModel(SomeModel.class)
no matter how many times you make this call during a request, the
ModelManager will ensure that you get the same object reference back.
Implicitly, you are asking for a Model with the exclusive name of
<ModelManager>.getDefaultModelInstanceName(SomeModel.class)
I believe that your problem is that you have the Primary Model of both the
inner and outer TiledView's set to the same instance of the DefaultModel
class. Therefore, the TiledViews are tripping over each other because they
are using the same Primary model. What I would do is change the constructor
of each TiledView to set an exclusive Primary model
// add to constructor of outer TileView
setPrimaryModel(getModelI(DefaultModel.class,"outer")
// add to constructor of inner TileView
setPrimaryModel(getModelI(DefaultModel.class,"inner")
remember to set the "size" of the Primary Model appropriately in the
beginDisplay() event of each TiledView before calling super.beginDisplay()
matt
-----Original Message-----
From: Srinivas Chikkam [mailto:<a href="/group/SunONE-JATO/post?protectID=061212020185082096169232190043244089032032196034013195172049230091142254099102">srinivas.chikkam@w...</a>]
Sent: Tuesday, July 17, 2001 7:36 AM
Subject: [iPlanet-JATO] Href click & tiled view display
Hi,
I'm facing the following two problems in JATO. Your help will be
appreciated.
1) Clicking a HREF.
I have a button and a href in a page. When I submit the page by
clicking the button, I'm able to
get all the user entered data (form elements) in handler method.
However, when I click
the href and I try to retrieve the data entered by the user in my
corresponding handler method, I'm
getting blank values.
How would I be able to get the user entered data upon clicking of a href
? I'm copying the sample
code for your reference.
// This returns me 5 values entered in the 5 tiles by the user.
public void handleBButtonRequest(RequestContext req)
throws ServletException, IOException
try
System.out.println("button clicked..");
pgSampleTiledView tiledView = getSampleTile();
System.out.println("\n\n\n\n@@@@@@@@@@@ No of tiles >>>
"+tiledView.getNumTiles());
int n = tiledView.getNumTiles();
for (int i=0; i<n; i++)
tiledView.setTileIndex(i);
System.out.println(i+".
"+tiledView.getTbValue().getValue().toString());
this.forwardTo(req);
catch (Exception ex)
ex.printStackTrace();
// This returns me 0 tiles and doesn't get into for loop
public void handleLinkModifyDistributionRequest(RequestContext req )
throws ServletException, IOException
try
System.out.println("href clicked..");
pgSampleTiledView tiledView = getSampleTile();
System.out.println("\n\n\n\n@@@@@@@@@@@ No of tiles >>>
"+tiledView.getNumTiles());
int n = tiledView.getNumTiles();
for (int i=0; i<n; i++)
tiledView.setTileIndex(i);
System.out.println(i+".
"+tiledView.getTbValue().getValue().toString());
this.forwardTo(req);
catch (Exception ex)
ex.printStackTrace();
2) Tiled view display
I have tiled view inside another tiled view. Based upon the data
retrieved from the database, lets say, the outer tile needs to be
displayed twice and the inner tile 3 times and 1 time.
For Ex: Lets say, the desired output from these tiled views is as
follows
STOCK INVESTMENT
stock name1
stock name2
stock name3
OTHER INVESTMENT
other investment1
The outer tiled view displays the investment type headings (STOCK
INVESTMENT or OTHER INVESTMENT) and inner tile
displays the actual stock names or the other investment names. Both
the tile views are bound to a default model. In the begin display
of these tiled view I'm setting the size of the model as
getPrimaryModel.setSize(requiredsize).
If i display 3 records in the inner tiled view in the first iteration
and i try to display 1 record in the second iteration, it displays 3
records
properly the first time but it doesn't display any records second
time. super.nextTile() returns false right away second time.
But If I try to display 1 record in the first iteration and 3 records in
the second iteration as below, it works fine.
STOCK INVESTMENT
stock name1
OTHER INVESTMENT
other investment1
other investment2
other investment3
Please let me know what could be the problem.
Thanks
~ Srinivas
The Information contained and transmitted by this E-MAIL is
proprietary to
Wipro Limited and is intended for use only by the individual or
entity to which
it is addressed, and may contain information that is privileged,
confidential or
exempt from disclosure under applicable law. If this is a
forwarded message,
the content of this E-MAIL may not have been sent with the
authority of the
Company. If you are not the intended recipient, an agent of the intended
recipient or a person responsible for delivering the information
to the named
recipient, you are notified that any use, distribution,
transmission, printing,
copying or dissemination of this information in any way or in any
manner is
strictly prohibited. If you have received this communication in
error, please
delete this mail & notify us immediately at mailadmin@w...
[Non-text portions of this message have been removed]
[email protected]

should read
// add to constructor of outer TileView
setPrimaryModel(getModel(DefaultModel.class,"outer");
// add to constructor of inner TileView
setPrimaryModel(getModel(DefaultModel.class,"inner");
matt
-----Original Message-----
From: Matthew Stevens [mailto:<a href="/group/SunONE-JATO/post?protectID=029166114165042198028082000056130080177026031196061123241150194211220076086020224">matthew.stevens@e...</a>]
Sent: Tuesday, July 17, 2001 9:25 AM
Subject: RE: [iPlanet-JATO] Href click & tiled view display
Srinivas,
I hope that I am not oversimplifying your first question; repost
if I do not
answer your question. Independent of JATO, HTML Form button sumbits will
include the scraping of data off the form input fields; the data
will passed
as part of the body of the HTTP request. Therefore, you would expect to
receive all your inputs during the Button submit. In the case of
a button,
a HTTP POST request is invoked. Href clicks, only submit the
NVPs which are
encoded on the HREF URL. Therefore, it is impossible (under normal
circumstances) to retrieve the inputs from the FORM during the Href click.
In the case of a Href, a HTTP GET request is invoked. Some customers have
used a pattern in which Javascript is used to capture the Href onClick()
event to perform some runtime modifications to the HREF URL
before the HTTP
GET request is submitted. I recommend to always have the
LogProxy2 utility
running during development so that the HTTP requests and repsonses can be
debugged. If you setup the LogProxy2 (downloadable from this
Group's Files
repository) then you would see the HTTP requests in the
LogProxy2's console
window.
TiledView question: Remember, each TiledView requires a "primary
DatasetModel" which it uses for iteration of the tiles. It can be
confusing, but the API call of
<ContainerView>.getDefaultModel()
has no relation to the implementation class called DefaultModel. See the
Javadoc (excerp below)
/migtoolbox-1.1.1/doc/jato/api/com/iplanet/jato/view/ContainerView
.html#getD
efaultModel()
"Returns this view's default model. The default model is typically used by
DisplayField children for default value storage (if they are not bound to
any other model). This method should always return a valid model instance.
Note that the default model need not be an actual instance of
DefaultModel,
although this is usually the case."
Both of your TiledView's (inner and outer) are ContainerViews, each having
their own property for [get/set]DefaultModel(). Likewise, the ViewBean
parent of the outer TiledView is a ContainerView as well. With
these facts
in mind, consider the behavior of the ModelManager. The ModelManager will
ensure that only once instance of specifically named model will
be provided
during a request scope. Therefore, everytime that you make a call to
<ModelManager>.getModel(SomeModel.class)
no matter how many times you make this call during a request, the
ModelManager will ensure that you get the same object reference back.
Implicitly, you are asking for a Model with the exclusive name of
<ModelManager>.getDefaultModelInstanceName(SomeModel.class)
I believe that your problem is that you have the Primary Model of both the
inner and outer TiledView's set to the same instance of the DefaultModel
class. Therefore, the TiledViews are tripping over each other
because they
are using the same Primary model. What I would do is change the
constructor
of each TiledView to set an exclusive Primary model
// add to constructor of outer TileView
setPrimaryModel(getModelI(DefaultModel.class,"outer")
// add to constructor of inner TileView
setPrimaryModel(getModelI(DefaultModel.class,"inner")
remember to set the "size" of the Primary Model appropriately in the
beginDisplay() event of each TiledView before calling super.beginDisplay()
matt
-----Original Message-----
From: Srinivas Chikkam [mailto:<a href="/group/SunONE-JATO/post?protectID=061212020185082096169232190043244089032032196034013195172049230091142254099102">srinivas.chikkam@w...</a>]
Sent: Tuesday, July 17, 2001 7:36 AM
Subject: [iPlanet-JATO] Href click & tiled view display
Hi,
I'm facing the following two problems in JATO. Your help will be
appreciated.
1) Clicking a HREF.
I have a button and a href in a page. When I submit the page by
clicking the button, I'm able to
get all the user entered data (form elements) in handler method.
However, when I click
the href and I try to retrieve the data entered by the user in my
corresponding handler method, I'm
getting blank values.
How would I be able to get the user entered data upon clicking of a href
? I'm copying the sample
code for your reference.
// This returns me 5 values entered in the 5 tiles by the user.
public void handleBButtonRequest(RequestContext req)
throws ServletException, IOException
try
System.out.println("button clicked..");
pgSampleTiledView tiledView = getSampleTile();
System.out.println("\n\n\n\n@@@@@@@@@@@ No of tiles >>>
"+tiledView.getNumTiles());
int n = tiledView.getNumTiles();
for (int i=0; i<n; i++)
tiledView.setTileIndex(i);
System.out.println(i+".
"+tiledView.getTbValue().getValue().toString());
this.forwardTo(req);
catch (Exception ex)
ex.printStackTrace();
// This returns me 0 tiles and doesn't get into for loop
public void handleLinkModifyDistributionRequest(RequestContext req )
throws ServletException, IOException
try
System.out.println("href clicked..");
pgSampleTiledView tiledView = getSampleTile();
System.out.println("\n\n\n\n@@@@@@@@@@@ No of tiles >>>
"+tiledView.getNumTiles());
int n = tiledView.getNumTiles();
for (int i=0; i<n; i++)
tiledView.setTileIndex(i);
System.out.println(i+".
"+tiledView.getTbValue().getValue().toString());
this.forwardTo(req);
catch (Exception ex)
ex.printStackTrace();
2) Tiled view display
I have tiled view inside another tiled view. Based upon the data
retrieved from the database, lets say, the outer tile needs to be
displayed twice and the inner tile 3 times and 1 time.
For Ex: Lets say, the desired output from these tiled views is as
follows
STOCK INVESTMENT
stock name1
stock name2
stock name3
OTHER INVESTMENT
other investment1
The outer tiled view displays the investment type headings (STOCK
INVESTMENT or OTHER INVESTMENT) and inner tile
displays the actual stock names or the other investment names. Both
the tile views are bound to a default model. In the begin display
of these tiled view I'm setting the size of the model as
getPrimaryModel.setSize(requiredsize).
If i display 3 records in the inner tiled view in the first iteration
and i try to display 1 record in the second iteration, it displays 3
records
properly the first time but it doesn't display any records second
time. super.nextTile() returns false right away second time.
But If I try to display 1 record in the first iteration and 3 records in
the second iteration as below, it works fine.
STOCK INVESTMENT
stock name1
OTHER INVESTMENT
other investment1
other investment2
other investment3
Please let me know what could be the problem.
Thanks
~ Srinivas
The Information contained and transmitted by this E-MAIL is
proprietary to
Wipro Limited and is intended for use only by the individual or
entity to which
it is addressed, and may contain information that is privileged,
confidential or
exempt from disclosure under applicable law. If this is a
forwarded message,
the content of this E-MAIL may not have been sent with the
authority of the
Company. If you are not the intended recipient, an agent of the intended
recipient or a person responsible for delivering the information
to the named
recipient, you are notified that any use, distribution,
transmission, printing,
copying or dissemination of this information in any way or in any
manner is
strictly prohibited. If you have received this communication in
error, please
delete this mail & notify us immediately at mailadmin@w...
[Non-text portions of this message have been removed]
[email protected]
[email protected]

Similar Messages

  • Re: [iPlanet-JATO] Re: Href click & tiled view display

    Srinivas--
    Remember, attachments don't come through on the forum. Please send them to
    the jatoteam@e... alias.
    Todd
    ----- Original Message -----
    From: "Srinivas Chikkam" <srinivas.chikkam@w...>
    Sent: Thursday, July 19, 2001 5:26 AM
    Subject: [iPlanet-JATO] Re: Href click & tiled view display
    Todd,
    I'm calling resetTileIndex() in the begin display of the tiled views.
    I'm attaching the code with this mail.
    Outer tile: pgModelDistributionrMultiplePayeesTiledView
    inner tile: pgModelDistributionrPayeeDetailsTiledView
    Yes, Matt's mail helped me in resolving the first problem (submitting
    the form on href click).
    I have replaced the href from
    <a
    href="../Participant/pgModelDistribution?pgModelDistribution.linkNetDistribu
    tion=&pageAttributes=">
    $1,000 </a>
    to
    $1,000
    and added a new javascript method as below:
    function netDistFunc()
    val = document.forms[0].elements["pageAttributes"].value;
    _url =
    "../Participant/pgModelDistribution?pgModelDistribution.linkNetDistribution=
    &pageAttributes="+val;
    >
    document.forms[0].method = "post";
    document.forms[0].action = _url;
    document.forms[0].submit();
    return false;
    Now, I'm able to get the data entered by the user.
    Thanks
    Srinivas
    Message: 2
    Date: Wed, 18 Jul 2001 04:03:51 -0600
    From: "Todd Fast" <toddwork@c...>
    Subject: Re: Digest Number 157
    Srinivas--
    From where are you calling these methods, what event? Maybe you shouldsend
    me the code for your nested tiled views--that's probably the easiest way
    for
    me to understand what's happening. Also, were any of Matt's
    suppositions
    correct?
    Todd
    The Information contained and transmitted by this E-MAIL is proprietary to
    Wipro Limited and is intended for use only by the individual or entity towhich
    it is addressed, and may contain information that is privileged,confidential or
    exempt from disclosure under applicable law. If this is a forwardedmessage,
    the content of this E-MAIL may not have been sent with the authority ofthe
    Company. If you are not the intended recipient, an agent of the intended
    recipient or a person responsible for delivering the information to thenamed
    recipient, you are notified that any use, distribution, transmission,printing,
    copying or dissemination of this information in any way or in any manneris
    strictly prohibited. If you have received this communication in error,please
    delete this mail & notify us immediately at mailadmin@w...
    [Non-text portions of this message have been removed]
    [email protected]

    Srinivas--
    Remember, attachments don't come through on the forum. Please send them to
    the jatoteam@e... alias.
    Todd
    ----- Original Message -----
    From: "Srinivas Chikkam" <srinivas.chikkam@w...>
    Sent: Thursday, July 19, 2001 5:26 AM
    Subject: [iPlanet-JATO] Re: Href click & tiled view display
    Todd,
    I'm calling resetTileIndex() in the begin display of the tiled views.
    I'm attaching the code with this mail.
    Outer tile: pgModelDistributionrMultiplePayeesTiledView
    inner tile: pgModelDistributionrPayeeDetailsTiledView
    Yes, Matt's mail helped me in resolving the first problem (submitting
    the form on href click).
    I have replaced the href from
    <a
    href="../Participant/pgModelDistribution?pgModelDistribution.linkNetDistribu
    tion=&pageAttributes=">
    $1,000 </a>
    to
    $1,000
    and added a new javascript method as below:
    function netDistFunc()
    val = document.forms[0].elements["pageAttributes"].value;
    _url =
    "../Participant/pgModelDistribution?pgModelDistribution.linkNetDistribution=
    &pageAttributes="+val;
    >
    document.forms[0].method = "post";
    document.forms[0].action = _url;
    document.forms[0].submit();
    return false;
    Now, I'm able to get the data entered by the user.
    Thanks
    Srinivas
    Message: 2
    Date: Wed, 18 Jul 2001 04:03:51 -0600
    From: "Todd Fast" <toddwork@c...>
    Subject: Re: Digest Number 157
    Srinivas--
    From where are you calling these methods, what event? Maybe you shouldsend
    me the code for your nested tiled views--that's probably the easiest way
    for
    me to understand what's happening. Also, were any of Matt's
    suppositions
    correct?
    Todd
    The Information contained and transmitted by this E-MAIL is proprietary to
    Wipro Limited and is intended for use only by the individual or entity towhich
    it is addressed, and may contain information that is privileged,confidential or
    exempt from disclosure under applicable law. If this is a forwardedmessage,
    the content of this E-MAIL may not have been sent with the authority ofthe
    Company. If you are not the intended recipient, an agent of the intended
    recipient or a person responsible for delivering the information to thenamed
    recipient, you are notified that any use, distribution, transmission,printing,
    copying or dissemination of this information in any way or in any manneris
    strictly prohibited. If you have received this communication in error,please
    delete this mail & notify us immediately at mailadmin@w...
    [Non-text portions of this message have been removed]
    [email protected]

  • Re: [iPlanet-JATO] Re: using begin childName Display method

    Steve,
    It sounds like you have your display fields in a container view, and
    that container view is inside of a view bean. I haven't tested whether
    the fireChildDisplayEvents has a "deep" effect on its container view
    children. Meaning that you may have to set fireChildDisplayEvents="true"
    for the <jato:containerView> tag instead. If all else fails and you need
    to just get it working, you can set the fireDisplayEvents="true" for
    each display field tag separately.
    craig
    stephen_winer wrote:
    I should clarify my earlier statement. The data I want to display is
    coming from a model (tied in in the createChild method). I want to
    conditionally reformat the text that is being substituted in the JSP
    for a JATO form element, but I want this to happen on the server, not
    with JavaScript. The begin<childName>Display and
    end<childName>Display methods allow me to do this, in theory, but I
    can not get them to execute.
    Steve
    --- In iPlanet-JATO@y..., Belinda Garcia <belinda.garcia@s...> wrote:
    I don't currently use a begin or end Display method. I merely bind
    the fields to
    the model when the child is created and use the setValue to
    initially set the
    value to what's in the model. I get nulls though if I try to use a
    tiled View. I
    haven't quite got this figured out.
    Belinda
    X-eGroups-Return:
    sentto-2343287-1135-1008613974-belinda.garcia=sun.com@r...
    X-Sender: stephen_winer@y...
    User-Agent: eGroups-EW/0.82
    From: "stephen_winer" <stephen_winer@y...>
    X-Originating-IP: 155.188.191.4
    X-Yahoo-Profile: stephen_winer
    Mailing-List: list iPlanet-JATO@y...; contact
    iPlanet-JATO-owner@y...
    Date: Mon, 17 Dec 2001 18:32:48 -0000
    Subject: [iPlanet-JATO] using begin<childName>Display method
    Content-Transfer-Encoding: 7bit
    I want to be able to conditionally show/hide data as well as
    format
    it for display without touching the model. I found the
    begin<childName>Display and end<childName>Display methods that
    provide the hooks to do this, but I have been unsuccessful in
    getting
    these method to execute. I added the
    fireChildDisplayEvents="true"
    attribute to the jato:useViewBean tag, but this has not helped.
    I
    also added some debug to the ContainerViewBase class in the
    public
    boolean beginChildDisplay(ChildDisplayEvent event) method to see
    what
    was happening. The displayMethodMap was returning null for the
    child
    display methods that were in the view bean. I covered all the
    bases
    (compiling, redeploying, etc.) and nothing has worked. Is there
    anything I am missing or is there some working example of this?
    Steve
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    >For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

    The hidden field was present in the page, but it looked like this:
    <input type="hidden" name="jato.defaultCommand" value=""../search"">
    Seems like there is a small bug in the code generating this tag.
    FYI - I am using JATO1.2
    What file displays this text? Maybe I can go in and fix it and rejar
    it.
    Steve
    --- Mike Frisino wrote:
    Steve,
    Can you check the HTML source that shows up in the browser? Do you see an entry that looks like this at the bottom of the form in
    question?
    >
    <input type="hidden" name="jato.defaultCommand" value="/search">
    To answer your question - it should work as you described. Some of the JatoSample make use of the defaultCommandChild. Can you try
    running the sample BasicSample->Field Types and let us know what you
    see.
    >
    Failing this you can send me your jsp file , maybe there is some subtle issue there. michael.frisino@s...
    >
    >
    ----- Original Message -----
    From: stephen_winer
    Sent: Friday, December 07, 2001 8:05 AM
    Subject: [iPlanet-JATO] Using the defaultCommandChild in a form
    I am trying to set the defaultCommandChild in my jato:form tag to be
    the searcg button. The search button definition is:
    <jato:button name="search"/>.
    The form tag definition is:
    <jato:form name="PendingIA" defaultCommandChild="/search">
    Clicking on the search button works fine, but hitting return in one
    of the textFields (which submits the form) passes a value of "" to
    the createChild method in my viewBean, which throws an error. Why
    does this not just work as normal and trigger the handleSearchRequest
    () method?
    Steve
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    Service.
    >
    >
    >
    [Non-text portions of this message have been removed]

  • Dynamic Tiled View display question

    Hi,
    I?ve been working with JATO during this month, i find
    the framework very flexible but a bit complex to
    undertand.
    Currently i?m triying to make the following test, but
    i?m in a dead point.
    I must create a page that is composed by a form, the
    children views of this page that compound the form
    must be created on request time, this is because the
    displayfields that i must include are included on one
    atribute that is included in te request made for the
    page that contains the form. Additionally the HTML
    representation of each attribute can change from
    attribute to attribute (It depends on the type of
    attribute that i want to display). I found that
    Pagelets can be helpful to decide in request-time the
    HTML element to be included. I?m having some trouble
    (a conceptual one) in triying to integrate a TiledView
    that iterates over an element that can change its
    appearance base on the type specified in its own
    model.
    Someone o you guys faced these problem before, its
    possible to have this kind of dynamic features?
    Thanks in advance,
    Javier Camacho
    Developer

    OK, I understand your task, and I follow your solution up to the details
    of the custom pagelet, but everything sounds correct.
    What exactly are you confused about with the beginDisplay event?
    c
    jav_camacho wrote:
    Thanks for your interest Craig, i will make some clarifications in
    order to give you some answers:
    The context of my problem is:
    I want to display in a page some Custom Objects relative to my domain
    problem, to make it simple lets call these objects MyObjects,
    A class MyObject contains 2 variables: "label" and "question_mode".
    Depending on the value of "question_mode" (an integer) i must display
    in the response page some type of HTML element or another, lets say:
    question_mode = 1 -> TextFiled
    question_mode = 2 -> ComboBox
    question_mode = 3 -> ListBox
    But i have another constraint to my problem: the set of MyObjects (the
    instances of MyObject) is determined at request time, so i have to
    check in the RequestContext for a value, then that value is used to
    search in my MetaData to define the set of MyObjects that i must
    display.
    To put an example:
    If the value of my attribute is 1 i must display a set of 5 MyObjects,
    and each one with its own "question_mode". So the response page to be
    generated for the client its entirely dynamic, no only by the number
    of MyObjects to be displayed, the HTML representation for the variable
    "question_mode" is decided in request-time too.
    Well, to address these interesting question i thinked (inspired by
    yoour excellent Sample App) in the following general strategy:
    1. I created a Custom Tag for the display MyObjects, the jsp looks
    like these:
    <jato:useViewBean className="testapp.module1.phase1ViewBean">
    <BODY>
    <TABLE>
    <TR>
    <TD ALIGN=left><B>MyObjects:</B></TD>
    </TR>
    <jato:tiledView name="TiledView1"
    type="testapp.module1.MyObjectTiledView">
    <testapp:myObject fireDisplayEvents="true"/>
    </jato:tiledView>
    </TABLE>
    </BODY>
    </jato:useViewBean>
    2. To display these fields i made the class MyObjectTiledView, this
    class only contains one View (an instance of
    StylizedMyObjectView.class).
    StylizedMyObjectView.class is the peer of the <testapp:myObject> tag.
    This class implements the interface PageletView so it can be
    questioned about the Pagelet to be included in the page
    (StylizedMyObjectView choose the pagelet based on the question_mode
    variable present in the Model: MyObject class).
    But i?m a bit confused in the way that MyObjectTiledView can interact
    with the StylizedMyObjectView.class. (i?m triying to figure the
    implementation of the beginDisplay() method).
    I hope this could clarify your questions.
    Is this strategy correct?. I?m a bit lost in the secuence of calls to
    address this kind of dynamic page generation.
    I will apreciate any help or experience in related problems.
    Javier
    Javier,
    I am not clear exactly what your are attempting to do. I think you
    maybe
    using some terminology out of place, or maybe I am just not
    understanding, so I will ask these questions:
    1) You are using a TiledView. Are the number of fields in the tiled
    view
    dynamic? I am understanding that they are.
    2) These fields are of an unknown type at design time. For one
    request a
    field might be a text box, next request it might be a list box. Is
    this
    correct?
    3) When you talk about attributes, are you talking about the
    attributes
    of the tags (name, type, value, label, etc.)? This is not clear to
    me in
    the way that your are describing in this phrase:
    "HTML representation of each attribute can change from attribute to
    attribute"
    4) When you say "type specified in its own model", what do you mean
    by
    model? A JATO Model class, or a more generic use of the term model?
    5) When you say "displayfields that i must include are included on
    one atribute that is included in te request", how exactly are the
    fiels specified in the attribute, and again, what is your definition
    of "attribute" here? I assume you mean request attibute.
    craig
    Javier Camacho wrote:
    Hi,
    I?ve been working with JATO during this month, i find
    the framework very flexible but a bit complex to
    undertand.
    Currently i?m triying to make the following test, but
    i?m in a dead point.
    I must create a page that is composed by a form, the
    children views of this page that compound the form
    must be created on request time, this is because the
    displayfields that i must include are included on one
    atribute that is included in te request made for the
    page that contains the form. Additionally the HTML
    representation of each attribute can change from
    attribute to attribute (It depends on the type of
    attribute that i want to display). I found that
    Pagelets can be helpful to decide in request-time the
    HTML element to be included. I?m having some trouble
    (a conceptual one) in triying to integrate a TiledView
    that iterates over an element that can change its
    appearance
    base on the type specified in its own
    model.
    Someone o you guys faced these problem before, its
    possible to have this kind of dynamic features?
    Thanks in advance,
    Javier Camacho
    Developer
    For more information about JATO, including download information,
    please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    >For more information about JATO, including download information, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

  • Re: [iPlanet-JATO] How to skip the display of a row in a TiledView ?

    Syam--
    I am having problems in skiping the display of a row in a Tiled
    view. I have a customer search results page. Each customer has an
    associated type.While displaying the search results, I should skip the
    customer record from display, if the associated type falls in certain
    categories.
    What I want to tell is, the comment(saying this is equivalent of
    repeated_onbeforerowdisplayevent) and placement of the
    onbeforerowdisplayevent handler(NetD) code in nextTile() method is
    confusing.Agreed. We used to have a seperate row display event, but removed it
    because it was extraneous.
    I did not find an equivalent way of doing this in JATO ? Can
    someone tell me how to do this?There are a couple of options. First, you could write a scriptlet in your
    JSP inside the tiled view tag that would check the status of the row and
    just skip the HTML output for that row if it matched your criterion. The
    other possibility is to override the nextTile() method to do an additional
    super.nextTile() call if the row isn't to be displayed. For example,
    something like this:
    public boolean nextTile()
    boolean result=super.nextTile();
    if (result && isHiddenRow())
    // Skip an extra row
    result=super.nextTile();
    return result;
    Todd

    i have the following code here in the renderer n while setting the value in the table how do i pass the value n in the renderer i only have the indexes of the row n col how to check for the value thats not in the table i have commented the code where ever required... kindly help me out with this problem
    <Code>
    private JTable table = new JTable(){
         public Component prepareRenderer(TableCellRenderer renderer, int rowIndex, int vColIndex) {
              Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
              if (!isCellSelected(rowIndex, vColIndex)) {//What else should i put in here to check the value
                   c.setBackground(Color.yellow);
              else {
                   c.setBackground(getBackground());
              return c;
    StringBuffer sql = new StringBuffer("Select * from table)
    int row = 0;
    table.setRowCount(row);          
    try {
    ResultSet rs = //execute SQL
    while (rs.next()) {
         table.setRowCount(row + 1);
         table.setValueAt(rs.getString(1), row, 0);
         //This is where i have to change the color
         if(rs.getString("ColumnName").equals("Something")){
              //Change the color of the current row
         row++;
    rs.close();
    catch (SQLException e) {
    </Code>

  • Re: [iPlanet-JATO] onBeforeRequest(); Finding requested view from requestContext

    The problem is that you don't know what the target view is until it has
    been forwarded to.
    Think about it... the request handling view bean (or command object) has
    the request handler that has the code that will ultimately forward to
    another view bean. This is code that you have written. So, until that
    forwardTo() is invoked, there is no notion of a "target page".
    What you do know is which "page" (view bean) the request is coming from
    (the handling view bean or command class). You can get this from the
    HttpServletRequest. The attribute name is "viewBean".
    So you can get the view bean name by doing the following in onBeforeRequest:
    <HttpServletRequest>.getAttribute("viewBean");
    But I suspect this is not going to solve your current issue.
    You could add the target page name to the page session. If there is more
    than one possible target page, it might get a little more involved.
    Let me know if the use of page session needs further explanation.
    c
    nickmalthus wrote:
    I am implementing a custom security model since the standard J2EE
    security model does not allow me access to the users password, which I
    need to log into a third party application. I have overriden the
    onBeforeRequest() method to check to see if the user is logged in, and
    if not, forward to the Login ViewBean. However, I need to determine
    what page/viewbean the request is attempting to access so I can let it
    pass through if it is accessing the Login viewbean and to forward to
    the requested view once the user is logged in. What is the best way to
    do this? I see no obvious uitility in the javadocs
    TIA
    For more information about JATO, including download information, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

    I guess what I am thinking about doing is capturing the requested URL,
    i.e. /appname/modulename/RequestName. In the onBeforeRequest(). I
    would then check to see if the user is logged in, and if not, set the
    URL in the session(or page session of the Login bean) and forward to
    the Login viewbean using the viewbean manager. Inside the login view
    in the handleSubmit() method I would authenticate the user and then
    get the URL out of the session (or pagesession). I would then
    magically get the ViewBean/Command object for the URL or otherwise
    "forward the request" as if the user had typed in
    /appname/modulename/RequestName, which is the behavior I am trying to
    acheive.
    It turns out I cannot forward in the onBeforeRequest() as it will
    output the viewbean and then continue to process the request which in
    turn trys to do a RequestDispatcher().forward after data has been
    written to the stream which does not bode well with the servlet
    container. Thus, it appears I have no control of the request in the
    onBeforeRequest() method. Is this correct?
    In light of this new observation I am now going to create a base view
    class that all views will extend from and override the
    onSecurityCheck() method to forward to my login bean. If I can't find
    any other way, I will get the URL from the page session and do a
    response.sendRedirect() to the URL.
    Thanks for the help!
    --- In iPlanet-JATO@y..., "Craig V. Conover" <craig.conover@s...> wrote:
    The problem is that you don't know what the target view is until it has
    been forwarded to.
    Think about it... the request handling view bean (or command object)has
    the request handler that has the code that will ultimately forward to
    another view bean. This is code that you have written. So, until that
    forwardTo() is invoked, there is no notion of a "target page".
    What you do know is which "page" (view bean) the request is coming from
    (the handling view bean or command class). You can get this from the
    HttpServletRequest. The attribute name is "viewBean".
    So you can get the view bean name by doing the following inonBeforeRequest:
    >
    <HttpServletRequest>.getAttribute("viewBean");
    But I suspect this is not going to solve your current issue.
    You could add the target page name to the page session. If there ismore
    than one possible target page, it might get a little more involved.
    Let me know if the use of page session needs further explanation.
    c

  • Re: [iPlanet-JATO] Re: Retrieving all Values from a Tiled View

    Todd,
    Let me try to explain you this time. I have a text field in a TiledViewBean.
    When I display the page, the text field
    html tag is created with the name="PageDetail.rDetail[0].tbFieldName" say
    five times/rows with same name.
    The html tags look like this.
    <input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
    maxlength=9 size=13>
    <input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
    maxlength=9 size=13>
    <input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
    maxlength=9 size=13>
    When the form is submitted, I want to get the text field values using the
    method getTbFieldName().getValues() which
    returns an array object[]. This is in case where my TiledViewBean is not
    bound and it is working fine.
    Now in case when my TiledView is bound to a model, it creates the html tags
    as follows.
    <input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
    maxlength=9 size=13>
    <input type=text name="PageDetail.rDetail[1].tbFieldName" value=""
    maxlength=9 size=13>
    <input type=text name="PageDetail.rDetail[2].tbFieldName" value=""
    maxlength=9 size=13>
    Now when I say getTbFieldName().getValues() it returns only the first
    element values in the object[] and the rest of the
    values are null.
    May be we need to create a utility method do get these values from
    requestContext.
    raju.
    ----- Original Message -----
    From: Todd Fast <toddwork@c...>
    Sent: Saturday, July 07, 2001 3:52 AM
    Subject: Re: [iPlanet-JATO] Re: Retrieving all Values from a Tiled View
    Raju.--
    I wanted to know how the getValues() method works the reason being,
    when the tiled view is NOT bound to a model, it populates all the
    fields with the same name as some thing likeI'm afraid I don't understand your point--can you please clarify? Do you
    mean "value" instead of "name"?
    What are you trying to do? What behavior are you expecting but notseeing?
    >
    Without further clarification, I can say that the setValues() methodsNEVER
    populates data on multiple rows of a (dataset) model, nor does it affect
    multiple fields on the same row. Perhaps what you are seeing is theeffect
    of default values. Model that derive from DefaulModel have the ability to
    carry forward the values set on the first row to other rows in lieu ofdata
    in those other rows. This behavior is for pure convenience and can be
    turned off, and it is turned off for the SQL-based models.
    Todd
    [email protected]

    Hi,
    I wanted to know how the getValues() method works the reason being,
    when the tiled view is NOT bound to a model, it populates all the
    fields with the same name as some thing like
    PageDetail.rDetail[0].tbFieldValue
    PageDetail.rDetail[0].tbFieldValue
    in which case, the getValues() method works fine.
    But in case where the tiled view is bound to a model, it populates
    with different field names such as,
    PageDetail.rDetail[0].tbFieldValue
    PageDetail.rDetail[1].tbFieldValue
    in this case, the getValues() doesn't work. Any soultion to this?
    We are using Moko 1.1.1.
    thanks in advance,
    raju.
    --- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
    Does anyone know of is there a single method to get all values of a
    display
    field in a tiled view without having to iterate through all the
    values ie
    resetTileIndex() / nextTile() approach.
    ie Something that returns an Object[] or Vector just like ND returned a
    CspVector. I tried using the getValues() methods but that allways returns
    a
    single element array containing the first element.
    (I think now, that method is used for multi selecteable ListBoxes)Actually, no. We can add this in the next patch, but for now, I'd recommend
    creating a simple utility method to do the iteration on an arbitrary model
    and build the list for you.
    Todd

  • Re: [iPlanet-JATO] Retrieving all Values from a Tiled View

    Does anyone know of is there a single method to get all values of adisplay
    field in a tiled view without having to iterate through all the values ie
    resetTileIndex() / nextTile() approach.
    ie Something that returns an Object[] or Vector just like ND returned a
    CspVector. I tried using the getValues() methods but that allways returnsa
    single element array containing the first element.
    (I think now, that method is used for multi selecteable ListBoxes)Actually, no. We can add this in the next patch, but for now, I'd recommend
    creating a simple utility method to do the iteration on an arbitrary model
    and build the list for you.
    Todd

    Hi,
    I wanted to know how the getValues() method works the reason being,
    when the tiled view is NOT bound to a model, it populates all the
    fields with the same name as some thing like
    PageDetail.rDetail[0].tbFieldValue
    PageDetail.rDetail[0].tbFieldValue
    in which case, the getValues() method works fine.
    But in case where the tiled view is bound to a model, it populates
    with different field names such as,
    PageDetail.rDetail[0].tbFieldValue
    PageDetail.rDetail[1].tbFieldValue
    in this case, the getValues() doesn't work. Any soultion to this?
    We are using Moko 1.1.1.
    thanks in advance,
    raju.
    --- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
    Does anyone know of is there a single method to get all values of a
    display
    field in a tiled view without having to iterate through all the
    values ie
    resetTileIndex() / nextTile() approach.
    ie Something that returns an Object[] or Vector just like ND returned a
    CspVector. I tried using the getValues() methods but that allways returns
    a
    single element array containing the first element.
    (I think now, that method is used for multi selecteable ListBoxes)Actually, no. We can add this in the next patch, but for now, I'd recommend
    creating a simple utility method to do the iteration on an arbitrary model
    and build the list for you.
    Todd

  • Re: [SunONE-JATO] Re: How to use a tiled view without a model

    I'm not sure what is different for you now. You still parse the string
    and put it into a data structure. Before the data structure was a
    vector, in JATO its just a model with a "hidden" data structure (a hash
    map).
    MVC only really comes into play when you talk about where your write
    this code, and where the data structure is being stored. So really, JATO
    takes care of half of the MVC'ness of it all (where the data is store).
    You just decide where to be the code to populate the model.
    Make sense?
    Is there something different required of you in JATO in this scenario
    that I am not grasping?
    c
    Hoskins, John D. wrote:
    Thanks for the feedback.
    The problem I was solving involved a single string, which contained
    delimited subsets of information.
    The string looked like
    this:"time|analyst|description|time|analyst|description|..."
    In ND, I parsed it apart into it's components (time vector, analyst vector,
    description vector), populated the repeated.
    With JATO, how would I make a model for something that doesn't have a
    database component like this?
    I'm pretty new to this MVC thing, so bear with me.
    John D. Hoskins
    Telephone & Data Systems
    Application Development & Support
    Voice: 608.664.8263
    Fax: 608.664.8288
    Email: john.hoskins@t...
    -----Original Message-----
    From: Craig V. Conover [mailto:<a href="/group/SunONE-JATO/post?protectID=219212113009229091025149066024064239039098031198039130252055210">craig.conover@s...</a>]
    Sent: 6/26/2002 3.22 PM
    Subject: Re: [SunONE-JATO] Re: How to use a tiled view without a model
    I guess the only thing "weird" (for lack of a better term) about what
    you are doing is that your are populating the model on the "display
    cycle". Typically, the cycle goes like this:
    Request -> populate model -> update data store -> retrieve data to
    populate model -> display data
    some of the above steps are optional but hopefully you get the point I
    am making.
    So what you are doing is:
    Request -> populate model/display data
    If it works for you, then it's not necessarilly wrong. But I would
    probably have my model populated before I forwarded to the target
    (displaying view bean) or at a minimum, in the begin display event of
    the view bean or the tiled view, but not during the iteration of the
    tiled view.
    c
    jhoskins wrote:
    Craig,
    Thanks for the pointers. I ended up doing something else. I set the
    models setSize() method to set the max size, and as the tiles fields
    iterated, populated the value from some vectors I had the data in
    already. Is this solution fraught with peril and will ultimately fail,
    or should I try your way?
    John
    --- Craig V. Conover wrote:
    John,
    Check out the docs for DefaultModel. There is an appendRow() method.
    So get your tiledview's primary model (the tiledview's primary model
    should be set to use an instance of DefaultModel), model.appendRow(),
    then model.setValue("fieldname", value) for each value.
    Rinse, repeat as needed.
    c
    jhoskins wrote:
    I would like to use a tiled view, but populate the fields manually.
    Any pointers about where I can set the size of the tiled view? I tried
    setMaxDisplayTiles() in the beginDisplay, but it won't get down and
    generate the rows.
    John Hoskins
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

    Craig,
    Thanks for the pointers. I ended up doing something else. I set the
    models setSize() method to set the max size, and as the tiles fields
    iterated, populated the value from some vectors I had the data in
    already. Is this solution fraught with peril and will ultimately fail,
    or should I try your way?
    John
    --- "Craig V. Conover" wrote:
    John,
    Check out the docs for DefaultModel. There is an appendRow() method.
    So get your tiledview's primary model (the tiledview's primary model
    should be set to use an instance of DefaultModel), model.appendRow(),
    then model.setValue("fieldname", value) for each value.
    Rinse, repeat as needed.
    c
    jhoskins wrote:
    I would like to use a tiled view, but populate the fields manually.
    Any pointers about where I can set the size of the tiled view? I tried
    setMaxDisplayTiles() in the beginDisplay, but it won't get down and
    generate the rows.
    John Hoskins
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

  • RE: [iPlanet-JATO] TileView not being displayed

    Craig.you are quite the JATO expert now!
    cb
    -----Original Message-----
    From: Craig V Conover [mailto:<a href="/group/SunONE-JATO/post?protectID=219212113009229091025149066024064239039098124198039130151196028">craig.conover@S...</a>]
    Sent: Tuesday, April 17, 2001 8:11 PM
    Subject: Re: [iPlanet-JATO] TileView not being displayed
    I had this issue a while ago and forget the exact solution Todd gave me, so
    I'll take a guess untill I can find it somewhere or untill Todd or Mike get
    back online to verify.
    Set the size of the model. I know your TiledView is not bound, but actually
    it is - to the DefaultModel.
    Try this:
    getDefaultModel().setSize(1)
    getPrimaryModel() should work as well.
    let me know if that works or not
    If I find my example, I'll repost.
    c
    ----- Original Message -----
    From: MShanmugam@c...
    Sent: Tuesday, April 17, 2001 7:38 PM
    Subject: [iPlanet-JATO] TileView not being displayed
    Hi All,
    I have a TileView which is not bound to any models.
    It should display one row however none are being displayed. Following
    is the constructor as a reference.
    public pgVoucherListrptCheckInfoTiledView(View parent, String name)
    super(parent, name);
    setMaxDisplayTiles(1);
    setPrimaryModel((DatasetModel) getDefaultModel() );
    registerChildren();
    initialize();
    The problem in the nextTile() method, the super.nextTile allways
    returns false. This seems to be because the
    TiledViewBase.getPrimaryModel().next() allways returns false.
    All the bound tiled views work fine.
    Any help will be appreciated .
    Thanks
    [email protected]
    [email protected]
    [Non-text portions of this message have been removed]

    Craig.you are quite the JATO expert now!
    cb
    -----Original Message-----
    From: Craig V Conover [mailto:<a href="/group/SunONE-JATO/post?protectID=219212113009229091025149066024064239039098124198039130151196028">craig.conover@S...</a>]
    Sent: Tuesday, April 17, 2001 8:11 PM
    Subject: Re: [iPlanet-JATO] TileView not being displayed
    I had this issue a while ago and forget the exact solution Todd gave me, so
    I'll take a guess untill I can find it somewhere or untill Todd or Mike get
    back online to verify.
    Set the size of the model. I know your TiledView is not bound, but actually
    it is - to the DefaultModel.
    Try this:
    getDefaultModel().setSize(1)
    getPrimaryModel() should work as well.
    let me know if that works or not
    If I find my example, I'll repost.
    c
    ----- Original Message -----
    From: MShanmugam@c...
    Sent: Tuesday, April 17, 2001 7:38 PM
    Subject: [iPlanet-JATO] TileView not being displayed
    Hi All,
    I have a TileView which is not bound to any models.
    It should display one row however none are being displayed. Following
    is the constructor as a reference.
    public pgVoucherListrptCheckInfoTiledView(View parent, String name)
    super(parent, name);
    setMaxDisplayTiles(1);
    setPrimaryModel((DatasetModel) getDefaultModel() );
    registerChildren();
    initialize();
    The problem in the nextTile() method, the super.nextTile allways
    returns false. This seems to be because the
    TiledViewBase.getPrimaryModel().next() allways returns false.
    All the bound tiled views work fine.
    Any help will be appreciated .
    Thanks
    [email protected]
    [email protected]
    [Non-text portions of this message have been removed]

  • Re: [iPlanet-JATO] using begin childName Display method

    Oops. Sorry about that, Craig. I didn't realize I might leave that impression.
    I'm sure the tiled
    views work since you have so many examples of these and it's a relatively
    simple concept, isn't it?
    Not to mention a necessary one. I didn't have time to debug my code and find
    out what I was doing
    wrong where the tiled views are concerned. I decide to just try to implement
    tiled views later and
    just stick with one of everything for now and get that working.
    Yes, I have reviewed your comments and am taking them into consideration. I am
    able to save and
    retrieve values with my model at this point.
    Thanks.
    Belinda
    X-eGroups-Return:
    sentto-2343287-1143-1008622698-belinda.garcia=sun.com@r...
    X-Sender: craig.conover@s...
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4)Gecko/20011019 Netscape6/6.2
    X-Accept-Language: en-us
    From: "Craig V. Conover" <craig.conover@s...>
    X-Yahoo-Profile: cvconover
    Mailing-List: list [email protected]; contact
    [email protected]
    Date: Mon, 17 Dec 2001 13:00:10 -0800
    Subject: Re: [iPlanet-JATO] using begin<childName>Display method
    Content-Transfer-Encoding: 7bit
    Belinda,
    He may also be binding the models, howerver, he needs to change the way
    the value appears before it is displayed which is why you would use the
    display events.
    Your null value issue is a completely different issue and has nothing to
    do with it being a tiled view. I don't want anyone getting the idea
    that the tiledView binding is broken. It does work. You issue should
    have something to do with the inconsistent way in which you are getting
    your model. At least from what I could tell in your source code that you
    sent me.
    Have you reviewed my comments I sent to you in your source code?
    craig
    Belinda Garcia wrote:
    I don't currently use a begin or end Display method. I merely bind the
    fields to
    the model when the child is created and use the setValue to initially setthe
    value to what's in the model. I get nulls though if I try to use a tiledView. I
    haven't quite got this figured out.
    Belinda
    X-eGroups-Return:
    sentto-2343287-1135-1008613974-belinda.garcia=sun.com@r...
    X-Sender: stephen_winer@y...
    User-Agent: eGroups-EW/0.82
    From: "stephen_winer" <stephen_winer@y...>
    X-Originating-IP: 155.188.191.4
    X-Yahoo-Profile: stephen_winer
    Mailing-List: list [email protected]; contact
    [email protected]
    Date: Mon, 17 Dec 2001 18:32:48 -0000
    Subject: [iPlanet-JATO] using begin<childName>Display method
    Content-Transfer-Encoding: 7bit
    I want to be able to conditionally show/hide data as well as format
    it for display without touching the model. I found the
    begin<childName>Display and end<childName>Display methods that
    provide the hooks to do this, but I have been unsuccessful in getting
    these method to execute. I added the fireChildDisplayEvents="true"
    attribute to the jato:useViewBean tag, but this has not helped. I
    also added some debug to the ContainerViewBase class in the public
    boolean beginChildDisplay(ChildDisplayEvent event) method to see what
    was happening. The displayMethodMap was returning null for the child
    display methods that were in the view bean. I covered all the bases
    (compiling, redeploying, etc.) and nothing has worked. Is there
    anything I am missing or is there some working example of this?
    Steve
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

    The hidden field was present in the page, but it looked like this:
    <input type="hidden" name="jato.defaultCommand" value=""../search"">
    Seems like there is a small bug in the code generating this tag.
    FYI - I am using JATO1.2
    What file displays this text? Maybe I can go in and fix it and rejar
    it.
    Steve
    --- Mike Frisino wrote:
    Steve,
    Can you check the HTML source that shows up in the browser? Do you see an entry that looks like this at the bottom of the form in
    question?
    >
    <input type="hidden" name="jato.defaultCommand" value="/search">
    To answer your question - it should work as you described. Some of the JatoSample make use of the defaultCommandChild. Can you try
    running the sample BasicSample->Field Types and let us know what you
    see.
    >
    Failing this you can send me your jsp file , maybe there is some subtle issue there. michael.frisino@s...
    >
    >
    ----- Original Message -----
    From: stephen_winer
    Sent: Friday, December 07, 2001 8:05 AM
    Subject: [iPlanet-JATO] Using the defaultCommandChild in a form
    I am trying to set the defaultCommandChild in my jato:form tag to be
    the searcg button. The search button definition is:
    <jato:button name="search"/>.
    The form tag definition is:
    <jato:form name="PendingIA" defaultCommandChild="/search">
    Clicking on the search button works fine, but hitting return in one
    of the textFields (which submits the form) passes a value of "" to
    the createChild method in my viewBean, which throws an error. Why
    does this not just work as normal and trigger the handleSearchRequest
    () method?
    Steve
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    Service.
    >
    >
    >
    [Non-text portions of this message have been removed]

  • Re: [iPlanet-JATO] JATO 1.1 - First Tile is not displayed in TiledView.

    Hi Shyam--
    I'm not seeing this over here. So, we need to figure out why you're seeing
    it--I need some more information.
    First, what model are you using to back the tiled view? Second, can you
    please forward the page and tiled view Java classes and JSPs to my work
    address? At what point are you writing the getTileIndex() value out--during
    display, business processing, what?
    Also, try putting a stack trace in the nextTile() method of the tiled view
    to see if its being incremented from somewhere you don't expect:
    public boolean nextTile()
    if (getTileIndex()==0)
    new Exception().printStackTrace();
    Todd
    Todd Fast
    Senior Engineer
    Sun/Netscape Alliance
    todd.fast@e...
    ----- Original Message -----
    From: <shyam_gotur@p...>
    Sent: Saturday, March 03, 2001 2:40 PM
    Subject: [iPlanet-JATO] JATO 1.1 - First Tile is not displayed in TiledView.
    Hi
    We migrated our application from JATO 1.0 to JATO 1.1,
    with 1.1 the nextTile() method is skipping the first tile in
    tiledView.when printed the getTileIndex() to console , it is starting
    with index 1 instead of 0.
    Thanks
    Shyam
    [email protected]

    Hi Shyam--
    I'm not seeing this over here. So, we need to figure out why you're seeing
    it--I need some more information.
    First, what model are you using to back the tiled view? Second, can you
    please forward the page and tiled view Java classes and JSPs to my work
    address? At what point are you writing the getTileIndex() value out--during
    display, business processing, what?
    Also, try putting a stack trace in the nextTile() method of the tiled view
    to see if its being incremented from somewhere you don't expect:
    public boolean nextTile()
    if (getTileIndex()==0)
    new Exception().printStackTrace();
    Todd
    Todd Fast
    Senior Engineer
    Sun/Netscape Alliance
    todd.fast@e...
    ----- Original Message -----
    From: <shyam_gotur@p...>
    Sent: Saturday, March 03, 2001 2:40 PM
    Subject: [iPlanet-JATO] JATO 1.1 - First Tile is not displayed in TiledView.
    Hi
    We migrated our application from JATO 1.0 to JATO 1.1,
    with 1.1 the nextTile() method is skipping the first tile in
    tiledView.when printed the getTileIndex() to console , it is starting
    with index 1 instead of 0.
    Thanks
    Shyam
    [email protected]

  • Re: [SunONE-JATO] How to use a tiled view without a model

    John,
    Check out the docs for DefaultModel. There is an appendRow() method.
    So get your tiledview's primary model (the tiledview's primary model
    should be set to use an instance of DefaultModel), model.appendRow(),
    then model.setValue("fieldname", value) for each value.
    Rinse, repeat as needed.
    c
    jhoskins wrote:
    I would like to use a tiled view, but populate the fields manually.
    Any pointers about where I can set the size of the tiled view? I tried
    setMaxDisplayTiles() in the beginDisplay, but it won't get down and
    generate the rows.
    John Hoskins
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

    Craig,
    Thanks for the pointers. I ended up doing something else. I set the
    models setSize() method to set the max size, and as the tiles fields
    iterated, populated the value from some vectors I had the data in
    already. Is this solution fraught with peril and will ultimately fail,
    or should I try your way?
    John
    --- "Craig V. Conover" wrote:
    John,
    Check out the docs for DefaultModel. There is an appendRow() method.
    So get your tiledview's primary model (the tiledview's primary model
    should be set to use an instance of DefaultModel), model.appendRow(),
    then model.setValue("fieldname", value) for each value.
    Rinse, repeat as needed.
    c
    jhoskins wrote:
    I would like to use a tiled view, but populate the fields manually.
    Any pointers about where I can set the size of the tiled view? I tried
    setMaxDisplayTiles() in the beginDisplay, but it won't get down and
    generate the rows.
    John Hoskins
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

  • Re: [iPlanet-JATO] Re: onBeforeRequest(); Finding requested view from requestContext

    If you want to stop a JATO request in its tracks, you have a little black
    magic at your disposal: you can throw a CompleteRequestException. This
    indicates to the JATO infrastructure that it should immeditately stop
    handling the request, but not generate an error, as the develper has taken
    full control. You can generally throw this error from anywhere, at any
    point--it is a RuntimeException, and is "tunneled" through other exception
    handlers where appropriate.
    In your scenario, you want to check if the user is logged in, and if not,
    save the target URL using the parsePathInfo() method. Then, forward to the
    login page and then throw a CompleteRequestException.
    Todd
    ----- Original Message -----
    From: "nickmalthus" <nickmalthus@h...>
    Sent: Monday, January 07, 2002 3:05 PM
    Subject: [iPlanet-JATO] Re: onBeforeRequest(); Finding requested view from
    requestContext
    I guess what I am thinking about doing is capturing the requested URL,
    i.e. /appname/modulename/RequestName. In the onBeforeRequest(). I
    would then check to see if the user is logged in, and if not, set the
    URL in the session(or page session of the Login bean) and forward to
    the Login viewbean using the viewbean manager. Inside the login view
    in the handleSubmit() method I would authenticate the user and then
    get the URL out of the session (or pagesession). I would then
    magically get the ViewBean/Command object for the URL or otherwise
    "forward the request" as if the user had typed in
    /appname/modulename/RequestName, which is the behavior I am trying to
    acheive.
    It turns out I cannot forward in the onBeforeRequest() as it will
    output the viewbean and then continue to process the request which in
    turn trys to do a RequestDispatcher().forward after data has been
    written to the stream which does not bode well with the servlet
    container. Thus, it appears I have no control of the request in the
    onBeforeRequest() method. Is this correct?
    In light of this new observation I am now going to create a base view
    class that all views will extend from and override the
    onSecurityCheck() method to forward to my login bean. If I can't find
    any other way, I will get the URL from the page session and do a
    response.sendRedirect() to the URL.
    Thanks for the help!
    --- In iPlanet-JATO@y..., "Craig V. Conover" <craig.conover@s...> wrote:
    The problem is that you don't know what the target view is until it has
    been forwarded to.
    Think about it... the request handling view bean (or command object)has
    the request handler that has the code that will ultimately forward to
    another view bean. This is code that you have written. So, until that
    forwardTo() is invoked, there is no notion of a "target page".
    What you do know is which "page" (view bean) the request is coming from
    (the handling view bean or command class). You can get this from the
    HttpServletRequest. The attribute name is "viewBean".
    So you can get the view bean name by doing the following inonBeforeRequest:
    <HttpServletRequest>.getAttribute("viewBean");
    But I suspect this is not going to solve your current issue.
    You could add the target page name to the page session. If there ismore
    than one possible target page, it might get a little more involved.
    Let me know if the use of page session needs further explanation.
    c
    For more information about JATO, including download information, pleasevisit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

    If you want to stop a JATO request in its tracks, you have a little black
    magic at your disposal: you can throw a CompleteRequestException. This
    indicates to the JATO infrastructure that it should immeditately stop
    handling the request, but not generate an error, as the develper has taken
    full control. You can generally throw this error from anywhere, at any
    point--it is a RuntimeException, and is "tunneled" through other exception
    handlers where appropriate.
    In your scenario, you want to check if the user is logged in, and if not,
    save the target URL using the parsePathInfo() method. Then, forward to the
    login page and then throw a CompleteRequestException.
    Todd
    ----- Original Message -----
    From: "nickmalthus" <nickmalthus@h...>
    Sent: Monday, January 07, 2002 3:05 PM
    Subject: [iPlanet-JATO] Re: onBeforeRequest(); Finding requested view from
    requestContext
    I guess what I am thinking about doing is capturing the requested URL,
    i.e. /appname/modulename/RequestName. In the onBeforeRequest(). I
    would then check to see if the user is logged in, and if not, set the
    URL in the session(or page session of the Login bean) and forward to
    the Login viewbean using the viewbean manager. Inside the login view
    in the handleSubmit() method I would authenticate the user and then
    get the URL out of the session (or pagesession). I would then
    magically get the ViewBean/Command object for the URL or otherwise
    "forward the request" as if the user had typed in
    /appname/modulename/RequestName, which is the behavior I am trying to
    acheive.
    It turns out I cannot forward in the onBeforeRequest() as it will
    output the viewbean and then continue to process the request which in
    turn trys to do a RequestDispatcher().forward after data has been
    written to the stream which does not bode well with the servlet
    container. Thus, it appears I have no control of the request in the
    onBeforeRequest() method. Is this correct?
    In light of this new observation I am now going to create a base view
    class that all views will extend from and override the
    onSecurityCheck() method to forward to my login bean. If I can't find
    any other way, I will get the URL from the page session and do a
    response.sendRedirect() to the URL.
    Thanks for the help!
    --- In iPlanet-JATO@y..., "Craig V. Conover" <craig.conover@s...> wrote:
    The problem is that you don't know what the target view is until it has
    been forwarded to.
    Think about it... the request handling view bean (or command object)has
    the request handler that has the code that will ultimately forward to
    another view bean. This is code that you have written. So, until that
    forwardTo() is invoked, there is no notion of a "target page".
    What you do know is which "page" (view bean) the request is coming from
    (the handling view bean or command class). You can get this from the
    HttpServletRequest. The attribute name is "viewBean".
    So you can get the view bean name by doing the following inonBeforeRequest:
    <HttpServletRequest>.getAttribute("viewBean");
    But I suspect this is not going to solve your current issue.
    You could add the target page name to the page session. If there ismore
    than one possible target page, it might get a little more involved.
    Let me know if the use of page session needs further explanation.
    c
    For more information about JATO, including download information, pleasevisit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

  • Re: [iPlanet-JATO] Submit Button in TiledView

    John,
    Please clarify,
    1. You are putting this page together manually? (writing your own JSP and
    ViewBean/TiledView classes?)
    2. What is the exact location of the button?
    Is it below the TiledView but still in the ViewBean (as the traditional
    First/Next/Prev/Last buttons are? )
    Or
    Is it literally within the tiled view itself (in a column, and the button
    is displayed repeatedly like any other row member?)
    I ask because the latter is a very rare situation, usually people use HREFs
    in such cases?
    ----- Original Message -----
    From: Craig V Conover <craig.conover@S...>
    Sent: Monday, January 22, 2001 10:21 AM
    Subject: Re: [iPlanet-JATO] Submit Button in TiledView
    Was this originally an ND project? I don't have the sample you need, butuntil someone else posts a sample, try this: if you have an ND5 Studio,
    mimic sample in ND and migrate it and see what is generated.
    ----- Original Message -----
    From: john.teceno@b...
    Sent: Monday, January 22, 2001 10:00 AM
    Subject: [iPlanet-JATO] Submit Button in TiledView
    Hey Guys,
    I have a submit button that appears in a TiledView. When I click
    the submit button, it loops back to the same page. Should I be
    delegating the event through the ViewBean to the TiledView? And if so,
    could you give me a code snippet to show me how?
    Thanx,
    John Teceno
    Back Bay Technologies
    eGroups Sponsor
    Get 3 CDs for ONLY $9.99!
    [email protected]
    [Non-text portions of this message have been removed]
    [email protected]

    John,
    Please clarify,
    1. You are putting this page together manually? (writing your own JSP and
    ViewBean/TiledView classes?)
    2. What is the exact location of the button?
    Is it below the TiledView but still in the ViewBean (as the traditional
    First/Next/Prev/Last buttons are? )
    Or
    Is it literally within the tiled view itself (in a column, and the button
    is displayed repeatedly like any other row member?)
    I ask because the latter is a very rare situation, usually people use HREFs
    in such cases?
    ----- Original Message -----
    From: Craig V Conover <craig.conover@S...>
    Sent: Monday, January 22, 2001 10:21 AM
    Subject: Re: [iPlanet-JATO] Submit Button in TiledView
    Was this originally an ND project? I don't have the sample you need, butuntil someone else posts a sample, try this: if you have an ND5 Studio,
    mimic sample in ND and migrate it and see what is generated.
    ----- Original Message -----
    From: john.teceno@b...
    Sent: Monday, January 22, 2001 10:00 AM
    Subject: [iPlanet-JATO] Submit Button in TiledView
    Hey Guys,
    I have a submit button that appears in a TiledView. When I click
    the submit button, it loops back to the same page. Should I be
    delegating the event through the ViewBean to the TiledView? And if so,
    could you give me a code snippet to show me how?
    Thanx,
    John Teceno
    Back Bay Technologies
    eGroups Sponsor
    Get 3 CDs for ONLY $9.99!
    [email protected]
    [Non-text portions of this message have been removed]
    [email protected]

Maybe you are looking for