You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by mahendan <ma...@mahendan.com> on 2008/07/28 01:47:45 UTC

t:panelTab onclick attribute doesn’t seem to work

Hi All,

I am using tomahawak 1.1.6 with facelets and I am trying to call a custom
javascript function when the user clicks on tab2.

This is what i got:

<script type="text/javascript">
<!--  
  function hello() {
    alert("Hello");
  }
-->
</script>
					
<t:panelTabbedPane serverSideTabSwitch="false">
  <t:panelTab id="tab1" label="Tab1">
    Tab 1 data
  </t:panelTab>
					
  <t:panelTab id="tab2" label="Tab2" onclick="hello()">
   Tab 2
  </t:panelTab>
</t:panelTabbedPane>

When I look at the generated HTML I don't see the call to hello(). Can
someone please help me and let me know what I am doing wrong?

Thanks,

Mahendan


Re: ReRendering of ComponentBindings fails

Posted by Volker Weber <v....@inexso.de>.
Hi,

the  getter for a binding component is only invoked if the framework
need the component to create the
view. In case of rerendering the view is restored and not new created.

In case of restoring (and if the binding getter returns null) the
setter is invoked. If you want to populate the panelGrid you should do
this in the setter, and let the getter return null to let the
framework create the panelgrid component.

In the setter you should check the components children to decide if
you need to do something.


Regards,
    Volker



2008/7/29 Eivind Ronnevik <ei...@kadme.com>:
> Hi!
>
>
>
> I have tried to post this question on the RichFaces user list, but I didn't
> get any replies there so I try here instead in case someone has some
> knowledge about my problem .
>
>
>
> I have a question when it comes to reRendering.
>
>
>
> If I have a h:outputText with a valuebinding pointing to a backing-beans
> property (session scoped), I can reRender this outputText if I my value in
> bb change.
>
>
>
> But If I have a h:panelGrid with componentBinding, and in the getter of the
> HtmlPanelGrid I add an OutputText-component programmatically, I can't
> reRender the HtmlPanelgrid with its children. The getter for the
> componentBinding is never asked.
>
>
>
> I've also tried to put my panelGrid inside an a4j:panel with
> ajaxRendered="true", but this didn't help me either.
>
>
>
> Am I missing something obvious here or shouldn't this work? :)
>
>
>
> So, this works:
>
> <h:inputText id="myinput" value="#{userBean.name}">
>
>
>
>                 <a4j:support event="onkeyup" reRender="outtext" />
>
>
>
>             </h:inputText>
>
>
>
>             <h:outputText id="outtext" value="#{userBean.name}" />
>
>
>
> But this doesnt:
>
>
>
>
>
>             <h:inputText id="myinput" value="#{userBean.name}">
>
>
>
>                 <a4j:support event="onkeyup" reRender="outPanel" />
>
>
>
>             </h:inputText>
>
>
>
>            <h:panelGrid id="outPanel" binding="#{userBean.panelGrid}">
>
>           </h:panelGrid>
>
>
>
> //----------------------------- JAVA code for componentBinding
> ---------------
>
>
>
> public HtmlPanelGrid getPanelgrid()
>
> {
>
>       HtmlOutpuText out = new HtmlOutputText();
>
>       out.setValueExpression(FacesContext.
> getCurrent...........#{userBean.name}......);
>
>
>
>    panelGrid.getChildren().add(out);
>
>
>
>    return panelGrid;
>
>
>
> }
>
>
>
> Any responses are greatly appreciated.
>
>
>
> Regards,
>
>
>
> Eivind Rønnevik



-- 
inexso - information exchange solutions GmbH
Bismarckstraße 13 | 26122 Oldenburg
Tel.: +49 441 4082 356 |
FAX: +49 441 4082 355 | www.inexso.de

ReRendering of ComponentBindings fails

Posted by Eivind Ronnevik <ei...@kadme.com>.
Hi!

 

I have tried to post this question on the RichFaces user list, but I didn't get any replies there so I try here instead in case someone has some knowledge about my problem .

 

I have a question when it comes to reRendering.

 

If I have a h:outputText with a valuebinding pointing to a backing-beans property (session scoped), I can reRender this outputText if I my value in bb change.

 

But If I have a h:panelGrid with componentBinding, and in the getter of the HtmlPanelGrid I add an OutputText-component programmatically, I can't reRender the HtmlPanelgrid with its children. The getter for the componentBinding is never asked.

 

I've also tried to put my panelGrid inside an a4j:panel with ajaxRendered="true", but this didn't help me either.

 

Am I missing something obvious here or shouldn't this work? :)

 

So, this works:


<h:inputText id="myinput" value="#{userBean.name}">

 

                <a4j:support event="onkeyup" reRender="outtext" />

 

            </h:inputText>

 

            <h:outputText id="outtext" value="#{userBean.name}" />

 

But this doesnt:

 

 

            <h:inputText id="myinput" value="#{userBean.name}">

 

                <a4j:support event="onkeyup" reRender="outPanel" />

 

            </h:inputText>

 

           <h:panelGrid id="outPanel" binding="#{userBean.panelGrid}">

          </h:panelGrid>

 

//----------------------------- JAVA code for componentBinding ---------------

 

public HtmlPanelGrid getPanelgrid()

{

      HtmlOutpuText out = new HtmlOutputText();

      out.setValueExpression(FacesContext. getCurrent...........#{userBean.name}......);

 

   panelGrid.getChildren().add(out);

 

   return panelGrid;

 

}

 

Any responses are greatly appreciated.

 

Regards,

 

Eivind Rønnevik


Re: t:panelTab onclick attribute doesn’t seem to work

Posted by Leonardo Uribe <lu...@gmail.com>.
On Sun, Jul 27, 2008 at 6:47 PM, mahendan <ma...@mahendan.com> wrote:

>
> Hi All,
>
> I am using tomahawak 1.1.6 with facelets and I am trying to call a custom
> javascript function when the user clicks on tab2.
>
> This is what i got:
>
> <script type="text/javascript">
> <!--
>  function hello() {
>    alert("Hello");
>  }
> -->
> </script>
>
> <t:panelTabbedPane serverSideTabSwitch="false">
>  <t:panelTab id="tab1" label="Tab1">
>    Tab 1 data
>  </t:panelTab>
>
>  <t:panelTab id="tab2" label="Tab2" onclick="hello()">
>   Tab 2
>  </t:panelTab>
> </t:panelTabbedPane>
>
> When I look at the generated HTML I don't see the call to hello(). Can
> someone please help me and let me know what I am doing wrong?
>
> Thanks,
>
> Mahendan
>
>
Could you create a issue about this, so someone could check it and solve it?
It will be a big help.

http://issues.apache.org/jira/browse/TOMAHAWK

regards

Leonardo Uribe