QDialogBox and Paginated QDataGrids
I'm seeing very strange behaviour when using QDialogBoxes and QDataGrids with Pagination.
As an example, I have a paginated QDataGrid with a column that creates a QButton (or QLinkControl, or QImageButton), which is linked to a QDialogBox.
The idea is to click the button, pop up a dialog box, which would be used to edit that particular row data.
When the page is first viewed, the page looks as it should: the dialog boxes are hidden. As soon as I attempt to sort a column of the QDataGrid, or click on another page of data, the code for each dialog box appears on the page.
Taking a look at Firebug and it appears the issues are related to these sprinkled throughout the returned HTML:
<
Looking into this further, I can see a few items that didn't get translated (and are the reason why the code is showing up):
<span id="c42_ctl"><input name="c42" id="c42" src="/image/web-button-save.gif" type="image"><input name="c42_x" id="c42_x" value="" type="hidden"><input name="c42_y" id="c42_y" value="" type="hidden"></span></control></div>]]><control id="c43"><!--[CDATA[<img name="c43" id="c43" src="/image/function-edit.png" /--><input name="c43_x" id="c43_x" value="" type="hidden"><input name="c43_y" id="c43_y" value="" type="hidden">]]></control><div class="object-delete"><control id="c44"><!--[CDATA[<img name="c44" id="c44" src="/image/function-delete.png" /--><input name="c44_x" id="c44_x" value="" type="hidden"><input name="c44_y" id="c44_y" value="" type="hidden">]]></control>The ']]>' chunks are causing the issue. These must be CDATA closing tags that are not being recognized as closing tags at all.
Where do you render the dialog? Thre was a thread somewhere that stated that the dialogbox has to be rendered in an HTML standard way. I think the guy who stared the thread rendered it after a table tag. I usually render these kinds of dialogs directoy after RenderBegin(); Works fine, but I use a proxy control.
Cheers
Helge
Figured it out, and this may be useful to anyone else who runs into this issue.
In my datagrid column render method, my new controls where using the base control as the parent, instead of the datagrid.
This subtle change caused the if statement of QControlBase::RenderOutput() to think the control hadn't been rendered yet. This caused QString::XmlEscape() to be called, and is what messed with the XML sent back via Ajax.
Once I changed my dynamic controls to use the DataGrid as the parent, they started acting as they should've.
As I was crashing through my code, this was tough to see...
How do you debug the code? Which debugger are you using?
I am using the Eclipse PDT and it does not work too good. Breakpoints dont work at all! So its almost useless to me :(
Hi Vaibhav,
I normally use NetBeans with xDebug in the Apache server. Breakpoints & Watch vars works great, the only true problem is when the xdebug service some times gets "tilt" and must restart the netbeans, weird behavior.
I heard firebug is great too but i dont use it at the moment.
JMI
Ok, this may sound weird to you but the fact is that I never knew that netbeans can work with PHP!!! I thought it was the 'java only' IDE! Going to download that :D
Regards