小编Joh*_*lez的帖子

jsf html标签里面的值

我有这个命令按钮,我需要使用Bootstrap 3添加一个图标.

<h:commandButton  id="logoutButton" action="#{loginController.logout()}" class="btn btn-primary" style="margin-top: 10px;margin-left: 10px;" value="Log Out"></h:commandButton>
Run Code Online (Sandbox Code Playgroud)

由于引导3的原因,图标在span标记中,所以我试图将它添加到命令按钮中的value属性,如下所示:

<h:commandButton  id="logoutButton" action="#{loginController.logout()}" class="btn btn-primary" style="margin-top: 10px;margin-left: 10px;" value="<span class="glyphicon glyphicon-log-out"></span>Log Out"></h:commandButton>
Run Code Online (Sandbox Code Playgroud)

我有一个错误,我想我不能在value属性中添加html标签,有没有一种简单的方法可以做到这一点?

html jsf-2 twitter-bootstrap-3

8
推荐指数
1
解决办法
9196
查看次数

JavaFX ControlFX对话框中的Action Buttons css样式

我一直在使用ControlsFX对话框来显示信息,但我的应用程序的样式不是蓝色,并且不匹配对话框样式(颜色,边框)有没有办法更改按钮颜色或样式?

java user-interface javafx controlsfx

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

Primefaces对话框actionlistener在更新时不会触发

好的,这个问题让我疯了......

我有这个xhtml页面,有2个对话框......两个对话框里面都有一个表单来向服务器发送提交,它们工作正常,但是当它们从commandLink表单调用和更新时,来自对话框表单的actionListener就没有了工作,任何想法?

这是我调用对话框的菜单

<ui:define name="left">
    <h:form id="menuForm">
        <div class="sidebar-nav">
            <div class="well" style="width:150px; padding: 8px 0;">
                <ul class="nav nav-list"> 
                    <li class="text-center">Options</li>        
                    <li><p:commandLink id="createLink" update=":LocationCreateForm" actionListener="#{locationController.prepareCreate}" oncomplete="LocationCreateDialog.show()"><span class="glyphicon glyphicon-user"></span> Create New</p:commandLink> </li>
                    <li><p:commandLink id="editLink" update=":LocationEditForm" oncomplete="LocationEditDialog.show()"><span class="glyphicon glyphicon-edit"></span> Update</p:commandLink> </li>
                    <li><p:commandLink id="deleteLink" actionListener="#{locationController.delete}"><span class="glyphicon glyphicon-ban-circle"></span> Delete</p:commandLink> </li>
                </ul>
            </div>
        </div>
    </h:form>
</ui:define>
Run Code Online (Sandbox Code Playgroud)

如果我从commandLink删除更新它们工作,但对于编辑对话框我无法获取要编辑的信息.

对话框和列表在哪里:

<ui:define name="content">
    <h1>Locations</h1>
    <!-- Location List -->
    <h:form id="LocationListForm">

        <p:dataTable id="datalist" value="#{locationController.items}" var="item"
                     selectionMode="single" selection="#{locationController.selected}"
                     rowKey="#{item.id}"

                     >

            <p:column sortBy="#{item.id}" filterBy="#{item.id}">
                <f:facet name="header">
                    <h:outputText value="#{myBundle.ListLocationTitle_id}"/>
                </f:facet>
                <h:outputText value="#{item.id}"/>
            </p:column> …
Run Code Online (Sandbox Code Playgroud)

jsf primefaces

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

Spring 和 thymeleaf 布局方言不起作用

我是 Spring 和 thymeleaf 的新手,我正在使用 JSF + Facelets,所以我选择了 thymeleaf 布局方言的方法,因为它与 Facelets 非常相似,但是,由于某种原因,它在我的简单项目中不起作用。

我的配置文件中有这个

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;

public class AppInitializer implements WebApplicationInitializer {

    @Override
    public void onStartup(ServletContext sc) throws ServletException {

        AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
        applicationContext.register(WebConfig.class);

    }

}
Run Code Online (Sandbox Code Playgroud)

配置文件

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;


@Configuration
@EnableWebMvc
@Import(ThymeLeafConfig.class)
public class WebConfig extends WebMvcConfigurerAdapter {

    @Override
    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
        configurer.enable();
    }

}
Run Code Online (Sandbox Code Playgroud)

我的 TyhmeLeafConfig

import nz.net.ultraq.thymeleaf.LayoutDialect;
import org.springframework.context.annotation.Bean;
import org.thymeleaf.spring4.SpringTemplateEngine; …
Run Code Online (Sandbox Code Playgroud)

java spring spring-mvc thymeleaf

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