小编Ola*_*ock的帖子

如何使 AUI 验证仅在选中复选框时应用?

我有一个 aui 表单中的字段,我只想在选中相应的复选框时需要这些字段,否则不需要它们。<aui:script>一旦启用复选框,我将启用这些输入字段,只有这样 aui 验证才可以工作。

我尝试过隐藏<aui:validator>脚本中的依赖条件。

仅当在 aui 中选中我的复选框时,如何启用验证?

<aui:form action="" method="post">
<aui:input type="checkbox" name="employeeId" id="employeeId"></aui:input>

<div id="employeeDetails">
    <aui:input type="text" name="name" id="employeeId2">
        <%
            if (true) { //default i kept true how to check this condition on check box basic
        %>
        <aui:validator name="required"'  />
        <%
            }
        %>
    </aui:input>
    <aui:input type="text" name="email" id="employeeId3">
        <%
            if (true) {
        %>
        <aui:validator name="required" />
        <%
            }
        %>

    </aui:input>
</div>
<aui:button-row>
    <aui:button type="submit" />
</aui:button-row>
</aui:form>

<aui:script>
AUI().use('event', 'node', function(A) {
   A.one('#employeeDetails').hide(); …
Run Code Online (Sandbox Code Playgroud)

liferay alloy-ui liferay-aui

3
推荐指数
1
解决办法
2669
查看次数

我无法在liferay 7.1中通过终端连接gogo shell?

我无法在 linux telnet localhost 11311中使用以下命令连接 gogo shell

面临错误 telnet: 无法连接到远程主机: 连接被拒绝

liferay liferay-7.1

3
推荐指数
1
解决办法
3232
查看次数

如何将Liferay与Mysql数据库连接起来

我是Liferay的新人.我想将Liferay与MySQL数据库连接起来.我正在使用Liferay CE(版本? - 与tomcat捆绑(6.0.29)).请告诉我这个步骤.谢谢

database liferay

2
推荐指数
1
解决办法
2万
查看次数

如何在Liferay中使用“角色名称”获取RoleId?

有什么方法可以使用“角色名称”获取RoleId?我已经在门户上创建了一些自定义角色,例如“项目经理”,“客户”和“交货负责人”。现在,我需要使用“角色名称”以编程方式获取这些自定义角色的相应角色。

有什么建议么?

liferay liferay-6

2
推荐指数
1
解决办法
1996
查看次数

如何在liferay中阅读文本文件?

我试图用这段代码从控制器类中读取一个文件

    ReadFile readFile = new ReadFile();
    String text = readFile.readFile("\resources\testing.txt");
    renderRequest.setAttribute("text", text);
Run Code Online (Sandbox Code Playgroud)

我从view.jsp中获取了它

    <%
    String content = (String)request.getAttribute("text");
    %>
Run Code Online (Sandbox Code Playgroud)

但我得到文件未找到异常.获取文件内容的方法是什么.

java

2
推荐指数
1
解决办法
1638
查看次数

使用 apache-poi 4.0.1 库将单元格内容的某些部分设置为粗体/斜体

我想用粗体和斜体的组合来设置单元格值的内容。例如“这是示例 内容”。

但是,使用 XSSFrichTextString 时这不起作用。

我正在使用 apache poi 库版本 4.0.1。我尝试使用 XSSFRichTextString 将内容设为粗体和斜体组合。我通过在方法 cell1Value.append("sample ", fontBold); 即字符串和字体中传递两个参数来附加字符串。

    XSSFRichTextString cell1Value= new XSSFRichTextString("This is ");
    XSSFFont fontBold= wb.createFont();
    fontBold.setBold(true); //set bold
    fontBold.setUnderline(HSSFFont.U_SINGLE);


    XSSFFont fontItalic= wb.createFont();
    fontItalic.setItalic(true); //set italic

    cell1Value.append("sample ",fontBold);
    cell1Value.append("content", fontItalic);

    System.err.println(cell1Value.getCTRst());

    Cell cell1 = row.createCell(0);
    cell1.setCellValue(cell1Value);
Run Code Online (Sandbox Code Playgroud)

我期望“样本”为粗体,“内容”为斜体。但是,下划线工作正常,并且我的“示例”单词下划线正确。请建议我缺少什么?

java excel apache-poi

2
推荐指数
1
解决办法
4309
查看次数

动态生成多个 from() Apache Camel RouteBuilder

我使用的是camel-core 2.24.1并且能够执行以下操作:

from( sources.toArray(new String[0]) )
Run Code Online (Sandbox Code Playgroud)

其中,sources 是我从配置设置中获取的 URI 列表。我正在尝试更新代码以使用 Camel 3(camel-core 3.0.0-RC2),但上面提到的方法已被删除,我找不到其他方法来完成相同的操作。

基本上我需要这样的东西:

from( String uri : sources )
{
   // add the uri as from(uri) before continuing with the route
}
Run Code Online (Sandbox Code Playgroud)

如果这有助于更好地理解,最终路线应如下所示:

from( String uri : sources )
{
   // add the uri as from(uri) before continuing with the route
}
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激。

java apache-camel

2
推荐指数
1
解决办法
889
查看次数

如何使用 apache poi 获取子形状的绝对位置

这是一个带有子形状的 groupShape:

<p:nvgrpsppr> 
   <p:cnvpr name="Group 256" id="260" /> 
   <p:cnvgrpsppr> 
    <a:grpsplocks nochangeaspect="1" /> 
   </p:cnvgrpsppr> 
   <p:nvpr /> 
  </p:nvgrpsppr> 
  <p:grpsppr bwmode="auto"> 
   <a:xfrm> 
    <a:off y="1940518" x="2952779" /> 
    <a:ext cy="2209679" cx="1219680" /> 
    <a:choff y="1052" x="1972" /> 
    <a:chext cy="1116" cx="616" /> 
   </a:xfrm> 
   <a:solidfill> 
    <a:srgbclr val="F7B63E" /> 
   </a:solidfill> 
  </p:grpsppr> 
  <p:sp> 
   <p:nvsppr> 
    <p:cnvpr name="Freeform 257" id="262" /> 
    <p:cnvsppr> 
     <a:splocks noeditpoints="1" /> 
    </p:cnvsppr> 
    <p:nvpr /> 
   </p:nvsppr> 
   <p:sppr bwmode="auto"> 
    <a:xfrm> 
     <a:off y="1160" x="2161" /> 
     <a:ext cy="287" cx="288" /> 
    </a:xfrm>
   </p:sppr>
  </p:sp>
Run Code Online (Sandbox Code Playgroud)

当我取消分组时,得到这个:

  <p:grpsppr> 
   <a:xfrm> 
    <a:off y="0" x="0" /> 
    <a:ext cy="0" …
Run Code Online (Sandbox Code Playgroud)

java openxml shapes apache-poi

2
推荐指数
1
解决办法
715
查看次数

apache maven 构建失败 - 无法执行目标 org.apache.felix:maven-bundle-plugin:4.2.0:manifest

我想通过以下位置的文章安装“iText RUPS”

https://github.com/itext/i7j-rups

在命令提示符中输入:“mvn clean package”后,我得到:

[信息] --- maven-bundle-plugin:4.2.0:manifest (bundle-manifest) @ itext-rups ---

[错误] 发生内部错误 java.util.ConcurrentModificationException

at java.util.TreeMap.callMappingFunctionWithCheck (TreeMap.java:742)
at java.util.TreeMap.computeIfAbsent (TreeMap.java:558)
at aQute.bnd.osgi.Jar.putResource (Jar.java:288)
at aQute.bnd.osgi.Jar$1.visitFile (Jar.java:202)
at aQute.bnd.osgi.Jar$1.visitFile (Jar.java:177)
at java.nio.file.Files.walkFileTree (Files.java:2804)
at aQute.bnd.osgi.Jar.buildFromDirectory (Jar.java:176)
at aQute.bnd.osgi.Jar.<init> (Jar.java:119)
at aQute.bnd.osgi.Jar.<init> (Jar.java:172)
at org.apache.felix.bundleplugin.BundlePlugin.getOSGiBuilder (BundlePlugin.java:603)
at org.apache.felix.bundleplugin.ManifestPlugin.getAnalyzer (ManifestPlugin.java:285)
at org.apache.felix.bundleplugin.ManifestPlugin.execute (ManifestPlugin.java:111)
at org.apache.felix.bundleplugin.BundlePlugin.execute (BundlePlugin.java:364)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at …
Run Code Online (Sandbox Code Playgroud)

plugins bundle maven apache-felix

2
推荐指数
1
解决办法
5302
查看次数

复制和更改 .docx 表中的行

我正在使用 Apache POI 处理 .docx 文件。

我有 .docx ,其中有1 行、1 列表

XWPFTable table = document.getTables().get(0);
XWPFTableRow copiedRow = table.getRow(0);
table.addRow(copiedRow);
Run Code Online (Sandbox Code Playgroud)

上面的代码成功复制了行,因此表现在有2 rows


但是,我也想改变复制的行。

XWPFTable table = document.getTables().get(0);
XWPFTableRow copiedRow = table.getRow(0);
copiedRow.getTableCells().get(0).setText("SOME MODIFICATION HERE"); // <- setting some data
table.addRow(copiedRow);
Run Code Online (Sandbox Code Playgroud)

问题是......修改影响了行。原来的第一个和刚刚添加的第二个都会受到影响。


我还尝试显式构造新行,如下所示:

copiedRow.getTableCells().get(0).setText("SOME MODIFICATION");
XWPFTableRow newRow = new XWPFTableRow(copiedRow.getCtRow(), table);
table.addRow(newRow); 
Run Code Online (Sandbox Code Playgroud)

...但结果仍然相同:两行都被修改,而不仅仅是第二行。

我试图使示例尽可能简单。谢谢你的帮助!

java docx apache-poi xwpf

2
推荐指数
1
解决办法
1441
查看次数