Re: Struts 1 form data change

2009-10-07 Thread Paweł Wielgus
Hi, maybe You can have as many forms on this page as tabs, that would also caused that You will have 3 save buttons. If You are worring abut performance that might be the solution. Also You would not be worrying about which tab was selected, only some kind of javascript that will check that user mo

Re: Struts 1 form data change

2009-10-06 Thread Paul Benedict
SanJ, Don't worry about performance. You can't program advanced features by writing nothing. You'll have to do the check. >> I have the same idea in mind but how would I know tab being saved is 'A'? The tab last selected is the tab being saved. As I said, use a hidden field to tell you. Paul On

Re: Struts 1 form data change

2009-10-06 Thread SanJ.SANJAY
Or I can compare at server side, the values of fields in tabs. If value SanJ.SANJAY wrote: > > Thanks Paul, appreciate that. > > I have the same idea in mind but how would I know tab being saved is > 'A'? I can only detect if the tab is 'clicked or selected' not if the data > in

Re: Struts 1 form data change

2009-10-06 Thread SanJ.SANJAY
Thanks Paul, appreciate that. I have the same idea in mind but how would I know tab being saved is 'A'? I can only detect if the tab is 'clicked or selected' not if the data in tab is 'changed'.Hmmm ...interesting :-). I have three tabs in JSP with one form and only one save button fo

Re: Struts 1 form data change

2009-10-06 Thread Paul Benedict
SanJ, This is where you have to modify your code :-) You'll have to take into account which tab was saved, and only save that tab's data. As you said yourself, you can't just take the entire ActionForm data. public void execute(...) { if (tab being saved is 'A') { saveTabA(); } else if (t

Re: Struts 1 form data change

2009-10-06 Thread SanJ.SANJAY
Pawel, You are right, but, the data that I have in tab 1 contains lot of fields and is kind of different set of data. So if I just change the Tab 2 data and click save, I am unnecessarily re-saving the data of tab1 (which means firing big queries to Database) when all I need is just save

Re: Struts 1 form data change

2009-10-06 Thread Paweł Wielgus
Hi all, consider a story like this: lets say i'm the user, i'm loading this page, then i select tab1 and look at the data, then i select tab2 and change the data tab2_d1, then i select tab1 and change the data tab1_d1, then again select tab2 and change data tab2_d1 to it's original value, and i cli

Re: Struts 1 form data change

2009-10-05 Thread Paul Benedict
It could be a character that represents which tab is selected. A, B, C, etc. On Mon, Oct 5, 2009 at 9:40 PM, SanJ.SANJAY wrote: > > Paul, > > I will try that..hidden field will be a java variable. So it should be like > a boolean which toggles every user select Tab? > > Thanks .. > > > > Paul Ben

Re: Struts 1 form data change

2009-10-05 Thread SanJ.SANJAY
Paul, I will try that..hidden field will be a java variable. So it should be like a boolean which toggles every user select Tab? Thanks .. Paul Benedict-2 wrote: > > SanJ, > > When a user selects the tab, modify a hidden form field that indicates > the tab selected. Do you know javascript?

Re: Struts 1 form data change

2009-10-05 Thread Paul Benedict
SanJ, When a user selects the tab, modify a hidden form field that indicates the tab selected. Do you know javascript? That's what you would use. Paul On Mon, Oct 5, 2009 at 9:15 PM, SanJ.SANJAY wrote: > > Thanks Paul, > >                 I thought about that also but selecting a tab isn't alwa

Re: Struts 1 form data change

2009-10-05 Thread SanJ.SANJAY
Thanks Paul, I thought about that also but selecting a tab isn't always mean that I change the data inside that tab. Paul Benedict-2 wrote: > > SanJ, > > Can you track which tab the user selected? Perhaps you can set a > javascript variable when one is selected. The only do

Re: Struts 1 form data change

2009-10-05 Thread Paul Benedict
SanJ, Can you track which tab the user selected? Perhaps you can set a javascript variable when one is selected. The only down side here is that you'll have to hardcode which fields belong to which tab. Once you do that, you can do what you want. Paul On Mon, Oct 5, 2009 at 7:42 PM, SanJ.SANJAY