Hi 2010/5/6 Curtiss Howard <[email protected]>
> Thanks for the update Leonardo. But just to be clear, when we try > this scenario on Glassfish they're doing essentially what I proposed > (separate onclick JS that sets the right value). Does that param need > to be default then...? > > I think we should change the algorithm a little. If HtmlButtonRendererBase needs to render some hidden field like in this case, force render the clear hidden field javascript, but I'm not sure because we need to keep compatibility with Mojarra. The web config param was created to deal with other context, so before do anything it is necessary to check the history of this issue. regards, Leonardo Uribe > > Curtiss Howard > > > > On Thu, May 6, 2010 at 9:32 AM, Leonardo Uribe <[email protected]> wrote: > > Hi > > > > There is a change introduced on MYFACES-2372. The renderkit javadoc says > > this: > > > > ".....If the component being rendered by this renderer has any > UIParameter > > children, each one of them must be rendered using the renderer for > > component-family: "javax.faces.Input" and renderer-type: > > "javax.faces.Hidden". For discussion, this is called the hiddenRenderer. > A > > component with component-type "javax.faces.Input" must be created for > local > > use in rendering each UIParameter child. The "id" property of the > temporary > > component must be set to the "name" of the UIParameter. The "value" > property > > of the temporary component must be set to the "value" of the UIParameter. > > For each UIParameter child, the hiddenRenderer must have its > encodeBegin(), > > encodeChildren(), and encodeEnd() methods called, in order, passing the > > temporary component as the second argument....." > > > > So, we put the code at the end of HtmlButtonRendererBase.encodeEnd(). In > > theory if you set the web config para > > org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON to true, the > required > > javascript that clear hidden fields will be set and the problem you > mention > > dissapear. > > > > I'll check this one (it is necessary to track this one from 1.2), but it > > will take some time, right now I'm busy implementing > > composite:clientBehavior tag. > > > > regards, > > > > Leonardo Uribe > > > > 2010/5/6 Curtiss Howard <[email protected]> > >> > >> Hi, > >> > >> Our tester has found an issue that apparently is not tested in CTS but > >> nonetheless is a bug with MyFaces (confirmed that it does not occur > >> with Glassfish). > >> > >> Let's say we have the following: > >> > >> <h:commandButton ...> > >> <f:param name="paramName" value="value1" /> > >> </h:commandButton> > >> <h:commandButton ...> > >> <f:param name="paramName" value="value2" /> > >> </h:commandButton> > >> > >> We'll render two buttons and two hidden inputs with the name > >> "paramName" but two different values. The problem is that one value > >> will clobber the other and you don't get the value you expect when > >> clicking the second button. Obviously the fix is to make the logic in > >> HtmlButtonRendererBase behave like the link case, where onclick > >> Javascript is rendered to dynamically set the correct parameter value > >> depending on which button was clicked. I've spent some time trying to > >> do this by reusing the oamSubmit() code, but it doesn't seem to work > >> (looks like the target makes it open another browser window and in our > >> case, we do navigation based on the param, and that navigation never > >> occurs). Unfortunately due to other obligations I'm not sure that I > >> have the time to really fix this "correctly" right away. I think > >> there are a couple of cases that have to be handled... rendering this > >> JS when there's no onclick, when there is an onclick, when behaviors > >> are attached, etc. It's a bit too much for me to get into at the > >> moment and I'm not that familiar with this portion of the code. Is > >> there anyone out there willing to lend a hand? > >> > >> Thanks in advance, > >> > >> > >> Curtiss Howard > > > > >
