You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sanjay Choudhary <ja...@yahoo.com> on 2002/03/19 00:41:33 UTC

Nested Tags - new be

Hi,

I am very new to Struts, jsp and html programming.

I kind of figured out how the nested tags works. 

In my application, I have Bean A which contains Array
list of type Bean B. Bean B has attributes B1 and B2.

We show user on the web page details of A and under
that all the elements of Bean B in a single row. User
is allowed to edit this. So far it works fine for me
using nested beans.

We have another feature on our page where in we allow
user to add n no. of rows on the page. Currently we
are adding rows using java script. IS THERE A
MACHANISM I CAN ADD THESE ROWS DYNAMICALLY USING
JAVASCRIPT AND THEN ADD THESE ADDED ROWS PHYSICALLY TO
THE ARRAYLIST INSTEAD OF MAKING A CALL TO THE SERVER
EVERYTIME I ADD ONE. In monkeybanana example author is
making call the server everytime the add button is
pressed. Or is there an ALTERNATIVE solution.

Thanks,
sanjay










__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Nested Tags - new be

Posted by Sanjay Choudhary <ja...@yahoo.com>.
Thanks Arron for your comments.

I have a group of prog. in my team who claim to know
javascript but none of them envisioned what you wrote.
None of them wish to use hidden frames. So only choice
left is to do the control over server side.

It did help me not to go the wrong way.

Regards

--- Arron Bates <ar...@keyboardmonkey.com> wrote:
> Sanjay,
> 
> I'm all for some client-side operation, but at some
> point the server has 
> to find out about it so that it knows how to manage
> your data model 
> properly. Forget the nesting tags, this problem will
> get you in whatever 
> your server side solution is. Once the Html is
> served, the server just 
> doesn't care until it gets the next request.
> 
> The nested tags just evaluate the model at JSP
> execution time, just like 
> any other tag, JSP or top-down servlet.
> 
> If you had to do it without a trip to the server,
> you will have to 
> gather all the details of the extra rows in some
> hidden form element, 
> and then process the details on the server when the
> user finally submits 
> the page. It's possible, but not fun. Not the least
> of which is the 
> client-side rendering of the page. If you're using
> IE5+ NS6+ you can 
> just do Html replacements easy enough. The ability
> is certainly there... 
> but approach with caution. It could quite easily
> become a nightmare.
> 
> For example, if a user is adding a whole heap of
> rows, they think that 
> the data is in there because it's on the screen as
> they typed it, and 
> simply types in another URL... all the data is lost,
> never to return. 
> Not even with the back button (because JavaScript
> objects and state are 
> not cached by the browser). Unless you can be
> certain that the page will 
> be posted to the server after filling out these new
> rows, I would steer 
> clear of it all together.
> 
> Another option is to have a page on a hidden frame
> send updates to the 
> server. Every time that something changes to the
> data on the screen, get 
> JavaScript to fire off the hidden frame with the
> update. Because you're 
> only wanting to send updates, there's no heavy Html
> having to be 
> generated by the server to be returned, maybe just a
> yes or no to tell 
> your JavaScript whether the server got any errors
> etc.
> 
> Whatever you do... it will change the way you have
> to code your web 
> interface, and increase your development time. How
> familiar are you with 
> JavaScript?... This aint no simple mouse-over. :)
> 
> 
> The monkey example uses the server-side management
> simply because a lot 
> of puritans out there simply refuse to regard
> anything with client-side 
> logic. And it's also 100% easier to do and manage.
> 
> 
> Arron
> 
> (MonkeyBanana Author :)
> 
> 
> Sanjay Choudhary wrote:
> 
> >Hi,
> >
> >I am very new to Struts, jsp and html programming.
> >
> >I kind of figured out how the nested tags works. 
> >
> >In my application, I have Bean A which contains
> Array
> >list of type Bean B. Bean B has attributes B1 and
> B2.
> >
> >We show user on the web page details of A and under
> >that all the elements of Bean B in a single row.
> User
> >is allowed to edit this. So far it works fine for
> me
> >using nested beans.
> >
> >We have another feature on our page where in we
> allow
> >user to add n no. of rows on the page. Currently we
> >are adding rows using java script. IS THERE A
> >MACHANISM I CAN ADD THESE ROWS DYNAMICALLY USING
> >JAVASCRIPT AND THEN ADD THESE ADDED ROWS PHYSICALLY
> TO
> >THE ARRAYLIST INSTEAD OF MAKING A CALL TO THE
> SERVER
> >EVERYTIME I ADD ONE. In monkeybanana example author
> is
> >making call the server everytime the add button is
> >pressed. Or is there an ALTERNATIVE solution.
> >
> >Thanks,
> >sanjay
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Yahoo! Sports - live college hoops coverage
> >http://sports.yahoo.com/
> >
> >--
> >To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> >For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Nested Tags - new be

