On an onboard cone-beam CT (CBCT) system, the poly-energetic beam generated by current commercial x-ray tubes hardens as it penetrates the object. The beam-hardening effect results in CT image artifacts of up to 100 HU, especially around dense objects (e.g. bones). We propose to insert a half-blocked beam filter between x-ray source and object, such that any ray passing through the object is filtered once from one of the opposite directions in a single full scan. The conventional data processing of dual energy imaging is then applied to obtain material decomposition as well as CT images with no beam-hardening artifacts. In this preliminary study, we demonstrate the method feasibility using computer simulations. The beam filter thickness is optimized to balance the CT number accuracy and the noise level on the reconstructed images via both analytical calculation and measurement of image noise. A calibration phantom is designed to obtain the decomposition function for energy selective imaging by projection measurements without the knowledge of x-ray spectrum and detector response. Using the optimized beam blocker and the calibration phantom, we simulate the data acquisition using scan settings of a commercial CBCT system. Our proposed approach significantly suppresses beam-hardening artifacts and reduces the image error from 65 HU to 9 HU in the selected regions of interest on a head phantom. The method also successfully decomposes bone and soft tissue, with 95% accuracy.