get widget number from array dynamically

get widget number from array dynamically