Posted by Arron Bates <ar...@keyboardmonkey.com>.
Sanjay,

I'm all for some client-side operation, but at some point the server has 
to find out about it so that it knows how to manage your data model 
properly. Forget the nesting tags, this problem will get you in whatever 
your server side solution is. Once the Html is served, the server just 
doesn't care until it gets the next request.

The nested tags just evaluate the model at JSP execution time, just like 
any other tag, JSP or top-down servlet.

If you had to do it without a trip to the server, you will have to 
gather all the details of the extra rows in some hidden form element, 
and then process the details on the server when the user finally submits 
the page. It's possible, but not fun. Not the least of which is the 
client-side rendering of the page. If you're using IE5+ NS6+ you can 
just do Html replacements easy enough. The ability is certainly there... 
but approach with caution. It could quite easily become a nightmare.

For example, if a user is adding a whole heap of rows, they think that 
the data is in there because it's on the screen as they typed it, and 
simply types in another URL... all the data is lost, never to return. 
Not even with the back button (because JavaScript objects and state are 
not cached by the browser). Unless you can be certain that the page will 
be posted to the server after filling out these new rows, I would steer 
clear of it all together.

Another option is to have a page on a hidden frame send updates to the 
server. Every time that something changes to the data on the screen, get 
JavaScript to fire off the hidden frame with the update. Because you're 
only wanting to send updates, there's no heavy Html having to be 
generated by the server to be returned, maybe just a yes or no to tell 
your JavaScript whether the server got any errors etc.

Whatever you do... it will change the way you have to code your web 
interface, and increase your development time. How familiar are you with 
JavaScript?... This aint no simple mouse-over. :)


The monkey example uses the server-side management simply because a lot 
of puritans out there simply refuse to regard anything with client-side 
logic. And it's also 100% easier to do and manage.


Arron

(MonkeyBanana Author :)


Sanjay Choudhary wrote:

>Hi,
>
>I am very new to Struts, jsp and html programming.
>
>I kind of figured out how the nested tags works. 
>
>In my application, I have Bean A which contains Array
>list of type Bean B. Bean B has attributes B1 and B2.
>
>We show user on the web page details of A and under
>that all the elements of Bean B in a single row. User
>is allowed to edit this. So far it works fine for me
>using nested beans.
>
>We have another feature on our page where in we allow
>user to add n no. of rows on the page. Currently we
>are adding rows using java script. IS THERE A
>MACHANISM I CAN ADD THESE ROWS DYNAMICALLY USING
>JAVASCRIPT AND THEN ADD THESE ADDED ROWS PHYSICALLY TO
>THE ARRAYLIST INSTEAD OF MAKING A CALL TO THE SERVER
>EVERYTIME I ADD ONE. In monkeybanana example author is
>making call the server everytime the add button is
>pressed. Or is there an ALTERNATIVE solution.
>
>Thanks,
>sanjay
>
>
>
>
>
>
>
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Sports - live college hoops coverage
>http://sports.yahoo.com/
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>