Closed GoogleCodeExporter closed 9 years ago
I can't reproduce your problem. Can you please attach a copypaste of the ajax
response body?
Original comment by balusc
on 29 Oct 2012 at 8:54
FYI, I tried the following, and it updates p:dataTable just like p:calendar
p:ajax update="...".
Ajax.update(flightsDataTable.getClientId());
I'll retest to get the AJAX response.
Original comment by smithh03...@gmail.com
on 29 Oct 2012 at 9:13
AJAX response body attached.
I want to tell you something else in my next comment.
Original comment by smithh03...@gmail.com
on 29 Oct 2012 at 9:24
Attachments:
My test steps 'and' results include the following:
1. After page is rendered in browser, scroll down to flights panel
2. enter some values in some of the dataTable columns on 1st 2 rows
3. scroll back up to p:calendar, select the date, 8/22/2012
4. AJAX request is posted/sent
5. scroll back down to flights datatable
6. dataTable is 'not' updated at all, and dataTable data values are all the
same as prior to # 3 above
I need to share something else with you, when I update the entire dataTable,
only the date is updated, successfully, when using p:ajax update="..." OR
OmniFaces Ajax utility's update(clientId). Seems as though the dataTable values
are 'not' being submitted regardless of partialSubmit="true" or
partialSubmit="false". Prior to today's code changes, partialSubmit="false" is
included in the xhtml for p:calendar p:ajax ...
I have tried to add rowKey="#{flight.flightId}" as well as remove and re-add
hashCode() and equals(), overrided, in the POJO. For whatever reason, this is
not working at all.
Is this a defect related to OmniPartialViewContext, since I am and have been
using OmniFaces 1.2, earlier on, and now 1.3-SNAPSHOT (on development and
production server)?
Original comment by smithh03...@gmail.com
on 29 Oct 2012 at 9:35
Clarification to the statement below in previous comment:
I need to share something else with you, when I update the entire dataTable,
only the date is updated, successfully, when using p:ajax update="..." OR
OmniFaces Ajax utility's update(clientId). Seems as though the dataTable values
are 'not' being submitted regardless of partialSubmit="true" or
partialSubmit="false".
When I do p:ajax update="..." or OmniFaces Ajax.update(clientId), after
completing step # 5 above, all of my dataTable values dissapear, and the only
column populated with data is the date column. :(
I have looked at the code responsible for updating the 'date' member of the
List<POJO>, and that code looks fine and does not seem responsible for wiping
out any possible submitted values in the other members/attributes of the POJO.
That code is as follows:
public void updateFlightDateOnAdd(Date date) {
List<FlightForOrder> list = new ArrayList<>();
for (int i = 0; i < flightsForOrder.size(); i++) {
FlightForOrder flight = flightsForOrder.get(i);
flight.setFlightDate(date);
//flight.setFlightTime(date);
list.add(flight);
}
flightsForOrder = list;
}
The code in production is not working as designed either.
Original comment by smithh03...@gmail.com
on 29 Oct 2012 at 9:42
The ajax response doesn't match the datatable's HTML output. Is the datatable's
HTML output as in your 1st post the same HTML output as you have tested the
ajax response on? Or have you made some changes thereafter?
Original comment by balusc
on 29 Oct 2012 at 9:45
Test (continued from comment #4 above):
7. Clicked the Save commandLink, which is an ajax="false" request
8. Verified that all data was submitted and saved
9. Since data was not updated via OmniFaces Ajax.updateColumn(), then all data
in dataTable was saved to database, successfully
Please note, these test steps and results are only related to
Ajax.updateColumn(); these are not test results of p:ajax update="..." or
OmniFaces Ajax.update(clientId).
Original comment by smithh03...@gmail.com
on 29 Oct 2012 at 9:49
Response to comment # 6, that ajax response seems to be a typical response
after completing the test steps. As test steps will show, I made no other
changes on the form after step # 6 in comment # 4 above.
Hmmm, trying to figure out how best to answer your question in comment # 6...
Original comment by smithh03...@gmail.com
on 29 Oct 2012 at 10:08
Honestly, I don't know how HTML output (in ajax response) changed from the HTML
output that was rendered after opening/displaying the xhtml page.
After the AJAX response, the dataTable looks the same, but all column values
are lost except the values of the date column.
Original comment by smithh03...@gmail.com
on 29 Oct 2012 at 10:10
Please note that Date and Time p:column have conditional rendered components.
Please refer to the xhtml in the stackoverflow question that I posted.
Original comment by smithh03...@gmail.com
on 29 Oct 2012 at 10:11
This form is 'huge', over 600k. I may need to tune the update="...", so it will
only update the components that need to be updated.
Original comment by smithh03...@gmail.com
on 29 Oct 2012 at 10:19
FYI, HTML body 'probably' changes onload as this page adds Google Places
Autocomplete to various inputText fields that are not binded to the bean. From
what I can tell, everything is updated successfully except the Flights
datatable, so I am moving flights dataTable closer to the top of the page,
above the Google Places Autocomplete inputText's.
What did you see earlier in the HTML body that changed?
Original comment by smithh03...@gmail.com
on 30 Oct 2012 at 12:02
I could reproduce the problem. The cause was a panelgroup as column's direct
child which didn't render anything to the HTML output. See also my answer
http://stackoverflow.com/questions/13128299/omnifaces-ajax-utilitys-updatecolumn
-not-updating-pdatatable
I'm unsure how to best prevent this in the future. I could add an additional
check if the direct child component would by itself render *anything* to the
HTML output or not. But there are endless scenarios possible. I think it's
better to update the javadoc accordingly to explain this "by design" behaviour
clearly.
Original comment by balusc
on 30 Oct 2012 at 12:48
Shaking my head at the fact that I 'should have' tried that. I need to remember
this going forward, and learn to assign IDs to any/all components, and avoid
using h:panelGroup 'if' I am 'not' referencing h:panelGroup ID in an
update="...". Anyway, thanks again, that solved the problem.
I don't know how you want to update the status of this issue, but you can
update the status as you wish.
Original comment by smithh03...@gmail.com
on 30 Oct 2012 at 1:11
FYI, when you responded, I was about to use some existing Javascript that I
have and using on the other page that is now using Ajax.updateColumn() that you
helped me with earlier.
I have javascript for onchange="..." that will do the same as the java bean is
doing on the server, and then updating via Ajax.updateColumn(). The client
javascript, triggered by onchange="...", is for endusers like myself which are
'keyboard users', that rather type in a date and press <Tab> key instead of
using mouse (I hate using the mouse), but I have to use the mouse a lot in web
browser/client/software. When I was developing Windows software, I could use
all my keyboard shortcuts.
Anyway, thanks again.
Original comment by smithh03...@gmail.com
on 30 Oct 2012 at 1:15
I improved the javadocs:
http://code.google.com/p/omnifaces/source/detail?r=0d021471a6719681f84d2046108a8
5bf192eefd5
Thank you for reporting :)
Original comment by balusc
on 30 Oct 2012 at 1:18
You're welcome! I'm loving OmniFaces and spreading the word, when possible!
Original comment by smithh03...@gmail.com
on 30 Oct 2012 at 1:29
Original comment by balusc
on 11 Dec 2012 at 1:33
Original issue reported on code.google.com by
smithh03...@gmail.com
on 29 Oct 2012 at 7:33Attachments: