powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Java [игнор отключен] [закрыт для гостей] / facelets jsfc
1 сообщений из 1, страница 1 из 1
facelets jsfc
    #34868290
nonsense_name
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
вопрос знатокам.

1) Кто-нибудь понял, как использовать jsfc для СВОИХ сложных компонентов? Все, что я видел в примерах - это jsfc="h:inputText","h:commandButton", "h:form". То есть для простых комопонентов, которые рендерятся в 1 простой тег html. Как насчет хотя бы jsfc="h:datatable" или самодельного "custom:tree" ?? чем его представлять?
Код: plaintext
<div jsfc="custom:tree" id="tree" value="#{treeTable.treeModel}" var="node">...</div>
?

2) может ли с этим помочь объявление в таглибе своего компонента?

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
<facelet-taglib>
  <namespace>http://www.mycompany.com/jsf</namespace>
  <tag>
    <tag-name>bar</tag-name>
    <component>
      <component-type>javax.faces.Data</component-type>
      <renderer-type>com.mycompany.Bar</renderer-type>
    </component>
  </tag>
</facelet-taglib>
3) и зачем могут потребоваться тагХандлеры? невнятно написано в доке Jacob Hookom.

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
 public   final   class  IfHandler  extends  TagHandler {

     protected   final  TagAttribute test;
     protected   final  TagAttribute var;

     public  IfHandler(TagConfig config) {
         super (config);
         this .test =  this .getRequiredAttribute("test");
         this .var =  this .getAttribute("var");
    }

     public   void  apply(FaceletContext ctx, UIComponent parent)
             throws  IOException, FacesException, ELException {
         boolean  b =  this .test.getBoolean(ctx);
         if  ( this .var !=  null ) {
            ctx.setAttribute(var.getValue(ctx),  new   Boolean (b));
        }
         if  (b) {
             this .nextHandler.apply(ctx, parent);
        }
    }
}
<facelet-taglib>
  <namespace>http://www.jsfcentral.com/public</namespace>
  <tag>
    <tag-name> if </tag-name>
    <handler- class >com.jsfcentral.IfHandler</handler- class >
  </tag>
</facelet-taglib>


Спасибо.
...
Рейтинг: 0 / 0
1 сообщений из 1, страница 1 из 1
Форумы / Java [игнор отключен] [закрыт для гостей] / facelets jsfc
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]