[
https://issues.apache.org/jira/browse/WW-3118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christopher Young updated WW-3118:
----------------------------------
Attachment: dojo_trunk.diff
This patch checks if the tag has been received from an ajax call and if so runs
the javascipt immediately rather than setting it to run at onload. There is
also a new parameter (calledByAjax) to override the automatic checking.
The changes are as follows:
Bind.java: Added calledByAjax parameter.
BindTag.java: Checks calledByAjax parameter and if it's not set, then
automatically detects whether the tag is called from an ajax request.
bind.ftl: Checks calledByAjax flag to run script immediately or onload.
Bind.js: Fixed regular expression to match on semi colon only otherwise the
regular expression will match an incomplete expression.
StrutsMockAjaxHttpServletRequest: Overrides getHeader to indicate ajax request.
StrutsMockHttpServletRequest: Overrides getHeader to indicate normal request.
Bind-ajax.txt, Bind-onload.txt repace Bind-1.txt.
AbstractTagTest.java: Enable the request class to be controlled by the test sub
class.
BindTest.java, BindTestAjax.java: Updated to provide ajax and non-ajax unit
tests.
> sx:bind tag does not work when used inside a tabbedPanel sx:div
> ---------------------------------------------------------------
>
> Key: WW-3118
> URL: https://issues.apache.org/jira/browse/WW-3118
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Dojo Tags
> Affects Versions: 2.1.6
> Environment: GlassFish v2 running on eclipse ganymede
> Reporter: Roberto Hernandez
> Priority: Critical
> Attachments: dojo_trunk.diff
>
>
> I'm trying to submit an action using sx:bind tag inside a sx:div from a
> tabbedPannel. The problem is that sx:bind does not work inside the rendered
> sx:div from the tabbedPanel. I have used exactly the same code ouside the
> tabbedPanel and it works perfectly fine. I've tried to incude
> executeScripts="true" and separateScripts="false", but nothing. I also played
> around with the sx:head and s:head and tried to remove them, add both of
> them, one at a time and no effects whatsoever. I've googled the problem and
> other people seem to be having the same problem but nobody has posted a
> solution yet.
> (The example I'm providing is a simple example and does not reflect what I'm
> trying to do in real-time but wanted to show how bind tag is not working)
> Below is the jsp code containing the tabbedPannel widget
> <%@ taglib uri="/struts-tags" prefix="s"%>
> <%@ taglib uri="/struts-dojo-tags" prefix="sx"%>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
> <html>
> <head>
> <title>Store Attributor</title>
> <s:head theme="xhtml"/>
> <sx:head debug="true" cache="false" />
> </head>
> <body>
> <s:url var="showManageAttributes" value="/attributes/ShowManageAttributes" />
> <sx:tabbedpanel id="mainContainer" >
> <sx:div href="%{showManageAttributes}" id="manageAttributesTab"
> label="MANAGE ATTRIBUTES" executeScripts="true" ></sx:div>
> --------Other Divs go here but I deleted them to keep it
> simple ----------
> </sx:tabbedpanel>
> </body>
> <html>
> ************************************************************************************************************************************************
> Here's the jsp that gets rendered inside the <sx:div>
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <%@ taglib uri="/struts-tags" prefix="s"%>
> <%@ taglib uri="/struts-dojo-tags" prefix="sx"%>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
> pageEncoding="ISO-8859-1"%>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <c:set var="context" value="${pageContext.request.contextPath}" />
> <head>
> <sx:head />
> </head>
> <html xmlns="http://www.w3.org/1999/xhtml">
> <body>
> <center><img id="indicator" src="${context}/images/loadingBig.gif"
> style="display:none"/></center>
> <input type="button" value="submit" id="submitbutton"/>
> <s:url var="showGroupInfo" value="/admin/ShowGroupInfo" />
> <sx:bind href="%{#showGroupInfo}" sources="submitbutton"
> targets="columnContent" events="onclick"
> showLoadingText="false" indicator="indicator"
> executeScripts="true" />
> <div id="columnContent">
>
> </div>
> </body>
> </html>
> ******************************************************************************************************
> Here's the action from struts.xml
> <action name="ShowManageAttributes"
> class="com.heb.storeattributor.actions.ManageAttributeAction" >
> <result>/jsp/attributor/manage_attributes_main.jsp</result>
> </action>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.