Complete category filter

- Merge some confused variable names
- Modify and complete building general dialog
- Seperate attribute id and name global variables