• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java JavaScriptUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.ibm.xsp.util.JavaScriptUtil的典型用法代码示例。如果您正苦于以下问题:Java JavaScriptUtil类的具体用法?Java JavaScriptUtil怎么用?Java JavaScriptUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JavaScriptUtil类属于com.ibm.xsp.util包,在下文中一共展示了JavaScriptUtil类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: renderSeparator

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
protected void renderSeparator(FacesContext context, ResponseWriter writer, TreeContextImpl tree) throws IOException {
    script.append(varName);
    script.append(".addChild(new "); // $NON-NLS-1$
    script.append(getSeparatorType());
    script.append("({");
    boolean hasp = false;
    String style = tree.getNode().getStyle();
    if(StringUtil.isNotEmpty(style)) {
        if(hasp) script.append(","); else hasp=true;
        script.append("style:"); // $NON-NLS-1$
        JavaScriptUtil.addString(script, style);
    }

    String styleClass = tree.getNode().getStyleClass();
    if(StringUtil.isNotEmpty(styleClass)) {
        if(hasp) script.append(","); else hasp=true;
        JavaScriptUtil.addString(script, "class"); // $NON-NLS-1$
        script.append(":"); // $NON-NLS-1$
        JavaScriptUtil.addString(script, styleClass);
    }
    script.append("}));\n"); // $NON-NLS-1$
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:23,代码来源:DojoMenuRenderer.java


示例2: encodeBegin

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
@Override
public void encodeBegin(FacesContext context, UIComponent component)
        throws IOException {
    ResponseWriter w = context.getResponseWriter();
    if(!component.isRendered()) {
        return;
    }
    
    AbstractPager pager = (AbstractPager)component;
    FacesDataIterator dataIterator = pager.findDataIterator();

    if(dataIterator!=null) {
        writeMain(context, w, pager, dataIterator);
    }

    //>tmg:a11y
    String _pagerClientId = (String)HtmlUtil.readEncodeParameter(context, pager, AbstractPager.PAGER_CLIENT_ID, /*remove*/ true);
    if(null != _pagerClientId){
        StringBuilder js = new StringBuilder();
        js.append("XSP.setFocus("); //$NON-NLS-1$
        JavaScriptUtil.addString(js, _pagerClientId); // $NON-NLS-1$
        js.append(");\n"); //$NON-NLS-1$
        JavaScriptUtil.addScriptOnLoad(js.toString());
    }
    //<tmg:a11y
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:27,代码来源:AbstractPagerRenderer.java


示例3: encodeEnd

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
@Override
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
    //>tmg:a11y
	super.encodeEnd(context, component);

	// the regular expand/collapse actionevent and the column sort action event work in here...
    String _toggleActionClientId = (String)HtmlUtil.readEncodeParameter(context, component, UIDataSourceIterator.TOGGLE_ACTION_CLIENT_ID, /*remove*/ true);
    if(null != _toggleActionClientId){
    	// for the expand/collapse action event, flip the client id... expand/collapse vs collapse/expand...
    	if(_toggleActionClientId.contains(SHRINK_DELIMITER)){
            _toggleActionClientId = _toggleActionClientId.replaceAll(SHRINK_DELIMITER, EXPAND_DELIMITER);
        }else if(_toggleActionClientId.contains(EXPAND_DELIMITER)){
            _toggleActionClientId = _toggleActionClientId.replaceAll(EXPAND_DELIMITER, SHRINK_DELIMITER);
        }

        StringBuilder js = new StringBuilder();
        js.append("XSP.setFocus("); //$NON-NLS-1$
        JavaScriptUtil.addString(js, _toggleActionClientId);
        js.append(");\n"); //$NON-NLS-1$
        JavaScriptUtil.addScriptOnLoad(js.toString());
    }
    //<tmg:a11y
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:24,代码来源:DataSourceIteratorRenderer.java


示例4: encodeEnd

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
@Override
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
	super.encodeEnd(context, component);

	// only working with the actual source row of the action event in here...
	if(component instanceof AbstractDataView.RowComponent) {
           AbstractDataView c = (AbstractDataView)component.getParent();
        String _toggleActionClientId = (String)HtmlUtil.readEncodeParameter(context, c, UIDataSourceIterator.TOGGLE_ACTION_CLIENT_ID, /*remove*/ true);
        if(null != _toggleActionClientId){
        	// flip the event client id... show vs hide... hide vs show...
        	if(_toggleActionClientId.contains(HIDE_DELIMITER)){
                _toggleActionClientId = _toggleActionClientId.replaceAll(HIDE_DELIMITER, SHOW_DELIMITER);
            }else if(_toggleActionClientId.contains(SHOW_DELIMITER)){
                _toggleActionClientId = _toggleActionClientId.replaceAll(SHOW_DELIMITER, HIDE_DELIMITER);
            }

            StringBuilder js = new StringBuilder();
            js.append("XSP.setFocus("); //$NON-NLS-1$
            JavaScriptUtil.addString(js, _toggleActionClientId);
            js.append(");\n"); //$NON-NLS-1$
            JavaScriptUtil.addScriptOnLoad(js.toString());
        }
	}
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:25,代码来源:AbstractWebDataViewRenderer.java


示例5: generateAnimation

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
public void generateAnimation(FacesContext context, StringBuilder b, JsonJavaObject o) {
	String id = getNodeClientId(context,getNode());
	
	b.append("var _id=dojo.byId("); //$NON-NLS-1$
	JavaScriptUtil.addString(b, id);
	b.append(");\n"); //$NON-NLS-1$
	
	o.put("node", new JsonReference("_id")); //$NON-NLS-1$ //$NON-NLS-2$
	
	// Add the dynamic attribute
	List<Parameter> lp = getAttributes();
	if(lp!=null) {
		for( Parameter p: lp) {
			String name = p.getName();
			if(StringUtil.isNotEmpty(name)) {
				String value = p.getValue();
				o.put(name, new JsonReference(value));
			}
		}
	}
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:22,代码来源:AbstractDojoEffectAction.java


示例6: getEventScript

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
/**
 * Get the script for a component event. 
 * @param component
 * @param eventName
 * @param submitValue
 * @return
 */
public static String getEventScript(FacesContext context, XspEventHandler handler, String submitValue) {
    // If none, look for an event handler
    if(handler!=null) {
        if(StringUtil.isNotEmpty(submitValue)) {
            StringBuilder b = new StringBuilder();
            b.append("XSP.setSubmitValue("); // $NON-NLS-1$
            JavaScriptUtil.addString(b, submitValue);
            b.append(");"); // $NON-NLS-1$
            String s = EventHandlerRenderer.getFireEventFunction(context,handler);
            b.append(s);
            return b.toString();
        } else {
            return EventHandlerRenderer.getFireEventFunction(context,handler);
        }
    }
    return null;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:25,代码来源:EventHandlerUtil.java


示例7: writeCollapsedLink

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
protected void writeCollapsedLink(FacesContext context, ResponseWriter w, UINavbar c) throws IOException {
    String dataTargetClass = "." + JavaScriptUtil.encodeFunctionName(context, c, "collapse-target"); //$NON-NLS-1$ $NON-NLS-2$
    w.startElement("button", c); // $NON-NLS-1$
    w.writeAttribute("type", "button",  null); // $NON-NLS-1$ $NON-NLS-2$
    w.writeAttribute("aria-label", (String)getProperty(PROP_NAVBARCOLLAPSEBUTTON_ARIALABEL),  null); // $NON-NLS-1$
    w.writeAttribute("class", (String)getProperty(PROP_NAVBARCOLLAPSEBUTTON_CLASS), null); // $NON-NLS-1$
    w.writeAttribute("data-toggle", "collapse", null); // $NON-NLS-1$ $NON-NLS-2$
    w.writeAttribute("data-target", dataTargetClass, null); // $NON-NLS-1$
    
    w.startElement("span", c); // $NON-NLS-1$
    w.writeAttribute("class", "sr-only", null); // $NON-NLS-1$ $NON-NLS-2$
    w.writeText((String)getProperty(PROP_NAVBARCOLLAPSEBUTTON_ARIALABEL),  null);
    w.endElement("span"); // $NON-NLS-1$
    
    w.startElement("span", c); // $NON-NLS-1$
    w.writeAttribute("class", "icon-bar", null); // $NON-NLS-1$ $NON-NLS-2$
    w.endElement("span"); // $NON-NLS-1$
    w.startElement("span", c); // $NON-NLS-1$
    w.writeAttribute("class", "icon-bar", null); // $NON-NLS-1$ $NON-NLS-2$
    w.endElement("span"); // $NON-NLS-1$
    w.startElement("span", c); // $NON-NLS-1$
    w.writeAttribute("class", "icon-bar", null); // $NON-NLS-1$ $NON-NLS-2$
    w.endElement("span"); // $NON-NLS-1$
    
    w.endElement("button"); // $NON-NLS-1$
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:27,代码来源:NavbarRenderer.java


示例8: writeHeading

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
protected void writeHeading(FacesContext context, ResponseWriter w, UINavbar c, boolean linksExist) throws IOException {
    if(linksExist) {
        writeCollapsedLink(context, w, c);
    }
    
    // start collapse container div
    w.startElement("div", c); // $NON-NLS-1$
    // SPR #BGLN9ZCMXK Custom collapse class for each navbar needed
    //w.writeAttribute("class", "collapse navbar-collapse " + JavaScriptUtil.encodeFunctionName(context, component, "collapse-target"), null); // $NON-NLS-1$ $NON-NLS-2$ //$NON-NLS-3$
    String collapseClass  = (String)getProperty(PROP_NAVBARCOLLAPSE_CONTAINER);
    String collapseTarget = (Boolean)getProperty(PROP_NAVBARCOLLAPSE_TARGET) ? JavaScriptUtil.encodeFunctionName(context, c, "collapse-target") : ""; // $NON-NLS-1$ $NON-NLS-2$
    collapseClass = ExtLibUtil.concatStyleClasses(collapseClass, collapseTarget);
    
    if(StringUtil.isNotEmpty(collapseClass)) {
        w.writeAttribute("class", collapseClass, null); // $NON-NLS-1$
    }
    
    // write navbar brand
    writeBrand(context, w, c);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtLibX,代码行数:21,代码来源:NavbarRenderer.java


示例9: setupSubmitOnClick

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
protected void setupSubmitOnClick( String welcomeBoxID, String sourceId) throws IOException {
	String execId = null;
	String refreshId = welcomeBoxID;
	final String event = "onclick"; // $NON-NLS-1$
	StringBuilder buff = new StringBuilder();
	JavaScriptUtil.appendAttachPartialRefreshEvent(buff, sourceId, sourceId, execId, event,
	/* clientSideScriptName */null,
	/* immediate */JavaScriptUtil.VALIDATION_NONE,
	/* refreshId */refreshId,
	/* onstart getOnStart(pager) */"",
	/* oncomplete getOnComplete(pager) */"",
	/* onerror getOnError(pager) */"");
	String script = buff.toString();

	// Add the script block we just generated.
	JavaScriptUtil.addScriptOnLoad(script);
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:18,代码来源:WelcomeBoxRenderer.java


示例10: postRenderTree

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
@Override
protected void postRenderTree(FacesContext context, ResponseWriter writer, TreeContextImpl tree) throws IOException {
    UIScriptCollector collector = UIScriptCollector.find();
    
    script.append("return "); // $NON-NLS-1$
    script.append(varName);
    script.append(";\n"); // $NON-NLS-1$
    script.append("}\n"); // $NON-NLS-1$
    collector.addScript(script.toString());

    script.setLength(0);
    script.append("function "); // $NON-NLS-1$
    script.append(menuEventName);
    script.append("(thisEvent){"); // $NON-NLS-1$
    script.append("XSP.openMenu(thisEvent,"); // $NON-NLS-1$
    script.append(menuCtorName);
    script.append(");}\n"); // $NON-NLS-1$
    
    // Connect the menu to the id
    script.append("dojo.connect(dojo.byId("); // $NON-NLS-1$
    JavaScriptUtil.addString(script, getConnectId());
    script.append("),");
    JavaScriptUtil.addString(script, getConnectEvent());
    script.append(",");
    script.append(menuEventName);
    script.append(");\n"); // $NON-NLS-1$

    collector.addScriptOnLoad(script.toString());
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:30,代码来源:DojoMenuRenderer.java


示例11: writeHeaderCheckBoxColumn

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
protected void writeHeaderCheckBoxColumn(FacesContext context, ResponseWriter w, AbstractDataView c, ViewDefinition viewDef) throws IOException {
    w.startElement("th",c); // $NON-NLS-1$
    w.writeAttribute("scope", "col", null); // $NON-NLS-1$ $NON-NLS-2$
    String colClazz = (String)getProperty(PROP_TABLEFIRSTCELLCLASS);
    if(StringUtil.isNotEmpty(colClazz)) {
        w.writeAttribute("class",colClazz,null); // $NON-NLS-1$
    }
    if(viewDef.hasHeaderCheckBoxColumn) {
        String fldName = c.getClientId(context)+":_hdrcbox"; // $NON-NLS-1$
        w.startElement("input",c); // $NON-NLS-1$
        w.writeAttribute("type","checkbox",null); // $NON-NLS-1$ $NON-NLS-2$
        w.writeAttribute("name",fldName,null); // $NON-NLS-1$
        w.writeAttribute("id",fldName,null); // $NON-NLS-1$
        // Specify title attribute for accessibility
        String title = "Select all rows"; // $NLS-DataViewRenderer_HeaderCheckboxTitle-1$
        w.writeAttribute("title",title,null); // $NON-NLS-1$
        w.writeAttribute("role", "checkbox", null);// $NON-NLS-1$ // $NON-NLS-2$
        
        //Add JS onclick code to handle toggling aria-checked attribute
        writeHeaderCheckboxAccessibilityAttributes(context, w, c.getClientId(context), fldName);
        
        StringBuilder sBuf = new StringBuilder(256); //$NON-NLS-1$
        sBuf.append("XSP.attachViewColumnCheckboxToggler("); //$NON-NLS-1$
        JavaScriptUtil.addString(sBuf, c.getClientId(context));
        sBuf.append(", "); //$NON-NLS-1$
        JavaScriptUtil.addString(sBuf, c.getClientId(context));
        sBuf.append("); "); //$NON-NLS-1$
        
        JavaScriptUtil.addScriptOnLoad(sBuf.toString());
        
    }
    
    w.endElement("th"); // $NON-NLS-1$
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:35,代码来源:DataViewRenderer.java


示例12: writeCollapsibleInput

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
protected void writeCollapsibleInput(FacesContext context, ResponseWriter w, UIWidgetContainer c) throws IOException {
    if(c.isCollapsible()) {
        // Add a hidden field to cary out the section state
        String id = c.getClientId(context);
        boolean closed = c.isClosed();
        w.startElement("input",c);  // this is for the uistate $NON-NLS-1$
        w.writeAttribute("id",id + _INITCLOSED,null); // $NON-NLS-1$
        w.writeAttribute("name",id + _INITCLOSED,null); // $NON-NLS-1$
        w.writeAttribute("type","hidden",null); // $NON-NLS-1$ $NON-NLS-2$
        w.writeAttribute("value",Boolean.toString(closed),null);     // closed = true means section will be closed $NON-NLS-1$
        w.endElement("input"); // $NON-NLS-1$
        
        // Initialize the script for the links
        StringBuilder buff = new StringBuilder();
        JavaScriptUtil.appendInitSectionScript(
                context, 
                buff, 
                id+_LKCLOSED,
                id,
                true); 
        JavaScriptUtil.appendInitSectionScript(
                context, 
                buff, 
                id+_LKOPENED,
                id,
                false); 
        JavaScriptUtil.addScriptOnLoad(buff.toString());
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:30,代码来源:WidgetContainerRenderer.java


示例13: renderJavaScriptBinding

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
@Override
protected void renderJavaScriptBinding(FacesContext context, ResponseWriter writer, UIInput component) {
    StringBuilder sb = new StringBuilder();
    String clientId = component.getClientId(context);
    String name = getNameAttribute(context, component)+HIDDEN_SUFFIX;
    
    // dijit.byId("view:_id1:djToggleButton1").setChecked(dojo.byId("view:_id1:djToggleButton1_field").value=="on");\n
    sb.append("dijit.byId("); //$NON-NLS-1$
    JavaScriptUtil.addString(sb,clientId);
    sb.append(").setChecked(dojo.byId("); //$NON-NLS-1$
    JavaScriptUtil.addString(sb,name);
    sb.append(").value=="); //$NON-NLS-1$
    JavaScriptUtil.addString(sb,"on"); //$NON-NLS-1$
    sb.append(");\n"); //$NON-NLS-1$
    
    // dojo.connect(dijit.byId("view:_id1:djToggleButton1"),"onClick",function(){
    //   dojo.byId("view:_id1:djToggleButton1_field").value=dijit.byId("view:_id1:djToggleButton1").attr("checked")?"on":""
    // });
    sb.append("dojo.connect(dijit.byId("); //$NON-NLS-1$
    JavaScriptUtil.addString(sb,clientId);
    sb.append("),"); //$NON-NLS-1$
    JavaScriptUtil.addString(sb,"onClick"); //$NON-NLS-1$
    sb.append(",function(){dojo.byId("); //$NON-NLS-1$
    JavaScriptUtil.addString(sb,name);
    sb.append(").value=dijit.byId("); //$NON-NLS-1$
    JavaScriptUtil.addString(sb,clientId);
    sb.append(").attr("); //$NON-NLS-1$
    JavaScriptUtil.addString(sb,"checked"); //$NON-NLS-1$
    sb.append(")?"); //$NON-NLS-1$
    JavaScriptUtil.addString(sb,"on"); //$NON-NLS-1$
    sb.append(":"); //$NON-NLS-1$
    JavaScriptUtil.addString(sb,""); //$NON-NLS-1$
    sb.append("});"); //$NON-NLS-1$
    
    ((UIViewRootEx)context.getViewRoot()).addScriptOnLoad(sb.toString());
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:37,代码来源:DojoToggleButtonRenderer.java


示例14: encodeDojoEvents

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
protected static void encodeDojoEvents(FacesContext context, UIDojoWidgetBase component,
        String eventName, String eventValue) throws IOException {
    if(eventValue != null) {
        StringBuilder buff = new StringBuilder();
        String clientId = component.getClientId(context);
        // if event value set
        // state the function
        String clientSideScriptName =  JavaScriptUtil.startMethodJS(context, component, "clientSide_" + eventName, buff); // $NON-NLS-1$
        // add scripts to the function block
        buff.append( eventValue );
        buff.append("\n"); // $NON-NLS-1$
        JavaScriptUtil.endMethodJS(buff);

        boolean submit = false; // clientSide script only
        int validationMode = JavaScriptUtil.VALIDATION_FULL; // since not submit, not immediate
        // XSP.attachEvent
        JavaScriptUtil.appendAttachEvent(buff, clientId, clientId, eventName, clientSideScriptName, submit, validationMode);
        buff.append("\n"); // $NON-NLS-1$

        if( buff.length() == 0 ){
            // no events
            return;
        }
        // then add the script block we just generated.
        // when using dojo, can't just put onload code inline into the page,
        // as the dojo dom manipulation won't have happened by then.
        // Have to put it into an addOnLoad method.
        JavaScriptUtil.addScriptOnLoad(buff.toString());
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:31,代码来源:DojoWidgetBaseRenderer.java


示例15: invoke

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
@Override
   public Object invoke(FacesContext context, Object[] params) throws EvaluationException, MethodNotFoundException {
	StringBuilder b = new StringBuilder(256);
	
	String text = getText();
	if(text==null) {
		text = ""; //$NON-NLS-1$
	}
	b.append("alert("); //$NON-NLS-1$
	JavaScriptUtil.addString(b, text);
	b.append(");\n"); //$NON-NLS-1$
	
       return b.toString();
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:15,代码来源:AlertClientAction.java


示例16: invoke

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
public FBSValue invoke(HttpServletRequest request, int id, Object params) throws Exception {
    String scriptStr = getScript();
    if(StringUtil.isNotEmpty(scriptStr)) {
        JavaScriptInterpreter interpreter = JavaScriptUtil.getInterpreter(FacesContext.getCurrentInstance());
        FBSObject paramObject = getParamObject(interpreter, getArguments(), (ArrayObject)params);
        // As part of SPR#MKEE9M5JQ2, changing this from passing in 
        // the script String to passing the Expression, to avoid the try{}catch(Exception) block
        // in the method taking the String argument. 
        JSExpression scriptExpr = JavaScriptUtil.getJSContext().getExpression(scriptStr);
        FBSValue value = (FBSValue)interpreter.interpret(getComponent(), scriptExpr, paramObject );
        return value;
    }
    return FBSNull.nullValue;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:15,代码来源:RemoteMethod.java


示例17: generateClientScript

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
public String generateClientScript() {
	FacesContext context = FacesContext.getCurrentInstance();
    StringBuilder b = new StringBuilder();
    // TabContainer.js has:
    // _removeTab: function(id,refreshId,params)
    b.append("dijit.byId("); // $NON-NLS-1$
    JavaScriptUtil.addString(b, container.getClientId(context));
    b.append(")._removeTab("); // $NON-NLS-1$
    JavaScriptUtil.addString(b, pane.getClientId(context));
    
    String rid=ExtLibUtil.getClientId(context,container,refreshId,true);
    if(StringUtil.isNotEmpty(rid)) {
        b.append(",");
        JavaScriptUtil.addString(b, rid);
        
        Object params = refreshParams;
        if(params!=null) {
            b.append(",{");
            try {
                String json = JsonGenerator.toJson(JsonJavaFactory.instance,params,true);
                b.append(json);
            } catch(Exception ex) {
                throw new FacesExceptionEx(ex);
            }
            b.append("}");
        }
    }
    b.append(");");

    if(b.length()>0) {
        String script = b.toString();
        return script;
    }
    
    return null;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:37,代码来源:UIDojoTabContainer.java


示例18: getCommonName

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
protected String getCommonName(Session session, String id, Name n) throws NotesException {
	// Ref SPR# PHAN94NCQA - account for LDAP server
    if(!StringUtil.equalsIgnoreCase(id, "Anonymous")) {  // $NON-NLS-1$
        String ldapName = (String)session.evaluate("@NameLookup([NoUpdate];\""+JavaScriptUtil.toJavaScriptString(id)+"\";\"cn\")").firstElement(); // $NON-NLS-1$ // $NON-NLS-2$ // $NON-NLS-3$ 
        if(!StringUtil.isSpace(ldapName)) {
            return ldapName;
        }
    }
    return n.getCommon();
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:11,代码来源:DominoUserBeanDataProvider.java


示例19: encodeEnd

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
@Override
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
	super.encodeEnd(context, component);
	if (context == null || component == null){
		throw new IOException();
	}
	if (!component.isRendered()){
		return;
	}
	UIComponent columnHeader = component.getParent();
	if (columnHeader == null){
		return;
	}
	UIComponent column = columnHeader.getParent();
	if (column == null){
		return;
	}
	UIComponent columnCheckbox = findInternalColumnCheckbox(column);
	if (columnCheckbox == null){
		return;
	}
	String viewPanelId = column.getParent().getClientId(context);
	String columnAndCheckBoxId = columnCheckbox.getClientId(context);
	columnAndCheckBoxId = columnAndCheckBoxId.substring(viewPanelId.length() + 1);

	//XSP.attachViewColumnCheckboxToggler("view:form1:viewPanel1", "view:form1:viewPanel1:_id1:_hdrcbox", "_id1:_id2");
	//args: ("viewPanelID", "viewColumnHeaderCheckboxID", "columnID + checkboxID");
	
	StringBuilder js = new StringBuilder(256); //$NON-NLS-1$
	js.append("XSP.attachViewColumnCheckboxToggler("); //$NON-NLS-1$
	JavaScriptUtil.addString(js, viewPanelId);
	js.append(", "); //$NON-NLS-1$
	JavaScriptUtil.addString(js, column.getClientId(context));
	js.append("); "); //$NON-NLS-1$
	
	JavaScriptUtil.addScriptOnLoad(js.toString());
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:38,代码来源:ViewHeaderCheckboxRenderer.java


示例20: writeErrorSummaryButton

import com.ibm.xsp.util.JavaScriptUtil; //导入依赖的package包/类
protected void writeErrorSummaryButton(FacesContext context, ResponseWriter w, FormLayout c, String id, String shadeId) throws IOException {
    w.startElement("input", c); // $NON-NLS-1$
    w.writeAttribute("type", "button", null); // $NON-NLS-1$ $NON-NLS-2$
    w.writeAttribute("value", "OK", null); //$NON-NLS-1$ $NLS-MobileFormTableRenderer_iphone.OK-2$
    StringBuilder b = new StringBuilder();
    b.append("XSP.hideMobileFormTableError("); // $NON-NLS-1$
    JavaScriptUtil.addString(b, id);
    b.append(","); // $NON-NLS-1$
    JavaScriptUtil.addString(b, shadeId);
    b.append(");"); // $NON-NLS-1$
    w.writeAttribute("onclick", b, null); // $NON-NLS-1$
    w.endElement("input"); // $NON-NLS-1$
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:14,代码来源:MobileFormTableRenderer.java



注:本文中的com.ibm.xsp.util.JavaScriptUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConfigLocationLiteVo类代码示例发布时间:2022-05-15
下一篇:
Java AuthDialog类代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap