Hi,
Sorry for my really long delay to respond to this issue, but I have
been in bed with fever up until tuesday...
I looked into your pasted code again and also reviewed the ppr.js
accordingly. I think what Gerald suspects, that it has something
to do with the interception of the submit. I suspect the
button onClick handlers in particular.
If I understood it correctly the client side tabbedPane renders buttons
which are not intended to submit the mainform but instead have
onclick-Handlers which call some javascript and then return false
to prevent a submit - right?
If that is the case and later on the PPRCtrl initialization method replaces
the onclick-handlers of all buttons (regardless of specific partialTriggers)
with the following:
//PointCutAdvisor which invokes the AJAX Submit Method of the PPR
Controller after custom
//onclick-handlers for submit-buttons and submit-images
org.apache.myfaces.PPRCtrl.prototype.buttonOnClickHandler = function (_event)
{
if(this.onclick_orig.type != "undefined")
{
this.onclick_orig();
}
return this.myFacesPPRCtrl.ajaxSubmitFunction(this);
}
where onclick_orig is the original onclick-handler of the button. The
ajaxSubmitFunction then checks for triggers and submits normally
if none are found.
A return
value of false from the original onclick handler which would normally
prevent a form submission would in this case be ignored.
If you know of the venkman plugin for firefox (also known
as JavaScript debugger) you could set a breakpoint in this method
and see if that is the problem.
In case you are not familiar or have troubles with the javascript debugger
just drop a line and I'll try to recronstruct the problem and see for myself.
If that indeed proves to be the problem i think we could solve it by
just checking
for the return value in the onclick handler which would probably be cleaner
anyway.
regards
Ernst
On 2/21/07, Gerald Müllan <[EMAIL PROTECTED]> wrote:
Hi,
the responded markup seems to be ok, PanelTabbedPane renders a hidden
input-submit, and on onclick-event it tries to change the tab to
another one on client side.
Normally, if ppr is activated on an element, it hooks into a click and
before doing the form-post it does its own ajax-submit. It seems that
in this case ppr also anticipating in any way, and activates a regular
form-post.
How do you have specified the "partialTriggers" attribute (or
partialTriggerPattern )?
Maybe it also aims the hidden tab-button.
cheers,
Gerald
On 2/21/07, Laurentiu Trica <[EMAIL PROTECTED]> wrote:
> Hi Ernst
>
> Sorry for not responding faster, but I had to switch from using tableSuggest
> to inputSuggest and I hoped that won't be the same problem.
>
> Unfortunately it is.
> I checked the generated HTML and I found this for the tabbed panel.
>
> <script><!--
>
> panelTabbedPane_5FofamMainForm_3A_5Fid115_5FHeadersIDs= new
>
Array("ofamMainForm:tab1_headerCell","ofamMainForm:tab2_headerCell","ofamMainForm:tab3_headerCell","ofamMainForm:tab4_headerCell","ofamMainForm:tab5_headerCell","ofamMainForm:tab6_headerCell","ofamMainForm:tab7_headerCell");
>
> panelTabbedPane_5FofamMainForm_3A_5Fid115_5FIDs= new
>
Array("ofamMainForm:tab1","ofamMainForm:tab2","ofamMainForm:tab3","ofamMainForm:tab4","ofamMainForm:tab5","ofamMainForm:tab6","ofamMainForm:tab7");
>
>
> //--></script>
> <input id="ofamMainForm:_id115_indexSubmit"
> name="ofamMainForm:_id115_indexSubmit" style="display:none"
> /><table id="ofamMainForm__id115" cellspacing
> ="0" class="myFaces_panelTabbedPane tabbedPanel">
> <
> tr class="myFaces_pannelTabbedPane_HeaderRow">
> <td id=
> "ofamMainForm:tab1_headerCell"
> class="myFaces_panelTabbedPane_activeHeaderCell"><
> input type="submit" name="ofamMainForm:_id115.0"
> value="Details" onclick="return
>
myFaces_showPanelTab(0,'ofamMainForm:_id115_indexSubmit','ofamMainForm:tab1_headerCell','ofamMainForm:tab1',panelTabbedPane_5FofamMainForm_3A_5Fid115_5FHeadersIDs,panelTabbedPane_5FofamMainForm_3A_5Fid115_5FIDs,null,null,null,null);"
> /></td>
> <td id="ofamMainForm:tab2_headerCell"
> class="myFaces_panelTabbedPane_inactiveHeaderCell"><input
> type
> ="submit" name="ofamMainForm:_id115.1" value=
> "Transport" onclick="return
>
myFaces_showPanelTab(1,'ofamMainForm:_id115_indexSubmit','ofamMainForm:tab2_headerCell','ofamMainForm:tab2',panelTabbedPane_5FofamMainForm_3A_5Fid115_5FHeadersIDs,panelTabbedPane_5FofamMainForm_3A_5Fid115_5FIDs,null,null,null,null);"
> /></td>
>
>
> <td class=
> "myFaces_panelTabbedPane_emptyHeaderCell"> </td>
> </tr>
> <tr
> class="myFaces_pannelTabbedPane_subHeaderRow">
> <td id=
> "ofamMainForm:tab1_headerCell_sub"
> class="myFaces_panelTabbedPane_subHeaderCell
> myFaces_panelTabbedPane_subHeaderCell_first
> myFaces_panelTabbedPane_subHeaderCell_active"
> > </td>
> <td id="ofamMainForm:tab2_headerCell_sub"
> class="myFaces_panelTabbedPane_subHeaderCell
> myFaces_panelTabbedPane_subHeaderCell_inactive"> 
> </td>
> <td id="ofamMainForm:tab3_headerCell_sub"
> class="myFaces_panelTabbedPane_subHeaderCell
> myFaces_panelTabbedPane_subHeaderCell_inactive"> </td
> >
>
> <td id="ofamMainForm:tab4_headerCell_sub"
> class="myFaces_panelTabbedPane_subHeaderCell
> myFaces_panelTabbedPane_subHeaderCell_inactive"> </td
> >
> <td id="ofamMainForm:tab5_headerCell_sub" class=
> "myFaces_panelTabbedPane_subHeaderCell
> myFaces_panelTabbedPane_subHeaderCell_inactive"> </td>
> <td
> id="ofamMainForm:tab6_headerCell_sub"
> class="myFaces_panelTabbedPane_subHeaderCell
> myFaces_panelTabbedPane_subHeaderCell_inactive"
> > </td>
> <td id="ofamMainForm:tab7_headerCell_sub"
> class="myFaces_panelTabbedPane_subHeaderCell
> myFaces_panelTabbedPane_subHeaderCell_inactive"> 
> </td>
> <td class="myFaces_panelTabbedPane_subHeaderCell
> myFaces_panelTabbedPane_subHeaderCell_last"
> > </td>
> </tr>
> And yes, the behaviour is the one you wrote in your reply.
>
> Thank you in advance.
>
>
> On 2/12/07, Ernst Fastl <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > So if I understood you correctly you are using a t:panelTabbedPane
> > with serverSideTabSwitch="false" right?
> > Inside you have a dropdown-menu which triggers a partial update
> > of a contained panel group.
> >
> > If you do not touch the drop-down and click on a tab it stays on the
> > client-side,
> > but if you changed the dropdown value and afterwards click on a tab
> > the page gets submitted?
> >
> > if that is the case, could you look into the generated HTML and tell
> > what the onclick-Handlers of the Tab-buttons contain?
> >
> > regards
> >
> > Ernst
> >
> > On 2/12/07, Laurentiu Trica <[EMAIL PROTECTED]> wrote:
> > > Hi
> > >
> > > I use a tabbedPanel on the client side and a PPRPanelGroup to update a
> > > field.
> > > The problem I encountered is when I change a combobox that triggers the
> > > update of that field. It works fine. But then, when I want to change the
> > > tab, even if it is on client side, the page is refreshed (the new tab is
> > > indeed selected).
> > >
> > > Anyone encountered this problem before? Is it an issue? Or is there
> > > something I am doing wrong?
> > >
> > > Thank you.
> > >
> > > --
> > > Best regards,
> > > Laurentiu
> >
>
>
>
> --
> Best regards,
> Laurentiu
--
http://www.irian.at
Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German
Professional Support for Apache MyFaces