- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正在尝试从父对话框打开子对话框,它工作正常。里面有几个按钮。我面临的问题是点击监听器在子对话框中没有响应,而且子对话框没有关闭。
public class NoteListAdapter extends RecyclerView.Adapter<NoteListAdapter.NoteListHolder>{
private Context context;
private LayoutInflater inflater;
private ItemModel current;
public List<ItemModel> data;
SubListAdapter adapter;
NoteListHolder holder;
String get_text;
EditText et_get_text;
AlertDialog alert_dialog, tag_alert_dialog;
String id;
LinearLayout tag_important, tag_study, tag_progress, tag_normal, tag_watchlist, tag_shopping, tag_food,tag_enterain,
tag_transport, tag_services, tag_health;
TextView set_date;
String tag_text, tag_color;
private List<TagsModel> tagList;
String note_id;
RecyclerView sub_recycler;
/* constructor */
public NoteListAdapter(Context context, List<ItemModel> data) {
inflater = LayoutInflater.from(context);
this.context = context;
this.data = data;
}
/* notify on item delete */
public void removeItem(int position) {
data.remove(position);
notifyItemRemoved(position);
notifyDataSetChanged();
}
/* delete all items */
public void removeAll() {
data.clear();
notifyDataSetChanged();
}
@Override
public NoteListAdapter.NoteListHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View rootView = inflater.inflate(R.layout.note_recycler, parent, false);
holder = new NoteListHolder(rootView);
return holder;
}
@Override
public void onBindViewHolder(NoteListAdapter.NoteListHolder holder, int position) {
current = data.get(position);
// tag_current = tag_data.get(position);
String note_id = data.get(position).getId();
Log.d("note_idm","note id "+note_id);
ListNoteDataBase dataBase = new ListNoteDataBase(context);
dataBase.open();
dataBase.inserttags("abc ", note_id, "ef1232");
tagList = dataBase.getTagList(note_id);
String text = tagList.get(position).getTag();
String col = tagList.get(position).getTag_color();
final String input_text = current.getText();
holder.note_text.setText(input_text);
holder.tag_view.setText(text);
dataBase.close();
// holder.tagCircle.setColor(Color.parseColor("#" + col));
//holder.tagCircle.setColor(tag_color);*/
}
@Override
public int getItemCount() {
return data.size();
}
/* edit item from recycler view */
public void restoreItem(ItemModel item, int position) {
data.add(position, item);
notifyItemInserted(position);
}
/* declare and initialize NoteListHolder class*/
class NoteListHolder extends RecyclerView.ViewHolder{
private TextView note_text, tag_view;
public RelativeLayout viewBackground, viewForeground;
String note_txt_str;
LinearLayout add_tag;
Button tag_set;
public GradientDrawable tagCircle;
public NoteListHolder(View itemView) {
super(itemView);
note_text = itemView.findViewById(R.id.note_text);
viewBackground = itemView.findViewById(R.id.view_background);
viewForeground = itemView.findViewById(R.id.view_foreground);
tag_view = itemView.findViewById(R.id.tag_view);
tagCircle = (GradientDrawable) tag_view.getBackground();
viewForeground.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int pos = getAdapterPosition();
note_id = data.get(pos).getId();
Log.d("note_id", "note id " + note_id);
Bundle b = new Bundle();
b.putString("note_id", note_id);
edit_dialog();
}
});
}
private void edit_dialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setView(R.layout.notedialog);
builder.setTitle("Edit Note");
// alert_dialog = builder.create();
alert_dialog = builder.show();
alert_dialog.show();
et_get_text = alert_dialog.findViewById(R.id.txtNote);
sub_recycler = alert_dialog.findViewById(R.id.recycler_dialog);
add_tag = alert_dialog.findViewById(R.id.add_tag);
add_tag.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setView(R.layout.tag_dialog);
builder.setTitle("Select Tag");
//tag_alert_dialog = builder.create();
tag_alert_dialog = builder.show();
tag_alert_dialog.getWindow().setGravity(Gravity.BOTTOM);
tag_alert_dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
tag_alert_dialog.show();
tag_important = tag_alert_dialog.findViewById(R.id.tag_imp);
tag_food = tag_alert_dialog.findViewById(R.id.tag_food);
tag_enterain = tag_alert_dialog.findViewById(R.id.tag_enterainment);
tag_normal = tag_alert_dialog.findViewById(R.id.tag_normal);
tag_health = tag_alert_dialog.findViewById(R.id.tag_health);
tag_transport = tag_alert_dialog.findViewById(R.id.tag_transport);
tag_study = tag_alert_dialog.findViewById(R.id.tag_study);
tag_services = tag_alert_dialog.findViewById(R.id.tag_services);
tag_shopping = tag_alert_dialog.findViewById(R.id.tag_shop);
tag_progress = tag_alert_dialog.findViewById(R.id.tag_progress);
tag_watchlist = tag_alert_dialog.findViewById(R.id.tag_watchlist);
tag_set = tag_alert_dialog.findViewById(R.id.set_tag);
tag_important.setOnClickListener(this);
tag_food.setOnClickListener(this);
tag_enterain.setOnClickListener(this);
tag_normal.setOnClickListener(this);
tag_health.setOnClickListener(this);
tag_transport.setOnClickListener(this);
tag_study.setOnClickListener(this);
tag_services.setOnClickListener(this);
tag_shopping.setOnClickListener(this);
tag_progress.setOnClickListener(this);
tag_watchlist.setOnClickListener(this);
ListNoteDataBase appDatabase = new ListNoteDataBase(context);
appDatabase.open();
tagList = appDatabase.getTagList(note_id);
String tag_id = tagList.get(getAdapterPosition()).getTagId();
int id = v.getId();
switch (id) {
case R.id.tag_imp:
tag_text = "Important";
tag_color = "C61F2B";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_progress:
tag_text = "Progress";
tag_color = "A50CE2";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_study:
tag_text = "Study";
tag_color = "FCA81D";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_watchlist:
tag_text = "Watchlist";
tag_color = "F4C664";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_normal:
tag_text = "Normal";
tag_color = "10CAC5";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_shop:
tag_text = "Shopping";
tag_color = "15B412";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_food:
tag_text = "Food & Drinks";
tag_color = "F15696";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_enterainment:
tag_text = "Entertainment";
tag_color = "A3128E";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_transport:
tag_text = "Transportation";
tag_color = "3324BD";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_services:
tag_text = "Services";
tag_color = "#F3C861";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_health:
tag_text = "Health";
tag_color = "EC4A3A";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
default:
tag_text = "";
tag_color = "ffffff";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
}
tag_set.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// if (tag_alert_dialog.isShowing()) {
tag_alert_dialog.hide();
//}
}
});
}
});
final EditText et_sub_txt = alert_dialog.findViewById(R.id.et_subNote);
ImageButton sub_action = alert_dialog.findViewById(R.id.action_done);
sub_action.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String sub_text_str = et_sub_txt.getText().toString();
InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
ListNoteDataBase appDatabase = new ListNoteDataBase(context);
appDatabase.open();
appDatabase.insertsubnotes(sub_text_str, note_id);
appDatabase.close();
subNote_adapter();
et_sub_txt.getText().clear();
et_sub_txt.clearFocus();
}
});
subNote_adapter();
set_date = alert_dialog.findViewById(R.id.creation_date);
String get_date = data.get(getAdapterPosition()).getDate();
set_date.setText(get_date);
String show_dia_text = data.get(getAdapterPosition()).getText();
id = data.get(getAdapterPosition()).getId();
//set_date.setText((CharSequence) update_date);
/*set cursor position */
note_txt_str = note_text.getText().toString();
et_get_text.setText(note_txt_str);
int position = show_dia_text.length();
et_get_text.setSelection(position);
Button button_edit_done = alert_dialog.findViewById(R.id.edit_note);
button_edit_done.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
get_text = et_get_text.getText().toString().trim();
InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
ListNoteDataBase appDatabase = new ListNoteDataBase(context);
appDatabase.open();
appDatabase.updateNotes(get_text, id);
appDatabase.close();
note_text.setText(get_text);
if (alert_dialog.isShowing()) {
alert_dialog.dismiss();
}
}
});
setOnDoneButton();
}
private void setOnDoneButton() {
et_get_text.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
get_text = et_get_text.getText().toString().trim();
ListNoteDataBase appDatabase = new ListNoteDataBase(context);
appDatabase.open();
appDatabase.updateNotes(get_text, id);
appDatabase.close();
note_text.setText(get_text);
if (alert_dialog.isShowing()) {
alert_dialog.dismiss();
}
}
return false;
}
});
}
private void subNote_adapter() {
// recyclerView.setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.VERTICAL,false));
// recyclerView.addItemDecoration(new DividerItemDecoration(context, DividerItemDecoration.VERTICAL));
sub_recycler.setLayoutManager(new GridLayoutManager(context, 1));
ListNoteDataBase appDatabase = new ListNoteDataBase(context);
appDatabase.open();
adapter = new SubListAdapter(context, appDatabase.getSubList(note_id));
sub_recycler.setAdapter(adapter);
adapter.notifyDataSetChanged();
appDatabase.close();
}
}
以上代码是在我的adapter中写的。我想从单击按钮并关闭对话框中获取标签文本和标签颜色值。但它没有实现任何点击监听器。
最佳答案
public class NoteListAdapter extends RecyclerView.Adapter<NoteListAdapter.NoteListHolder>{
private Context context;
private LayoutInflater inflater;
private ItemModel current;
public List<ItemModel> data;
SubListAdapter adapter;
NoteListHolder holder;
String get_text;
EditText et_get_text;
AlertDialog alert_dialog, tag_alert_dialog;
String id;
LinearLayout tag_important, tag_study, tag_progress, tag_normal, tag_watchlist, tag_shopping, tag_food,tag_enterain,
tag_transport, tag_services, tag_health;
TextView set_date;
String tag_text, tag_color;
private List<TagsModel> tagList;
String note_id;
RecyclerView sub_recycler;
/* constructor */
public NoteListAdapter(Context context, List<ItemModel> data) {
inflater = LayoutInflater.from(context);
this.context = context;
this.data = data;
}
/* notify on item delete */
public void removeItem(int position) {
data.remove(position);
notifyItemRemoved(position);
notifyDataSetChanged();
}
/* delete all items */
public void removeAll() {
data.clear();
notifyDataSetChanged();
}
@Override
public NoteListAdapter.NoteListHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View rootView = inflater.inflate(R.layout.note_recycler, parent, false);
holder = new NoteListHolder(rootView);
return holder;
}
@Override
public void onBindViewHolder(NoteListAdapter.NoteListHolder holder, int position) {
current = data.get(position);
// tag_current = tag_data.get(position);
String note_id = data.get(position).getId();
Log.d("note_idm","note id "+note_id);
ListNoteDataBase dataBase = new ListNoteDataBase(context);
dataBase.open();
dataBase.inserttags("abc ", note_id, "ef1232");
tagList = dataBase.getTagList(note_id);
String text = tagList.get(position).getTag();
String col = tagList.get(position).getTag_color();
final String input_text = current.getText();
holder.note_text.setText(input_text);
holder.tag_view.setText(text);
dataBase.close();
// holder.tagCircle.setColor(Color.parseColor("#" + col));
//holder.tagCircle.setColor(tag_color);*/
}
@Override
public int getItemCount() {
return data.size();
}
/* edit item from recycler view */
public void restoreItem(ItemModel item, int position) {
data.add(position, item);
notifyItemInserted(position);
}
/* declare and initialize NoteListHolder class*/
class NoteListHolder extends RecyclerView.ViewHolder{
private TextView note_text, tag_view;
public RelativeLayout viewBackground, viewForeground;
String note_txt_str;
LinearLayout add_tag;
Button tag_set;
public GradientDrawable tagCircle;
public NoteListHolder(View itemView) {
super(itemView);
note_text = itemView.findViewById(R.id.note_text);
viewBackground = itemView.findViewById(R.id.view_background);
viewForeground = itemView.findViewById(R.id.view_foreground);
tag_view = itemView.findViewById(R.id.tag_view);
tagCircle = (GradientDrawable) tag_view.getBackground();
viewForeground.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int pos = getAdapterPosition();
note_id = data.get(pos).getId();
Log.d("note_id", "note id " + note_id);
Bundle b = new Bundle();
b.putString("note_id", note_id);
edit_dialog();
}
});
}
private void edit_dialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setView(R.layout.notedialog);
builder.setTitle("Edit Note");
// alert_dialog = builder.create();
alert_dialog = builder.show();
//alert_dialog.show();
et_get_text = alert_dialog.findViewById(R.id.txtNote);
sub_recycler = alert_dialog.findViewById(R.id.recycler_dialog);
add_tag = alert_dialog.findViewById(R.id.add_tag);
add_tag.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setView(R.layout.tag_dialog);
builder.setTitle("Select Tag");
//tag_alert_dialog = builder.create();
tag_alert_dialog = builder.show();
tag_alert_dialog.getWindow().setGravity(Gravity.BOTTOM);
tag_alert_dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
//tag_alert_dialog.show();
tag_important = tag_alert_dialog.findViewById(R.id.tag_imp);
tag_food = tag_alert_dialog.findViewById(R.id.tag_food);
tag_enterain = tag_alert_dialog.findViewById(R.id.tag_enterainment);
tag_normal = tag_alert_dialog.findViewById(R.id.tag_normal);
tag_health = tag_alert_dialog.findViewById(R.id.tag_health);
tag_transport = tag_alert_dialog.findViewById(R.id.tag_transport);
tag_study = tag_alert_dialog.findViewById(R.id.tag_study);
tag_services = tag_alert_dialog.findViewById(R.id.tag_services);
tag_shopping = tag_alert_dialog.findViewById(R.id.tag_shop);
tag_progress = tag_alert_dialog.findViewById(R.id.tag_progress);
tag_watchlist = tag_alert_dialog.findViewById(R.id.tag_watchlist);
tag_set = tag_alert_dialog.findViewById(R.id.set_tag);
View.OnClickListener listener=new View.OnClickListener(){
@Override
public void onClick(View v) {
int id = v.getId();
switch (id) {
case R.id.tag_imp:
tag_text = "Important";
tag_color = "C61F2B";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_progress:
tag_text = "Progress";
tag_color = "A50CE2";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_study:
tag_text = "Study";
tag_color = "FCA81D";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_watchlist:
tag_text = "Watchlist";
tag_color = "F4C664";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_normal:
tag_text = "Normal";
tag_color = "10CAC5";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_shop:
tag_text = "Shopping";
tag_color = "15B412";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_food:
tag_text = "Food & Drinks";
tag_color = "F15696";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_enterainment:
tag_text = "Entertainment";
tag_color = "A3128E";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_transport:
tag_text = "Transportation";
tag_color = "3324BD";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_services:
tag_text = "Services";
tag_color = "#F3C861";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
case R.id.tag_health:
tag_text = "Health";
tag_color = "EC4A3A";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
default:
tag_text = "";
tag_color = "ffffff";
appDatabase.updateTags(tag_text, tag_id, tag_color);
appDatabase.close();
break;
}
}
};
tag_important.setOnClickListener(listener);
tag_food.setOnClickListener(listener);
tag_enterain.setOnClickListener(listener);
tag_normal.setOnClickListener(listener);
tag_health.setOnClickListener(listener);
tag_transport.setOnClickListener(listener);
tag_study.setOnClickListener(listener);
tag_services.setOnClickListener(listener);
tag_shopping.setOnClickListener(listener);
tag_progress.setOnClickListener(listener);
tag_watchlist.setOnClickListener(listener);
ListNoteDataBase appDatabase = new ListNoteDataBase(context);
appDatabase.open();
tagList = appDatabase.getTagList(note_id);
String tag_id = tagList.get(getAdapterPosition()).getTagId();
tag_set.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// if (tag_alert_dialog.isShowing()) {
tag_alert_dialog.hide();
//}
}
});
}
});
final EditText et_sub_txt = alert_dialog.findViewById(R.id.et_subNote);
ImageButton sub_action = alert_dialog.findViewById(R.id.action_done);
sub_action.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String sub_text_str = et_sub_txt.getText().toString();
InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
ListNoteDataBase appDatabase = new ListNoteDataBase(context);
appDatabase.open();
appDatabase.insertsubnotes(sub_text_str, note_id);
appDatabase.close();
subNote_adapter();
et_sub_txt.getText().clear();
et_sub_txt.clearFocus();
}
});
subNote_adapter();
set_date = alert_dialog.findViewById(R.id.creation_date);
String get_date = data.get(getAdapterPosition()).getDate();
set_date.setText(get_date);
String show_dia_text = data.get(getAdapterPosition()).getText();
id = data.get(getAdapterPosition()).getId();
//set_date.setText((CharSequence) update_date);
/*set cursor position */
note_txt_str = note_text.getText().toString();
et_get_text.setText(note_txt_str);
int position = show_dia_text.length();
et_get_text.setSelection(position);
Button button_edit_done = alert_dialog.findViewById(R.id.edit_note);
button_edit_done.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
get_text = et_get_text.getText().toString().trim();
InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
ListNoteDataBase appDatabase = new ListNoteDataBase(context);
appDatabase.open();
appDatabase.updateNotes(get_text, id);
appDatabase.close();
note_text.setText(get_text);
if (alert_dialog.isShowing()) {
alert_dialog.dismiss();
}
}
});
setOnDoneButton();
}
private void setOnDoneButton() {
et_get_text.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
get_text = et_get_text.getText().toString().trim();
ListNoteDataBase appDatabase = new ListNoteDataBase(context);
appDatabase.open();
appDatabase.updateNotes(get_text, id);
appDatabase.close();
note_text.setText(get_text);
if (alert_dialog.isShowing()) {
alert_dialog.dismiss();
}
}
return false;
}
});
}
private void subNote_adapter() {
// recyclerView.setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.VERTICAL,false));
// recyclerView.addItemDecoration(new DividerItemDecoration(context, DividerItemDecoration.VERTICAL));
sub_recycler.setLayoutManager(new GridLayoutManager(context, 1));
ListNoteDataBase appDatabase = new ListNoteDataBase(context);
appDatabase.open();
adapter = new SubListAdapter(context, appDatabase.getSubList(note_id));
sub_recycler.setAdapter(adapter);
adapter.notifyDataSetChanged();
appDatabase.close();
}
}
关于android - Dialogox 中的按钮单击监听器问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52400170/
所以我有这个 javascript 片段,它有两个按钮可以进入全屏,一个按钮可以退出全屏。我想做到这一点,如果我不在全屏模式下,按钮会显示转到全屏模式,而当我处于全屏模式时,按钮会显示退出全屏模式..
我在自定义控件中添加了一个新属性作为可扩展属性,例如属性网格中的字体属性。在 Windows 窗体应用程序项目中使用我的自定义控件后,我在属性网格中看到一个省略号 (…) 按钮,如字体属性的“…”按钮
我在自定义控件中添加了一个新属性作为可扩展属性,例如属性网格中的字体属性。在 Windows 窗体应用程序项目中使用我的自定义控件后,我在属性网格中看到一个省略号 (…) 按钮,如字体属性的“…”按钮
我尝试将 Twitter 上的“Tweet Me”按钮 ( http://twitter.com/goodies/tweetbutton ) 添加到我的网站。然而,每当按下按钮时,我都会收到此 Jav
我试图在我的文本区域中获取一个按钮值,如果我使用 则工作正常但如果我使用那么它就不起作用了。你能找出问题所在吗? HTML 1 2 3 4 JavaScript $(document).read
我的 C# Winform 面板中有一堆文本框。每行文本框的命名如下: tb1 tbNickName1 comboBox1 tb2 tbNickName2 comboBox2 tb3 tbNickNa
我有一个表单,其中过滤器下方有按钮(应用过滤器和清除过滤器),我试图在单击“应用”按钮时显示“清除”,并在单击“清除”按钮时隐藏“清除”按钮。 下面的代码(如果我的表有的话):
excel 按钮正在工作,但是当我添加 pdf 按钮时,它添加仅显示 pdf 按钮 excel 按钮在 pdf 按钮添加后隐藏 $(document).ready(function() { $
我想创建一个 div 作为标题并分成 3 列,并按以下顺序在其中放置 2 个按钮和一个标题:Button1(左位) Title(居中) Button2(右位) 这是我为这个 div 编写的代码:
仅当选中所有框时才应禁用“允许”按钮。我该怎么做?我已经完成了 HTML 部分,如下所示。如何执行其中的逻辑部分?即使未选中一个复选框,也应禁用“允许”按钮
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
如您所知,您可以使用 2 种方法在 HTML5 中呈现按钮: 使用 void 元素 或 如果您需要内容,请使用 元素(不是空元素)。 在JSF2中,有2种方式生成按钮;与UICommand或 UIOu
我尝试根据表单元素的更改禁用/启用保存按钮。但是,当通过弹出按钮选择更改隐藏输入字段值时,保存按钮不受影响。 下面是我的代码。我正在尝试序列化旧的表单值并与更改后的表单值进行比较。但我猜隐藏的字段值无
我有用于在消息(电子邮件、短信)上输入内容的 EditText。我希望在单击 ActionDone 按钮时立即发布消息。我为此使用以下代码: message.setOnEditorActionList
我的 Android 应用程序中有一堆 EditText,每个都将 InputMethod 设置为 numberSigned。我的目标设备没有硬件键盘,而是使用软件键盘输入数字。 Android 将输
我无法以编程方式隐藏弧形菜单中的 fab 按钮。我正在使用https://github.com/saurabharora90/MaterialArcMenu在我的代码中。如何在Java中以编程方式隐藏
我已经看到这在其他类型的对话框窗口中是可能的,例如“showConfirmDialog”,其中可以指定按钮的数量及其名称;但是使用“showInputDialog”时是否可以实现相同的功能?我似乎无法
相同的按钮用于激活和停用。第一次,当代码运行按钮单击并成功“停用”时。但第二次,代码无法找到该元素。第一个案例按钮位于第二个“a”标签中,然后停用第一个“a”标签中的按钮。 案例1: Edit
是否可以将按钮的 onclick 操作设置为 JavaScript 变量?这个想法是我们用 JavaScript 控制一个表。每当点击该表的一行时,我们就会更新一个 JavaScript 变量。该 v
我想创建一个按钮,它包含左侧的文本和右侧的复选框(或任何其他组件)。我怎样才能做到这一点? 我发现我可以制作自己的 View extends Button,但是如果可以的话我应该如何实现 onDraw
我是一名优秀的程序员,十分优秀!