我正在构建一系列可视复合组件,它们使用类似/常用的"连接"方法,这些方法会激活内部表格等.
我正在自动化一些连接的东西,以便在运行时自动连接.如何在组件级别告诉当前状态是运行时还是设计时?
无法弄清楚如何将php文件导入我的joomla组件 - 所有这些都失败了:
有任何想法吗?谢谢
我们正在将JSF1.2迁移到JSF2应用程序,我遇到了自定义组件的问题.我们有一个带有组件的独立罐子,在那个罐子里我有这个:
@FacesComponent(value = "Panel2")
public class Panel2 extends UIOutput { ... }
Run Code Online (Sandbox Code Playgroud)
在我的META-INF下的taglib中我有这样的:
<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
id="mw">
<namespace>http://www.ssss.be/jsf/mw</namespace>
<composite-library-name>mw</composite-library-name>
<tag>
<tag-name>panel2</tag-name>
<component>
<component-type>Panel2</component-type>
</component>
</tag>
</facelet-taglib>
Run Code Online (Sandbox Code Playgroud)
在制作了一个这样的jar并在我的其他项目中使用它之后,我使用如下标记:
xmlns:mw="http://www.sofico.be/jsf/mw"
Run Code Online (Sandbox Code Playgroud)
然后:
<mw:panel2 />
Run Code Online (Sandbox Code Playgroud)
但不幸的是结果:
javax.faces.FacesException: Expression Error: Named Object: Panel2 not found. at com.sun.faces.application.ApplicationImpl.createComponentApplyAnnotations(ApplicationImpl.java:1858)
at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:1129)
Run Code Online (Sandbox Code Playgroud)
我在这做错了什么?
我需要了解制作组件生成和管理子组件背后的基础知识.我最初尝试通过创建一个TCollection,并试图在每个上添加一个名称TCollectionItem.但我知道这并不像我希望的那么容易.
所以现在我将再次从头开始这个项目,这次我想说得对.这些子组件不是可视组件,不应该有任何显示或窗口,只是基于TComponent.保存这些子组件的主要组件也将基于TComponent.所以这里没有什么是视觉的,我不希望在我的表格(设计时间)上为每个子组件添加一个小图标.
我希望能够以类似集合的方式维护和管理这些子组件.重要的是应该创建,命名这些子组件并将其添加到表单源,就像菜单项一样.这是这个想法的重点,如果它们不能被命名,那么整个想法就是kaput.
哦,另一个重要的事情:作为所有子组件的父组件的主要组件需要能够将这些子组件保存到DFM文件中.
例:
而不是访问其中一个子项,如:
MyForm.MyItems[1].DoSomething();
Run Code Online (Sandbox Code Playgroud)
我宁愿喜欢这样做:
MyForm.MyItem2.DoSomething();
Run Code Online (Sandbox Code Playgroud)
所以我不必依赖于知道每个子项的ID.
编辑:
我觉得有必要包含我的原始代码,以便可以看到原始集合的工作原理.这是从整个单元中剥离的服务器端集合和集合项:
// Command Collections
// Goal: Allow entering pre-set commands with unique Name and ID
// Each command has its own event which is triggered when command is received
// TODO: Name each collection item as a named component in owner form
//Determines how commands are displayed in collection editor in design-time
TJDCmdDisplay = (cdName, cdID, cdCaption, cdIDName, cdIDCaption);
TJDScktSvrCmdEvent = …Run Code Online (Sandbox Code Playgroud) delphi delphi-7 tcollection custom-component tcollectionitem
我做了一个小小的Android应用。在其中,我需要一个带有多选功能的AlertDialog。但是我需要自定义按钮(单击按钮时它会隐藏,我们可以在此位置看到另一个按钮)。我知道了。但是,当我尝试通过单击自定义按钮将所有选择项设置为true时,我不知道该怎么做。因为我的onclicklistener中的自定义按钮没有
public void onClick(DialogInterface dialog, int index, boolean status)
{
}
Run Code Online (Sandbox Code Playgroud)
而且我不知道如何进入对话项目。我希望我的问题很清楚)添加我的所有代码:
protected Dialog onCreateDialog(int id) {
// AlertDialog.Builder
adb = new AlertDialog.Builder(this);
// multichoice from array and array of checked items
adb.setTitle("?????????");
adb.setMultiChoiceItems(category, category_chkd,
new DialogInterface.OnMultiChoiceClickListener() {
public void onClick(DialogInterface dialog, int which,
boolean isChecked) {
}
});
// dialog buttons from category_buttons.xml
cat_view = (RelativeLayout) getLayoutInflater().inflate(
R.layout.category_buttons, null);
adb.setView(cat_view);
cat_fill_btn = (Button) cat_view
.findViewById(R.id.category_fill_button);
cat_clean_btn = (Button) cat_view
.findViewById(R.id.category_clean_button);
cat_ok_btn = (Button) cat_view.findViewById(R.id.category_ok_button);
//AlertDialog
alert = adb.create();
//button …Run Code Online (Sandbox Code Playgroud) android custom-component android-alertdialog onclicklistener
我想构建一个自定义的JSF组件.现在我从oracle上读了一些文档,看了几个代码示例.问题是我有点困惑:
似乎有两种方法可以使用JSF 2.0+构建自定义组件.据我所知,自JSF 2.0以来我可以使用这些复合组件来构建我自己的组件.
但与"经典"组件相比,它们有任何缺点吗?
当我使用Compisite Components时,我的组件会相当复杂吗?
例如,我的Component将在java中有一些工作,这可能与Composite Components有关吗?
我在自定义视图(从a派生LinearLayout)中得到一个空指针异常,因为它找不到它的子视图.这是代码:
public class MyView extends LinearLayout
{
public MyView(Context context, AttributeSet attrs)
{
this(context, attrs, 0);
}
public MyView(Context context, AttributeSet attrs, int defStyle)
{
super(context, attrs, defStyle);
}
private TextView mText;
@Override
protected void onFinishInflate()
{
super.onFinishInflate();
mText = (TextView) findViewById(R.id.text);
if (isInEditMode())
{
mText.setText("Some example text.");
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是布局(my_view.xml):
<?xml version="1.0" encoding="utf-8"?>
<com.example.views.MyView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/text"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:ellipsize="end"
android:maxLines="4"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:text="Some text" />
</com.example.views.MyView>
Run Code Online (Sandbox Code Playgroud)
这是我把它放在XML文件中的方式: …
android custom-component android-custom-view layout-inflater
我正在写一个joomla组件,但它有许多文件夹和SQL表.我不打算手动制作包装.是否有任何已知的扩展,使我能够将我的组件作为zip文件提取,以使其可安装.
joomla components extraction custom-component joomla-extensions
我的程序中有几个JComboBox.我想以更宽的方式更改滚动条和箭头按钮的大小.我需要这个,因为我想在Windows平板电脑上使用这个程序,它太小了,无法用手指操作.有没有可能这样做?
JComboBox comboBox;
comboBox = new JComboBox(list_apple_device.toArray());
comboBox.setSelectedItem(null);
comboBox.setFont(schrift);
comboBox.setBounds(1568, 329, 306, 43);
comboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
// TODO Auto-generated method stub
textField.setText(""+e.getItem());
}
});
getContentPane().add(comboBox);
Run Code Online (Sandbox Code Playgroud)
那是我的代码.
Angular 1.5组件通信建议通常具有输出绑定以调用根控制器上的方法.
假设我有一个根组件和两个子组件.
<root>
<child-1></child-1>
<child-2></child-2>
</root>
Run Code Online (Sandbox Code Playgroud)
它想通过读取组件2上的值然后在根目录中执行某些操作来对组件1上的按钮单击做出反应.
例如,child-1是一个包含绘图库的指令,该绘图库将绘图附加到其DOM节点并具有控制该绘图的变量.
child-2有一个按钮.单击它时,child-1应将变量中的数据传递给root,后者会对其执行某些操作.
特别是,child-1包裹var graph2d = new vis.Graph2d(container, dataset, options);.稍后,我想从中检索一些信息graph2d并将其传递给它root做一些事情.
这归结为:组件如何对其他组件发出的事件做出反应?输入和输出建议似乎不包括这种情况.
custom-component ×10
android ×2
delphi ×2
java ×2
joomla ×2
jsf ×2
jsf-2 ×2
angularjs ×1
components ×1
delphi-7 ×1
extraction ×1
java-ee ×1
javascript ×1
jcombobox ×1
jscrollpane ×1
php ×1
require-once ×1
swing ×1
tcollection ×1