you can specify a form to be sumitted when the div refreshes, using formId.
musachy
On 8/17/07, Richard Sayre <[EMAIL PROTECTED]> wrote:
> I have my div refreshing when an 'editQuestion' topic is published.
>
> <s:url id="loadQuestionDetails" action="getQuestionDetails">
> <s:param name="questionId" value="492"/>
> </s:url>
>
> <s:div id="questionDetailsDiv" theme="ajax"
> href="%{loadQuestionDetails}" listenTopics="/editQuestion">
>
>
> </s:div>
>
> As you can see I have the parameter questionId hard coded. When ever
> the div reloads itself I would like to be able to change the
> questionId parameter. Id there an example in the showcase that does
> this? I have a javascript function called editQuestion(id) that
> publishes the topic. I know the URL is generated on the server side
> so I cant change it's parameter. Is there another way?
>
> Thank you
>
>
>
> On 8/17/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:
> > If all you want to do is reload the div content, you can set it's href
> > to the url that returns the html, set it's listeninTopics to a topic
> > that you can publish, and the div will reload its content
> > automagically. (check showcase and documentation for examples)
> >
> > musachy
> >
> > On 8/16/07, Richard Sayre <[EMAIL PROTECTED]> wrote:
> > > 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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > "Hey you! Would you help me to carry the stone?" Pink Floyd
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]