struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Sayre" <richardsa...@gmail.com>
Subject Re: Tabbed Panel and Ajax
Date Thu, 16 Aug 2007 14:34:51 GMT
I seem to have it working now.  There was a form wrapped around the
tabbed panel.  My Ajax function was setting the inner html of this
form, effectively wiping out the rest of the tab contents.  Now I am
wondering if listening to the topics is nessessary?  In fact how does
it work?  In my function I just set the innerHTML of the UDF tab and
it works normally.  I am new to Dojo and the only place I have seen
the suscribe/publish was in a Struts example.

How do I automatically return the inner html to the div?  Is that what
listening to the topics is suppose to do?  Maybe I am misunderstanding
its purpose.

Here is the topic the gets published:

dojo.event.topic.subscribe("/editUdfs", function() {


     var kw = {
            url:    '<s:url action="editUdfs"/>',
            load:    function(type, data, evt) {

                        dojo.byId("udfAjaxDiv").innerHTML = data;
                    },
            method: "POST",
            formNode: dojo.byId("questionForm"),
            error: function(type, data, evt){

                 dojo.byId("udfAjaxDiv").innerHTML = data + "::"+data.value;
		
            }

        };

        dojo.io.bind(kw);


    });

On 8/16/07, Musachy Barroso <musachy@gmail.com> wrote:
> so you are saying that the tabs work fine before clicking on the link,
> but they don't work after that? What are you doing in  editUdf()? Is
> there any error when you set debug="true" on head? (or any javascript
> error in general?)
>
> musachy
>
> On 8/16/07, Richard Sayre <richardsayre@gmail.com> wrote:
> > I have a tabbed panel set up as follows
> >
> > <s:tabbedPanel id="questionPanel" doLayout="true"
> > cssClass="questionTabPanelDesign">
> >
> > <s:div id="questionTab" label="Question" theme="ajax">
> >     Static Content...
> > </s:div>
> >
> > <s:div id="udfTab" label="UDF" theme="ajax" listenTopics="/editUdfs">
> >     Static link <a href="javascript:editUdf()">Edit UDF</a>
> > </s:div>
> >
> > <s:div id="docTab" label="Docs" theme="ajax">
> >     Static  content
> > </s:div>
> >
> > </s:tabbedPanel>
> >
> > When I click the link in the UDF tab, the /editUdfs  gets published
> > and the edit gui displays in the tab,  the problem is if I click on
> > another tab after this happens, the contents of that tab does not
> > display and the UDF gui still shows.
> >
> > Do I have anything set up wrong?
> >
> > I have the tab panel inside a Split Container that calls the tabs from
> > ajax (loadDetails)  Im not sure if that makes any difference.  Here is
> > a code sample:
> >
> >   <div dojoType="LayoutContainer" >
> >
> >             <div dojoType="SplitContainer" orientation="horizontal"
> > sizerWidth="3" style="width:100%;height:550px;">
> >                 <div dojoType="ContentPane" style="overflow:auto;">
> >
> >                     <s:url id="getTree" action="getTree">
> >                         <s:param name="id" value="%{id}"/>
> >                     </s:url>
> >
> >                     <s:div theme="ajax" href="%{getTree}">
> >
> >
> >
> >                     </s:div>
> >
> >                 </div>
> >
> >                 <div dojoType="ContentPane" class="detailsContentPane">
> >
> >                     <s:url id="loadDetails" action="getDetails">
> >                         <s:param name="id" value="492"/>
> >                     </s:url>
> >
> >                     <s:div theme="ajax" href="%{loadDetails}">
> >
> >                     </s:div>
> >
> >
> >                 </div>
> >             </div>
> >
> >         </div>
> >
> > Any suggestions would be great.
> >
> > Thank you,
> >
> > Rich
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message